Nim bindings for the LAPACK libraries.
These are low-level bindings generated via c2nim. See nimlapack.html for
the API documentation.
For a higher-level linear algebra library based on this, check out neo.
The library requires to link some LAPACK implementation to perform the actual linear algebra operations. By default, it tries to link whatever is the default system-wide LAPACK implementation.
You can link against a different LAPACK implementation by a combination of:
- changing the path for linked libraries (use
--clibdirfor this) - using the
--define:lapackflag. By default, the system tries to load a LAPACK library calledlapack, which translates into something calledlapack.dllorliblapack.soaccording to the underling operating system. To link, say, the librarylibopenblas.so.3on Linux, you should pass to Nim the option--define:lapack=openblas.
See the tasks inside nimblas.nimble for a few examples.
Packages for various LAPACK implementations are available from the package
managers of many Linux distributions. On OSX one can add the brew formulas
from Homebrew Science, such
as brew install homebrew/science/openblas.
You may also need to add suitable paths for the includes and library dirs. On OSX, this should do the trick
switch("clibdir", "/usr/local/opt/openblas/lib")
switch("cincludes", "/usr/local/opt/openblas/include")