-
Notifications
You must be signed in to change notification settings - Fork 1
Home
This page gives an overview of the BLAS–LAPACK family of packages.
There are three types of packages:
- wrappers,
- bindings, and
- sources.
Wrappers operate on Rust types, such as isize
and f32
, whereas bindings operate on C types from libc
, such as c_int
and c_float
. Internally, wrappers invoke the corresponding bindings with as little overhead as possible. Sources compile (if needed) and link to particular implementations of BLAS and LAPACK.
In order to be able to work with the chosen wrapper/binding package, one has to choose a source package as well and add it to the dependencies
section in Cargo.toml
along with the wrapper/binding package. For instance, Cargo.toml
might look as follows:
[dependencies]
blas = "0.20"
openblas-src = "0.9"
Remember to mention the source package in the code as well. For instance, main.rs
might look as follows:
extern crate blas;
extern crate openblas_src;
The following sections list the available wrapper, binding, and source packages.
The following packages provide wrappers for BLAS and LAPACK:
The blas
and cblas
packages contain BLAS functions, whereas lapack
and lapacke
contain LAPACK functions. The blas
and lapack
packages contain Fortran functions, whereas cblas
and lapacke
contain C functions.
The following packages provide bindings to BLAS and LAPACK:
-
blas-sys (Fortran)
-
cblas-sys (C)
-
lapack-sys (Fortran)
-
lapacke-sys (C)
The separation here is analogous to the one described in the previous section.
The following packages provide concrete implementations of BLAS and LAPACK:
-
accelerate-src (Apple, macOS only, no LAPACKE)
In addition, there are the following packages that aggregate the above source packages in order to provide a single access point to them:
The former is meant to be used with BLAS-related packages, whereas the latter is meant to be used with LAPACK-related packages. In this case, the desired implementation is selected by activating an appropriate feature, as in:
[dependencies]
blas-src = { version = "0.7", features = ["blis"] }