From e3463e40d9a0f48a7d85ea5c7a555b139f3e5446 Mon Sep 17 00:00:00 2001 From: david-cortes Date: Sat, 25 Mar 2023 18:01:16 +0100 Subject: [PATCH] more apple fixes --- setup.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 8c575ea..d618a55 100644 --- a/setup.py +++ b/setup.py @@ -202,11 +202,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: + 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"] + has_brew_omp = True + except Exception as e: + pass if self.test_supports_compile_arg(arg_omp1, with_omp=True): @@ -345,7 +348,7 @@ def test_supports_clang_reassociate(self): setup( name = "cmfrec", packages = ["cmfrec"], - version = '3.5.1-3', + version = '3.5.1-4', description = 'Collective matrix factorization', author = 'David Cortes', url = 'https://github.com/david-cortes/cmfrec',