Need help with ndarray-linalg?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

221 Stars 41 Forks Other 1.2K Commits 49 Opened issues


Linear algebra package for rust-ndarray using LAPACK binding

Services available


Need anything else?

Contributors list



Linear algebra package for Rust with ndarray based on external LAPACK implementations.


See examples directory.

Note: To run examples, you must specify which backend will be used (as described below). For example, you can execute the solve example with the OpenBLAS backend like this:

cargo run --example solve --features=openblas

and run all tests of ndarray-linalg with OpenBLAS

cargo test --features=openblas

Backend Features

There are three LAPACK source crates:

must link just one of them for LAPACK FFI.
ndarray = "0.14"
ndarray-linalg = { version = "0.13", features = ["openblas-static"] }

Supported features are following:

| Feature | Link type | Requirements | Description | |:-----------------|:---------------|:--------------------|:-----------------------------------------------------------------------------------------------| | openblas-static | static | gcc, gfortran, make | Build OpenBLAS in your project, and link it statically | | openblas-system | dynamic/static | libopenblas-dev | Seek OpenBLAS in system, and link it | | netlib-static | static | gfortran, make | Same as openblas-static except for using reference LAPACK | | netlib-system | dynamic/static | liblapack-dev | Same as openblas-system except for using reference LAPACK | | intel-mkl-static | static | (pkg-config) | Seek static library of Intel MKL from system, or download if not found, and link it statically | | intel-mkl-system | dynamic | (pkg-config) | Seek shared library of Intel MKL from system, and link it dynamically |

  • You must use just one feature of them.
  • dynamic/static
    means it depends on what is found in the system. When the system has
    , it will be linked dynamically, and
    will be linked statically. Dynamic linking is prior to static linking.
  • Requirements notices:
    • gcc
      can be another compiler, e.g.
    • libopenblas-dev
      is package name in Debian, Ubuntu, and other derived distributions. There are several binary packages of OpenBLAS, i.e.
      . It can be other names in other distributions, e.g. Fedora, ArchLinux, and so on.
    • pkg-config
      is used for searching Intel MKL packages in system, and it is optional. See intel-mkl-src/ for detail.

For library developer

If you creating a library depending on this crate, we encourage you not to link any backend:

ndarray = "0.13"
ndarray-linalg = "0.12"

The cargo's feature is additive. If your library (saying

) set a feature
, the application using
builds ndarray_linalg with
feature though they want to use

See the cargo reference for detail

Tested Environments

Only x86_64 system is supported currently.

|Backend | Linux | Windows | macOS | |:--------|:-----:|:-------:|:-----:| |OpenBLAS |✔️ |- |- | |Netlib |✔️ |- |- | |Intel MKL|✔️ |✔️ |✔️ |

Generate document with KaTeX

You need to set

RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps

This only works for

build because
does not exists for dependent crates. If you wish to set
automatically in this crate, you can put .cargo/config:
rustdocflags = ["--html-in-header", "katex-header.html"]

But, be sure that this works only for

cargo doc
will fail with this


CAUTION Be sure that if you use

backend, you have to accept Intel Simplified Software License in addition to the MIT-License or Apache-2.0 License.

Dual-licensed to be compatible with the Rust project. Licensed under the Apache License, Version 2.0 or the MIT license, at your option.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.