LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
lapack.h File Reference

The five LAPACK routines the port calls, behind one indirection. More...

#include <string>
#include "line/util/error.h"
Include dependency graph for lapack.h:

Go to the source code of this file.

Detailed Description

The five LAPACK routines the port calls, behind one indirection.

Every LAPACK call in the tree goes through line::lapack::<routine> rather than the Fortran symbol, so that HOW the library is reached is decided here and nowhere else. There are two ways, chosen at configure time:

  • LINE_MP_LAPACK_DLOPEN (the default): the library is NOT linked. The first call loads it with dlopen and resolves the routine with dlsym. A published binary (common/ldes, common/line-cli, the wheel's bin/ldes) then carries no DT_NEEDED entry for liblapack.so.3, so it STARTS on a machine that has no LAPACK at all, and only a computation that actually reaches one of these routines refuses, by name, with the install hint. Before 2026-11-02 the link-time dependency made such a machine fail at exec (error while loading shared libraries: liblapack.so.3, exit 127) for every model, including the ones that never touch LAPACK.

    This is also the licensing answer. Every distro LAPACK is gfortran-built, so it reaches libquadmath (LGPL-2.1) through libgfortran; linking it statically was removed on 2026-11-01 for exactly that reason. Loading the USER'S OWN copy at run time links nothing of it into the binary.

  • otherwise: the Fortran symbols are declared and linked directly, as before. r/capi uses this, because R supplies its own LAPACK at link time.

Candidates, first hit wins: $LINE_LAPACK_LIBRARY (a path or soname), then liblapack.so.3 (whatever the distro's alternatives point at, which is what a linked build would have used), liblapack.so, libopenblas.so.0, libopenblas.so, libflexiblas.so.3; on macOS the Accelerate framework, then liblapack.dylib. The library is opened RTLD_LOCAL so its symbols cannot interpose on anything else in the process.

Definition in file lapack.h.