Commit 95c39c7 1 parent e2b8774 commit 95c39c7 Copy full SHA for 95c39c7
File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -246,18 +246,17 @@ def build_extensions(self):
246
246
for flag in ext .extra_compile_args :
247
247
if compiler_has_flag (self .compiler , flag ):
248
248
extra_compile_args .append (flag )
249
+ elif "clang" in self .compiler .compiler [0 ] and flag == "-fopenmp" :
250
+ # clang does not support -fopenmp, but does support -Xclang -fopenmp
251
+ extra_compile_args .append ("-Xclang" )
252
+ extra_compile_args .append ("-fopenmp" )
253
+ # Also adjust libraries as needed
254
+ libraries .remove ("gomp" )
255
+ libraries .append ("omp" )
249
256
elif flag == "-fopenmp" and "gomp" in libraries :
250
257
libraries .remove ("gomp" )
251
258
ext .extra_compile_args = extra_compile_args
252
259
ext .libraries = libraries
253
- # if the compiler/linker is clang, replace the gomp library with omp
254
- if ct == "unix" and "clang" in self .compiler .compiler [0 ]:
255
- for ext in self .extensions :
256
- libraries = ext .libraries
257
- if "gomp" in libraries :
258
- libraries .remove ("gomp" )
259
- libraries .append ("omp" )
260
- ext .libraries = libraries
261
260
build_ext .build_extensions (self )
262
261
263
262
You can’t perform that action at this time.
0 commit comments