GithubHelp home page GithubHelp logo

nimlapack's Introduction

NimLAPACK

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.

Linking LAPACK implementations

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 --clibdir for this).
  • using the --define:lapack flag. By default (i.e. if you don't set this flag), the system tries to load a LAPACK library by looking for the most common LAPACK library file names according to the underling operating system (e.g. lapack.dll, openblas.dll, libopenblas.dll, mkl_intel_lp64.dll in Windows or liblapack.so on Linux, etc). However, if you want to link to one specific library, such as, say, the library libopenblas.so.3 on Linux you should pass to Nim the option --define:lapack=openblas. Note the missing lib prefix and .so suffix, which nimlapack adds automatically (similarly on windows you should not include the .dll extension when setting this flag).

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. On Windows you can download pre-built binaries from the OpenBLAS github repository and add the library folder to your PATH or copy it into your executable folder.

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")

nimlapack's People

Contributors

andreaferretti avatar angelezquerra avatar angelezquerraatkeysight avatar ringabout avatar vindaar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.