Skip to content

ciresnave/onemkl

oneMKL Rust bindings

Two crates that expose Intel oneAPI Math Kernel Library (oneMKL) to Rust:

  • onemkl-sys — comprehensive raw FFI bindings, generated by bindgen from the official mkl.h umbrella header.
  • onemkl — safe, idiomatic Rust API built on top of onemkl-sys.

For current coverage and what's planned, see ROADMAP.md.

Requirements

  • Intel oneAPI Math Kernel Library installed locally. The build script searches MKLROOT, ONEAPI_ROOT/mkl/latest, and standard install paths.
  • LLVM / libclang for bindgen (set LIBCLANG_PATH to your LLVM bin directory if not auto-detected).
  • A recent Rust toolchain (this project is on Edition 2024, MSRV 1.95).

Build

cargo build --workspace
cargo test --workspace

If the build can't find your MKL install, set MKLROOT:

# Windows
$env:MKLROOT = "C:\Program Files (x86)\Intel\oneAPI\mkl\latest"

# Linux / macOS
export MKLROOT=/opt/intel/oneapi/mkl/latest

Feature flags

Build configuration (onemkl-sys and onemkl)

Exactly one feature must be selected from each of:

Group Features
Interface lp64 (default), ilp64
Threading threading-sequential (default), threading-intel-openmp, threading-tbb
Linkage link-dynamic (default), link-static

Per-domain (onemkl)

Each oneMKL domain has its own feature, all enabled by default. Foundation modules (error, enums, matrix, scalar, service) are always built.

Feature Module
blas onemkl::blas
data-fitting onemkl::data_fitting
dss onemkl::dss
feast onemkl::feast
fft onemkl::fft
iss onemkl::iss
lapack onemkl::lapack
optim onemkl::optim
pardiso onemkl::pardiso
pde onemkl::pde
preconditioners onemkl::preconditioners
rng onemkl::rng
sparse onemkl::sparse
vm onemkl::vm

For a minimal build pulling in only BLAS and LAPACK:

[dependencies.onemkl]
version = "..."
default-features = false
features = [
    "lp64", "threading-sequential", "link-dynamic",
    "blas", "lapack",
]

Opt-in MPI domains (onemkl-sys)

Off by default; require an MPI runtime: cluster-sparse-solver, cdft, scalapack, blacs, pblas.

License

Dual-licensed under MIT or Apache-2.0, at your option.

These bindings link against Intel oneMKL, which has its own license terms (the Intel Simplified Software License). Comply with both.

About

Unofficial Rust wrapper for Intel's oneMKL library

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages