Skip to content

Commit 3dcd84b

Browse files
authored
removed extra_link_args for macOS (#10)
* print the system platform * print out the platform * changed darwin to Darwin * remove extra_link_args for mac
1 parent 1df568f commit 3dcd84b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

setup.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,21 @@ def get_include(): # TODO
1818
def __extra_compile_args():
1919
extra_compile_args = []
2020
print("Platform is "+ platform.system())
21-
if platform.system() == 'darwin' or 'macOS':
21+
22+
if platform.system() == 'Darwin':
2223
extra_compile_args = ["-std=c++11"]
2324
else:
2425
extra_compile_args = ["-fopenmp", "-std=c++11"]
2526
return extra_compile_args
2627

2728

29+
def __extra_link_args():
30+
extra_link_args = []
31+
if platform.system() != 'Darwin':
32+
extra_link_args = ["-lgomp", "-lm", "-lrt"]
33+
return extra_link_args
34+
35+
2836
sources_list = ['src/krbalancing.cpp']
2937

3038
kr_module = Extension('krbalancing',
@@ -33,7 +41,7 @@ def __extra_compile_args():
3341
# Path to eigen3 headers
3442
get_include()
3543
],
36-
extra_link_args=["-lgomp", "-lm", "-lrt"],
44+
extra_link_args=__extra_link_args(),
3745
extra_compile_args=__extra_compile_args()
3846
)
3947

0 commit comments

Comments
 (0)