Skip to content

Commit 1b547be

Browse files
authored
Merge pull request #95 from rust-math/change-default-feature
Remove default feature, use mkl-static-ilp64-iomp if no feature
2 parents 2592350 + f4ea9ae commit 1b547be

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

.github/workflows/intel-mkl-sys.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- ghcr.io/rust-math/rust-mkl:1.62.1-2020.1
1616
- rust:1.62.1
1717
feature:
18+
- ""
1819
- mkl-static-lp64-iomp
1920
- mkl-static-lp64-seq
2021
- mkl-static-ilp64-iomp
@@ -49,7 +50,6 @@ jobs:
4950
command: test
5051
args: >
5152
--manifest-path=intel-mkl-sys/Cargo.toml
52-
--no-default-features
5353
--features=${{ matrix.feature }}
5454
5555
windows:

intel-mkl-src/Cargo.toml

Lines changed: 2 additions & 2 deletions
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
@@ -32,4 +32,4 @@ mkl-dynamic-ilp64-seq = []
3232
[build-dependencies]
3333
anyhow = "1.0.58"
3434
ocipkg = "0.2.3"
35-
intel-mkl-tool = { version = "0.4.0-alpha.0", path = "../intel-mkl-tool", default-features = false }
35+
intel-mkl-tool = { version = "0.4.1", path = "../intel-mkl-tool", default-features = false }

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)