diff --git a/.github/workflows/intel-mkl-sys.yml b/.github/workflows/intel-mkl-sys.yml index 8c3932e5..4e6ecc00 100644 --- a/.github/workflows/intel-mkl-sys.yml +++ b/.github/workflows/intel-mkl-sys.yml @@ -15,6 +15,7 @@ jobs: - ghcr.io/rust-math/rust-mkl:1.62.1-2020.1 - rust:1.62.1 feature: + - "" - mkl-static-lp64-iomp - mkl-static-lp64-seq - mkl-static-ilp64-iomp @@ -49,7 +50,6 @@ jobs: command: test args: > --manifest-path=intel-mkl-sys/Cargo.toml - --no-default-features --features=${{ matrix.feature }} windows: diff --git a/intel-mkl-src/Cargo.toml b/intel-mkl-src/Cargo.toml index b15848b1..26b85689 100644 --- a/intel-mkl-src/Cargo.toml +++ b/intel-mkl-src/Cargo.toml @@ -16,7 +16,7 @@ build = "build.rs" links = "mkl_core" [features] -default = ["mkl-static-ilp64-seq"] +default = [] # MKL config # 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 = [] [build-dependencies] anyhow = "1.0.58" ocipkg = "0.2.3" -intel-mkl-tool = { version = "0.4.0-alpha.0", path = "../intel-mkl-tool", default-features = false } +intel-mkl-tool = { version = "0.4.1", path = "../intel-mkl-tool", default-features = false } diff --git a/intel-mkl-src/build.rs b/intel-mkl-src/build.rs index 145bef58..93aff639 100644 --- a/intel-mkl-src/build.rs +++ b/intel-mkl-src/build.rs @@ -24,22 +24,34 @@ use anyhow::{bail, Result}; use intel_mkl_tool::*; use std::str::FromStr; -#[cfg(feature = "mkl-static-lp64-iomp")] -const MKL_CONFIG: &str = "mkl-static-lp64-iomp"; -#[cfg(feature = "mkl-static-lp64-seq")] -const MKL_CONFIG: &str = "mkl-static-lp64-seq"; -#[cfg(feature = "mkl-static-ilp64-iomp")] +macro_rules! def_mkl_config { + ($cfg:literal) => { + #[cfg(feature = $cfg)] + const MKL_CONFIG: &str = $cfg; + }; +} + +def_mkl_config!("mkl-static-lp64-iomp"); +def_mkl_config!("mkl-static-lp64-seq"); +def_mkl_config!("mkl-static-ilp64-iomp"); +def_mkl_config!("mkl-static-ilp64-seq"); +def_mkl_config!("mkl-dynamic-lp64-iomp"); +def_mkl_config!("mkl-dynamic-lp64-seq"); +def_mkl_config!("mkl-dynamic-ilp64-iomp"); +def_mkl_config!("mkl-dynamic-ilp64-seq"); + +// Default value +#[cfg(all( + not(feature = "mkl-static-lp64-iomp"), + not(feature = "mkl-static-lp64-seq"), + not(feature = "mkl-static-ilp64-iomp"), + not(feature = "mkl-static-ilp64-seq"), + not(feature = "mkl-dynamic-lp64-iomp"), + not(feature = "mkl-dynamic-lp64-seq"), + not(feature = "mkl-dynamic-ilp64-iomp"), + not(feature = "mkl-dynamic-ilp64-seq"), +))] const MKL_CONFIG: &str = "mkl-static-ilp64-iomp"; -#[cfg(feature = "mkl-static-ilp64-seq")] -const MKL_CONFIG: &str = "mkl-static-ilp64-seq"; -#[cfg(feature = "mkl-dynamic-lp64-iomp")] -const MKL_CONFIG: &str = "mkl-dynamic-lp64-iomp"; -#[cfg(feature = "mkl-dynamic-lp64-seq")] -const MKL_CONFIG: &str = "mkl-dynamic-lp64-seq"; -#[cfg(feature = "mkl-dynamic-ilp64-iomp")] -const MKL_CONFIG: &str = "mkl-dynamic-ilp64-iomp"; -#[cfg(feature = "mkl-dynamic-ilp64-seq")] -const MKL_CONFIG: &str = "mkl-dynamic-ilp64-seq"; fn main() -> Result<()> { let cfg = Config::from_str(MKL_CONFIG).unwrap(); diff --git a/intel-mkl-sys/Cargo.toml b/intel-mkl-sys/Cargo.toml index 750538ed..314691ed 100644 --- a/intel-mkl-sys/Cargo.toml +++ b/intel-mkl-sys/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["ffi"] license = "MIT" [features] -default = ["mkl-static-ilp64-seq"] +default = [] # MKL config # https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html