Skip to content

Commit

Permalink
fix for apple without brew
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Mar 25, 2023
1 parent 0f1a784 commit 9cc6f5d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ def add_openmp_linkage(self):
args_apple_omp2 = ["-Xclang", "-fopenmp", "-L/usr/local/lib", "-lomp", "-I/usr/local/include"]
has_brew_omp = False
if is_apple:
res_brew_pref = subprocess.run(["brew", "--prefix", "libomp"], capture_output=True)
if res_brew_pref.returncode == EXIT_SUCCESS:
has_brew_omp = True
brew_omp_prefix = res_brew_pref.stdout.decode().strip()
args_apple_omp3 = ["-Xclang", "-fopenmp", f"-L{brew_omp_prefix}/lib", "-lomp", f"-I{brew_omp_prefix}/include"]
try:
res_brew_pref = subprocess.run(["brew", "--prefix", "libomp"], capture_output=True)
if res_brew_pref.returncode == EXIT_SUCCESS:
has_brew_omp = True
brew_omp_prefix = res_brew_pref.stdout.decode().strip()
args_apple_omp3 = ["-Xclang", "-fopenmp", f"-L{brew_omp_prefix}/lib", "-lomp", f"-I{brew_omp_prefix}/include"]
except Exception as e:
pass


if self.test_supports_compile_arg(arg_omp1, with_omp=True):
Expand Down Expand Up @@ -210,7 +213,7 @@ def test_supports_compile_arg(self, comm, with_omp=False):
'scipy',
'cython'
],
version = '0.2.5-10',
version = '0.2.5-11',
description = 'Hierarchical Poisson matrix factorization for recommender systems',
author = 'David Cortes',
url = 'https://github.com/david-cortes/hpfrec',
Expand Down

0 comments on commit 9cc6f5d

Please sign in to comment.