@@ -24,22 +24,34 @@ use anyhow::{bail, Result};
24
24
use intel_mkl_tool:: * ;
25
25
use std:: str:: FromStr ;
26
26
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
+ ) ) ]
32
54
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" ;
43
55
44
56
fn main ( ) -> Result < ( ) > {
45
57
let cfg = Config :: from_str ( MKL_CONFIG ) . unwrap ( ) ;
0 commit comments