Skip to content

Commit

Permalink
more OMP detection for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Mar 19, 2023
1 parent 11e1573 commit 298f4f4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ def add_clang_fp_reassociate(self):
def add_openmp_linkage(self):
arg_omp1 = "-fopenmp"
arg_omp2 = "-fopenmp=libomp"
arg_omp3 = "-qopenmp"
arg_omp4 = "-xopenmp"
args_omp2 = ["-fopenmp=libomp", "-lomp"]
arg_omp4 = "-qopenmp"
arg_omp5 = "-xopenmp"
is_apple = sys.platform[:3].lower() == "dar"
args_apple_omp = ["-Xclang", "-fopenmp", "-lomp"]
args_apple_omp2 = ["-Xclang", "-fopenmp", "-L/usr/local/lib", "-lomp", "-I/usr/local/include"]
Expand Down Expand Up @@ -232,12 +233,16 @@ def add_openmp_linkage(self):
e.extra_link_args += ["-fopenmp"]
elif self.test_supports_compile_arg(arg_omp3, with_omp=True):
for e in self.extensions:
e.extra_compile_args.append(arg_omp3)
e.extra_link_args.append(arg_omp3)
e.extra_compile_args += ["-fopenmp=libomp"]
e.extra_link_args += ["-fopenmp", "-lomp"]
elif self.test_supports_compile_arg(arg_omp4, with_omp=True):
for e in self.extensions:
e.extra_compile_args.append(arg_omp4)
e.extra_link_args.append(arg_omp4)
elif self.test_supports_compile_arg(arg_omp5, with_omp=True):
for e in self.extensions:
e.extra_compile_args.append(arg_omp5)
e.extra_link_args.append(arg_omp5)
else:
set_omp_false()

Expand Down

0 comments on commit 298f4f4

Please sign in to comment.