Skip to content

Commit 5df6c53

Browse files
committed
Update build extensions per openmp
1 parent 402b60a commit 5df6c53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build_extension.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
"kmsr/cpp/yildirim.cpp",
2020
],
2121
include_dirs=["kmsr"],
22-
extra_compile_args=["-fopenmp"],
23-
extra_link_args=["-lgomp"],
2422
)
2523

2624
# Thank you https://github.com/dstein64/kmeans1d!
@@ -34,6 +32,8 @@ def build_extensions(self) -> None:
3432
# with clang++. This works across compilers (ignored by MSVC).
3533
for extension in self.extensions:
3634
extension.extra_compile_args.append("-std=c++11")
35+
extension.extra_compile_args.append("-fopenmp")
36+
3737
try:
3838
build_ext.build_extensions(self)
3939
except CompileError:
@@ -43,6 +43,7 @@ def build_extensions(self) -> None:
4343
for extension in self.extensions:
4444
extension.extra_compile_args.append("-stdlib=libc++")
4545
extension.extra_link_args.append("-stdlib=libc++")
46+
extension.extra_link_args.append("-lomp")
4647
build_ext.build_extensions(self)
4748

4849

0 commit comments

Comments
 (0)