Skip to content

Commit 8eb354d

Browse files
committed
No need to set RPATH on Windows
1 parent 837ecca commit 8eb354d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626

2727
import os
28+
import sys
2829
from os.path import join
2930

3031
import Cython.Build
@@ -38,13 +39,15 @@ def extensions():
3839
"include_dirs": [join(mkl_root, "include")],
3940
"library_dirs": [join(mkl_root, "lib"), join(mkl_root, "lib", "intel64")],
4041
"libraries": ["mkl_rt"],
42+
"rpaths" : ["$ORIGIN/../..", "$ORIGIN/../../.."] if sys.platform != 'win32' else [],
4143
}
4244
else:
4345
raise ValueError("MKLROOT environment variable not set.")
4446

4547
mkl_include_dirs = mkl_info.get("include_dirs", [])
4648
mkl_library_dirs = mkl_info.get("library_dirs", [])
4749
mkl_libraries = mkl_info.get("libraries", ["mkl_rt"])
50+
mkl_rpaths = mkl_info.get("rpaths", [])
4851

4952
defs = []
5053
if any(["mkl_rt" in li for li in mkl_libraries]):
@@ -59,7 +62,7 @@ def extensions():
5962
include_dirs=mkl_include_dirs,
6063
libraries=mkl_libraries + (["pthread"] if os.name == "posix" else []),
6164
library_dirs=mkl_library_dirs,
62-
runtime_library_dirs=["$ORIGIN/../..", "$ORIGIN/../../.."],
65+
runtime_library_dirs=mkl_rpaths,
6366
extra_compile_args=[
6467
"-DNDEBUG"
6568
# "-g", "-O2", "-Wall",
@@ -75,6 +78,7 @@ def extensions():
7578
include_dirs=mkl_include_dirs,
7679
library_dirs=mkl_library_dirs,
7780
libraries=mkl_libraries,
81+
runtime_library_dirs=mkl_rpaths,
7882
extra_compile_args=[
7983
"-DNDEBUG"
8084
# "-g", "-O2", "-Wall",

0 commit comments

Comments
 (0)