This is a Kotlin Multiplatform port of the build-configuration policy in intel-mkl-src.
Original Project: This port is based on intel-mkl-src. The configuration choices and fallback rules follow the upstream build script.
The Kotlin API implements the portable configuration policy from upstream build.rs: selection of all eight MKL linkage features, the default static ILP64 Intel OpenMP configuration, system-library priority, and static-package fallback references for Linux and Windows. Derived source files carry a // port-lint: source <path> header.
This artifact provides build-configuration data. It does not contain Intel MKL binaries, discover installed libraries, download OCI packages, emit native linker flags, or expose BLAS/LAPACK bindings. Those operations belong to the consuming native build. The upstream library source has no runtime declarations; its behavior lives in the build script.
The text below is reproduced from
https://github.com/rust-math/intel-mkl-src. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs where appropriate so they continue to resolve from this repository.
| crate | crate.io | docs.rs | master | description |
|---|---|---|---|---|
| intel-mkl-src | Source crate for Intel-MKL | |||
| intel-mkl-sys | FFI for Intel-MKL vector math, and statistical functions | |||
| intel-mkl-tool | Seek Intel-MKL libraries from filesystem |
intel-mkl-src crate is a *-src crate. This links MKL libraries to executable build by cargo, but does not provide Rust bindings.
Please use blas-sys, lapack-sys, or fftw-sys to use BLAS, LAPACK, FFTW interface of MKL, e.g.
[dependencies]
fftw-sys = { version = "0.4", features = ["intel-mkl"] }Binding to MKL specific features are provided by intel-mkl-sys crate. This contains
intel-mkl-tool crate seeks system MKL library installed by various installer as following manner:
- Seek using
pkg-configcommand - Seek
${MKLROOT}directory - Seek default installation path
/opt/intel/mklfor LinuxC:/Program Files (x86)/IntelSWTools/andC:/Program Files (x86)/Intel/oneAPIfor Windows
If intel-mkl-tool does not find MKL library, intel-mkl-src try to download MKL binaries from GitHub Container Registry (ghcr.io).
There are 8 (=2x2x2) mkl-*-*-* features to specify how to link MKL libraries.
If any feature is set, default to mkl-static-ilp64-iomp.
dynamic means MKL is linked dynamically, i.e. the executable does not contains MKL libraries
and will seek them from filesystem while execution.
This is better choice when the MKL libraries are managed by the system package manager e.g. apt.
static means MKL is linked statically, i.e. the MKL binaries are embedded in the executable file.
This is better choice when creating portable executable.
This specify the data model:
ilp64meansint(i),long(l), and pointers (p) are 64-bit.lp64meanslong(l) and pointers (p) are 64-bit,intis 32-bit.
iompmeans MKL uses Intel OpenMP runtimeseqmeans sequential (single thread) execution
Using GNU OpenMP runtime (libgomp) is not supported yet. Please see rust-math/intel-mkl-src#97
MKL is distributed under the Intel Simplified Software License for Intel(R) Math Kernel Library, See License.txt. Some wrapper codes are licensed by MIT License (see the header of each file).
dependencies {
implementation("io.github.kotlinmania:intel-mkl-src-kotlin:0.1.1")
}./gradlew build
./gradlew test
./gradlew setupAndroidSdk centralPortalBundle -PRELEASE_SIGNING_ENABLED=falseThe final command stages every publication and creates the complete unsigned deployment bundle without uploading it. CI runs this same publication graph.
import io.github.kotlinmania.intelmklsrc.MklBuildConfiguration
val configuration = MklBuildConfiguration.fromFeatures(listOf("mkl-static-lp64-seq"))
val fallback = configuration.fallbackPackage("linux", systemLibraryFound = false)
// ghcr.io/rust-math/rust-mkl/linux/mkl-static-lp64-seq:2020.1-3038006115An empty feature list selects mkl-static-ilp64-iomp. Conflicting MKL features are rejected. A discovered system library, dynamic linkage, or any target OS other than linux or windows yields no fallback package.
- JVM and Android (API 24+)
- JS (browser + Node.js)
- Wasm-JS (browser + Node.js)
- Wasm-WASI (Node.js)
- Linux x64 / ARM64 and Windows x64
- Android Native ARM64 / x64
- macOS ARM64, iOS ARM64 / simulator ARM64, tvOS ARM64 / simulator ARM64, watchOS device ARM64 / simulator ARM64
These targets run the portable configuration API. They do not imply that native Intel MKL binaries are available for each target. Apple targets also expose the configuration API through Swift Export and XCFrameworks.
See AGENTS.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
The configuration policy translated from the upstream build script retains its MIT license and Toshiki Teramura attribution. Intel MKL binaries are distributed separately under Intel's terms.
The existing repository LICENSE contains the Apache 2.0 terms; LICENSE-MIT contains the terms for the translated configuration code.
Original work copyrighted by the intel-mkl-src authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the intel-mkl-src maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.