Skip to content

Commit 7546096

Browse files
authored
Expose MKL linkage, fixes segfaults with lapack crate. (#11)
* expose granular mkl features, change which mkl is linked by default * expose mkl for all features * simplify mkl linkage options * Update netlib-src * expose granular mkl features, change which mkl is linked by default * Update netlib-src * fix extra comma * address review comments * bump version, expose 2x2 feature matrix for mkl linkage
1 parent a36e69c commit 7546096

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lapack-src"
3-
version = "0.12.0"
3+
version = "0.13.0"
44
edition = "2024"
55
license = "Apache-2.0 OR MIT"
66
authors = [
@@ -24,7 +24,10 @@ changelog = "CHANGELOG.md"
2424

2525
[features]
2626
accelerate = ["accelerate-src"]
27-
intel-mkl = ["intel-mkl-src"]
27+
intel-mkl-dynamic-parallel = ["intel-mkl-src/mkl-dynamic-lp64-iomp"]
28+
intel-mkl-dynamic-sequential = ["intel-mkl-src/mkl-dynamic-lp64-seq"]
29+
intel-mkl-static-parallel = ["intel-mkl-src/mkl-static-lp64-iomp"]
30+
intel-mkl-static-sequential = ["intel-mkl-src/mkl-static-lp64-seq"]
2831
netlib = ["netlib-src"]
2932
openblas = ["openblas-src"]
3033
r = ["r-src"]
@@ -47,4 +50,4 @@ optional = true
4750

4851
[dependencies.r-src]
4952
version = "0.2.1"
50-
optional = true
53+
optional = true

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ lapack-src = { version = "0.12", features = ["openblas"] }
2626
lapack-src = { version = "0.12", features = ["r"] }
2727
```
2828

29+
### Intel MKL Configuration
30+
31+
The `intel-mkl` feature will *statically* link the *sequential LP64* version of
32+
the MKL library. To link other versions of the library, check the `intel-mkl-*-*-*`
33+
features inside this crate, which are analogous to the feature flags of
34+
the [`intel-mkl-src` crate] (https://crates.io/crates/intel-mkl-src).
35+
2936
## Contribution
3037

3138
Your contribution is highly appreciated. Do not hesitate to open an issue or a

src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
//! The following implementations are available:
88
//!
99
//! * `accelerate`, which is the one in the [Accelerate] framework (macOS only),
10-
//! * `intel-mkl`, which is the one in [Intel MKL],
10+
//! * `intel-mkl-*`, which is the one in [Intel MKL], where
11+
//! * `intel-mkl-dynamic-parallel` dynamically links the parallel backend of MKL
12+
//! * `intel-mkl-dynamic-sequential` dynamically links the sequential backend of MKL
13+
//! * `intel-mkl-static-parallel` statically links the parallel backend of MKL
14+
//! * `intel-mkl-static-sequential` statically links the sequential backend of MKL
1115
//! * `netlib`, which is the reference one by [Netlib],
1216
//! * `openblas`, which is the one in [OpenBLAS], and
1317
//! * `r`, which is the one in [R].
@@ -37,7 +41,12 @@
3741
#[cfg(feature = "accelerate")]
3842
extern crate accelerate_src as raw;
3943

40-
#[cfg(feature = "intel-mkl")]
44+
#[cfg(any(
45+
feature = "intel-mkl-dynamic-parallel",
46+
feature = "intel-mkl-dynamic-sequential",
47+
feature = "intel-mkl-static-parallel",
48+
feature = "intel-mkl-static-sequential",
49+
))]
4150
extern crate intel_mkl_src as raw;
4251

4352
#[cfg(feature = "netlib")]

0 commit comments

Comments
 (0)