| Crates.io | rstsr-openblas-ffi |
| lib.rs | rstsr-openblas-ffi |
| version | 0.5.0 |
| created_at | 2025-02-08 05:02:17.450868+00 |
| updated_at | 2025-08-26 14:39:03.095244+00 |
| description | OpenBLAS FFI bindings |
| homepage | |
| repository | https://github.com/RESTGroup/rstsr-ffi |
| max_upload_size | |
| id | 1547768 |
| size | 6,159,628 |
This crate contains OpenBLAS FFI bindings.
Current FFI version is OpenBLAS v0.3.30. If you are using an older version of OpenBLAS, this crate should still work if you do not explicitly call the function that only occurs in higher version of OpenBLAS.
OpenBLAS (C/Fortran/ASM) 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.
dynamic_loading.This crate supports dynamic loading.
If you want to use dynamic loading, please enable cargo feature dynamic_loading when cargo build.
The dynamic loading will try to find proper library when your program initializes.
LD_LIBRARY_PATH (Linux) DYLD_LIBRARY_PATH (Mac OS), PATH (Windows).RSTSR_DYLOAD_OPENBLAS to the dynamic library path.NOTE: When you call BLAS and LAPACK functions with dynamic loading, please DO NOT USE other crates (such as rstsr_lapack_ffi). Please make sure you are only using rstsr_openblas_ffi::blas, rstsr_openblas_ffi::cblas and rstsr_openblas_ffi::lapack. Sticking to using rstsr_openblas_ffi will make sure you are calling BLAS and LAPACK functions from OpenBLAS, instead of other BLAS vendors.
If you encountered large compile time or disk consumption, you may consider add these lines in your Cargo.toml:
[profile.dev.package.rstsr-openblas-ffi]
opt-level = 0
debug = false
Default features:
blas: Inclulde BLAS bindgens.cblas: Include CBLAS bindgens.lapack: Include LAPACK bindgens.Optional features:
dynamic_loading: Supports dynamic loading.ilp64: Use int64_t for dimension specification, or lapack error code types if this feature specified. Otherwise, use int32_t.
blas, error code is returned by c_int; in module cblas, OpenBLAS utility functions use c_int for input or output.lapacke: Include LAPACKE bindgens.quad_precision and ex_precision: Specify type extra-precision xdouble type in module blas. Probably few people will require these features.header: Header files copied (or renamed) from original source.scripts: Script to generate FFI bindgens.src: FFI bindings:
blas: Corresponds to f77blas.h header in compiled library include (or common_interface.h in OpenBLAS original source code). BLAS and some LAPACK functions that implemented by OpenBLAS, no post-suffix underscore.cblas: Corresponds to cblas.h header. Original CBLAS included, along with OpenBLAS utility functions (e.g. openblas_get_num_threads) and some BLAS extensions (e.g. cblas_zgemm_batch).ffi_base.rs: Basic type, enum, struct definitions.ffi_extern.rs: Unsafe extern "C" bindgen functions. Only activated when not dynamic loading.dyload_struct.rs: Struct Lib for dynamic loading.dyload_initializer.rs: The initialization function of Lib for dynamic loading.dyload_compatible.rs: Unsafe bindgen function that is compatible to that of ffi_extern.rs. Only activated when dynamic loading.cblas::ffi_base: the enums CBLAS_TRANSPOSE, CBLAS_UPLO, etc comes from crate rstsr_lapack_ffi for convenience. This crate depends on rstsr_lapack_ffi for those definitions of enums.v0.5.0
dynamic_loading is not default.v0.4.5
v0.4.4
v0.4.3
rstsr-cblas-base.v0.4.1
v0.4.0
omp_set_num_threads and omp_get_max_threads for convenience.