Skip to content

Commit 325f048

Browse files
committed
Remove default feature, use mkl-static-ilp64-iomp if no features
1 parent 914a1ba commit 325f048

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

intel-mkl-src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build = "build.rs"
1616
links = "mkl_core"
1717

1818
[features]
19-
default = ["mkl-static-ilp64-seq"]
19+
default = []
2020

2121
# MKL config
2222
# https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html

intel-mkl-src/build.rs

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,34 @@ use anyhow::{bail, Result};
2424
use intel_mkl_tool::*;
2525
use std::str::FromStr;
2626

27-
#[cfg(feature = "mkl-static-lp64-iomp")]
28-
const MKL_CONFIG: &str = "mkl-static-lp64-iomp";
29-
#[cfg(feature = "mkl-static-lp64-seq")]
30-
const MKL_CONFIG: &str = "mkl-static-lp64-seq";
31-
#[cfg(feature = "mkl-static-ilp64-iomp")]
27+
macro_rules! def_mkl_config {
28+
($cfg:literal) => {
29+
#[cfg(feature = $cfg)]
30+
const MKL_CONFIG: &str = $cfg;
31+
};
32+
}
33+
34+
def_mkl_config!("mkl-static-lp64-iomp");
35+
def_mkl_config!("mkl-static-lp64-seq");
36+
def_mkl_config!("mkl-static-ilp64-iomp");
37+
def_mkl_config!("mkl-static-ilp64-seq");
38+
def_mkl_config!("mkl-dynamic-lp64-iomp");
39+
def_mkl_config!("mkl-dynamic-lp64-seq");
40+
def_mkl_config!("mkl-dynamic-ilp64-iomp");
41+
def_mkl_config!("mkl-dynamic-ilp64-seq");
42+
43+
// Default value
44+
#[cfg(all(
45+
not(feature = "mkl-static-lp64-iomp"),
46+
not(feature = "mkl-static-lp64-seq"),
47+
not(feature = "mkl-static-ilp64-iomp"),
48+
not(feature = "mkl-static-ilp64-seq"),
49+
not(feature = "mkl-dynamic-lp64-iomp"),
50+
not(feature = "mkl-dynamic-lp64-seq"),
51+
not(feature = "mkl-dynamic-ilp64-iomp"),
52+
not(feature = "mkl-dynamic-ilp64-seq"),
53+
))]
3254
const MKL_CONFIG: &str = "mkl-static-ilp64-iomp";
33-
#[cfg(feature = "mkl-static-ilp64-seq")]
34-
const MKL_CONFIG: &str = "mkl-static-ilp64-seq";
35-
#[cfg(feature = "mkl-dynamic-lp64-iomp")]
36-
const MKL_CONFIG: &str = "mkl-dynamic-lp64-iomp";
37-
#[cfg(feature = "mkl-dynamic-lp64-seq")]
38-
const MKL_CONFIG: &str = "mkl-dynamic-lp64-seq";
39-
#[cfg(feature = "mkl-dynamic-ilp64-iomp")]
40-
const MKL_CONFIG: &str = "mkl-dynamic-ilp64-iomp";
41-
#[cfg(feature = "mkl-dynamic-ilp64-seq")]
42-
const MKL_CONFIG: &str = "mkl-dynamic-ilp64-seq";
4355

4456
fn main() -> Result<()> {
4557
let cfg = Config::from_str(MKL_CONFIG).unwrap();

intel-mkl-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["ffi"]
1212
license = "MIT"
1313

1414
[features]
15-
default = ["mkl-static-ilp64-seq"]
15+
default = []
1616

1717
# MKL config
1818
# https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html

0 commit comments

Comments
 (0)