25
25
26
26
27
27
import os
28
+ import sys
28
29
from os .path import join
29
30
30
31
import Cython .Build
@@ -38,13 +39,15 @@ def extensions():
38
39
"include_dirs" : [join (mkl_root , "include" )],
39
40
"library_dirs" : [join (mkl_root , "lib" ), join (mkl_root , "lib" , "intel64" )],
40
41
"libraries" : ["mkl_rt" ],
42
+ "rpaths" : ["$ORIGIN/../.." , "$ORIGIN/../../.." ] if sys .platform == 'win32' else [],
41
43
}
42
44
else :
43
45
raise ValueError ("MKLROOT environment variable not set." )
44
46
45
47
mkl_include_dirs = mkl_info .get ("include_dirs" , [])
46
48
mkl_library_dirs = mkl_info .get ("library_dirs" , [])
47
49
mkl_libraries = mkl_info .get ("libraries" , ["mkl_rt" ])
50
+ mkl_rpaths = mkl_info .get ("rpaths" , [])
48
51
49
52
defs = []
50
53
if any (["mkl_rt" in li for li in mkl_libraries ]):
@@ -59,7 +62,7 @@ def extensions():
59
62
include_dirs = mkl_include_dirs ,
60
63
libraries = mkl_libraries + (["pthread" ] if os .name == "posix" else []),
61
64
library_dirs = mkl_library_dirs ,
62
- runtime_library_dirs = [ "$ORIGIN/../.." , "$ORIGIN/../../.." ] ,
65
+ runtime_library_dirs = mkl_rpaths ,
63
66
extra_compile_args = [
64
67
"-DNDEBUG"
65
68
# "-g", "-O2", "-Wall",
@@ -75,6 +78,7 @@ def extensions():
75
78
include_dirs = mkl_include_dirs ,
76
79
library_dirs = mkl_library_dirs ,
77
80
libraries = mkl_libraries ,
81
+ runtime_library_dirs = mkl_rpaths ,
78
82
extra_compile_args = [
79
83
"-DNDEBUG"
80
84
# "-g", "-O2", "-Wall",
0 commit comments