File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ impl Targets {
36
36
self . 0 . iter ( ) . any ( |( _key, value) | value. is_some ( ) )
37
37
}
38
38
39
- fn seek ( & mut self , dir : & Path ) {
39
+ fn seek < P : AsRef < Path > > ( & mut self , dir : P ) {
40
+ let dir = dir. as_ref ( ) ;
40
41
for ( key, value) in & mut self . 0 {
41
42
if dir. join ( key) . exists ( ) {
42
43
value. get_or_insert ( dir. canonicalize ( ) . unwrap ( ) ) ;
@@ -95,10 +96,24 @@ impl Entry {
95
96
}
96
97
}
97
98
98
- // XDG_DATA_HOME
99
+ // $ XDG_DATA_HOME/intel-mkl-tool
99
100
let path = xdg_home_path ( ) . join ( config. name ( ) ) ;
100
101
targets. seek ( & path) ;
101
102
103
+ // $MKLROOT
104
+ let mkl_root = std:: env:: var ( "MKLROOT" ) . map ( |path| PathBuf :: from ( path) ) ;
105
+ if let Ok ( path) = mkl_root {
106
+ if path. exists ( ) {
107
+ targets. seek ( path. join ( "lib/intel64" ) ) ;
108
+ }
109
+ }
110
+
111
+ // /opt/intel/mkl
112
+ let opt_mkl = PathBuf :: from ( "/opt/intel/mkl" ) ;
113
+ if opt_mkl. exists ( ) {
114
+ targets. seek ( opt_mkl. join ( "lib/intel64" ) ) ;
115
+ }
116
+
102
117
if targets. found_any ( ) {
103
118
return Ok ( Self { config, targets } ) ;
104
119
} else {
You can’t perform that action at this time.
0 commit comments