#bindings #blas-lapack #lapack #blas #ffi

rstsr-lapack-ffi

Netlib LAPACK FFI bindings

2 releases

new 0.1.1 Apr 15, 2025
0.1.0 Apr 14, 2025

#282 in Machine learning

50 downloads per month
Used in 6 crates (2 directly)

Apache-2.0

1.5MB
60K SLoC

Netlib LAPACK FFI bindings

This crate contains netlib (reference) LAPACK FFI bindings.

Current FFI version is LAPACK v3.12.1.

Netlib LAPACK (C/Fortran) source code is available on github.

This crate is not official bindgen project. It is originally intended to serve rust tensor toolkit RSTSR and rust electronic structure toolkit REST.

  • Audience: Anyone uses BLAS and LAPACK function may also find it useful, not only RSTSR or REST program developers.
  • FFI-only: Program developer is not required to actually install every components in LAPACK (especially LAPACKE). Rust FFI bindings is only declaration. For example, you only need to install LAPACKE when you link LAPACKE functions into main program or library. In other words, as long as you do not link LAPACKE functions, compiler will not raise error if symbols of these functions are not found.

Cargo features

  • ilp64: Use int64_t for dimension specification, or lapack error code types if this feature specified. Otherwise, use int32_t.
    • Please note that in LAPACKE, matrix layout (mostly the first argument in LAPACKE functions) is always core::ffi::c_int, dependent to c compiler.

Crate structure

  • header: Header files copied (or renamed) from original source.
  • scripts: Script to generate FFI bindgens.
  • src: FFI bindings:
    • blas
    • cblas
    • lapack
    • lapacke

No runtime deps

Features