15 releases

0.10.4 Apr 2, 2021
0.10.2 Jan 30, 2021
0.10.1 Sep 12, 2020
0.9.0 Mar 8, 2020
0.5.0 May 23, 2016

#393 in Math

Download history 3611/week @ 2021-08-18 1990/week @ 2021-08-25 1061/week @ 2021-09-01 1634/week @ 2021-09-08 2034/week @ 2021-09-15 1336/week @ 2021-09-22 1833/week @ 2021-09-29 2553/week @ 2021-10-06 2238/week @ 2021-10-13 1992/week @ 2021-10-20 1396/week @ 2021-10-27 2056/week @ 2021-11-03 1896/week @ 2021-11-10 2118/week @ 2021-11-17 1440/week @ 2021-11-24 1532/week @ 2021-12-01

7,368 downloads per month
Used in 52 crates (31 directly)



GNU Style Assembly 1M SLoC // 0.0% comments C 390K SLoC // 0.3% comments FORTRAN Legacy 316K SLoC // 0.7% comments Python 269 SLoC // 0.1% comments Rust 221 SLoC // 0.1% comments C++ 178 SLoC // 0.0% comments Shell 45 SLoC

openblas-src Package Documentation Build

The package provides a source of BLAS and LAPACK via OpenBLAS.



The following Cargo features are supported:

  • cache to build in a shared directory instead of target (see below),
  • cblas to build CBLAS (enabled by default),
  • lapacke to build LAPACKE (enabled by default),
  • static to link to OpenBLAS statically, and
  • system to skip building the bundled OpenBLAS.


The cache feature allows the OpenBLAS build products to be reused between crates that have different target directories. This avoids rebuilding OpenBLAS unnecessarily. However, this also prevents cargo clean from working properly, since the aforementioned build products will not be removed by the command.

The OpenBLAS binary will be placed at ${XDG_DATA_HOME}/openblas_build/[hash of build configure object]. For example, build with LAPACK and build without LAPACK will be placed on different directories. If you build OpenBLAS as a shared library, you need to add the above directory to LD_LIBRARY_PATH (for Linux) or DYLD_LIBRARY_PATH (for macOS). Since build from source is not supported on Windows (see next section), this feature is also not supported.

Windows and vcpkg

On Windows, openblas-src relies on vcpkg to find OpenBLAS. Before building, you must have the correct OpenBLAS installed for your target triplet and kind of linking. For instance, to link dynamically for the x86_64-pc-windows-msvc toolchain, install openblas for the x64-windows triplet:

vcpkg install openblas --triplet x64-windows

To link statically, install openblas for the x64-windows-static triplet:

vcpkg install openblas --triplet x64-windows-static

Cross Compilation

Apart from providing the --target option to cargo build, one also has to specify the cross-compilation variables of OpenBLAS. They can be set as environment variables for cargo build using the OPENBLAS_ prefix as follows: OPENBLAS_CC, OPENBLAS_FC, OPENBLAS_HOSTCC, and OPENBLAS_TARGET.


Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.