This repository contains a Rust package to build and link BLIS, the BLAS-like Library Instantiation Framework. It can be used as a BLAS implementation via (Fortran) BLAS and/or CBLAS interfaces from blas-sys and cblas-sys respectively. Users simply seeking a fast BLAS are encouraged to use blas-src with the following in Cargo.toml:
[dependencies]
blas-src = { version = "0.10", features = ["blis"] }To access the full BLIS API, direct use of extern "C" is necessary at this time.
The following Cargo features are supported:
cblasto build the CBLAS interface (enabled by default),staticto linklibblis.astatically,- exactly one of
pthreads,openmp,serialto specify the threading mode (pthreadsby default), and systemdo not compile BLIS and instead use a system-provided version (must be in system's default link path).
The system feature is convenient after apt install libblis-dev or brew install blis, for example. When system is disabled, BLIS is built to use run-time dispatch to microkernels optimized for the target architecture; a single binary is thus portable and optimized for all x86-64 CPUs.
Use the --target option to cargo build and set the environment variables TARGET_CC, TARGET_FC (to detect Fortran calling convention), TARGET_AR, TARGET_RANLIB, TARGET_CFLAGS, and TARGET_LDFLAGS.
BLIS does not currently support runtime CPU detection on ARM and PowerPC targets, so you must set BLIS_CONFNAME to a suitable value for the target (e.g., cortexa57 or power9; see BLIS docs).
All original work licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.