Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 06a6e4a9 authored by hhakim's avatar hhakim
Browse files

Add another fix to libomp not loaded for macOS pyfaust python package (using install_name_tool)

This fix was added because even if the embedded libomp is loaded
dynamically (with RTLD_GLOBAL mode) the macOS linker still complains of
missing /opt/local/lib/libomp/libomp.dylib from MacPorts (it is more
user friendly to avoid the manual installation)
parent b2f05a22
Branches
Tags
No related merge requests found
Pipeline #834081 skipped
......@@ -51,9 +51,22 @@ def inform_user_how_to_install_libomp():
- On Debian the package is libomp-11*.
""")
def try_modify_wrapper_lib_on_macos():
from os.path import dirname, join
from os import system
from glob import glob
from sys import platform
if platform != 'darwin':
return
wrapper_path = glob(join(dirname(dirname(__file__)), '_Faust*so'))[0]
libomp_path = join(dirname(__file__), 'lib/libomp.dylib')
system('install_name_tool -change /opt/local/lib/libomp/libomp.dylib '+libomp_path+' '+wrapper_path)
# load libomp pyfaust embedded library if found in pyfaust location
# and if the code runs on macOS
if _pf in ['darwin', 'linux']:
try_modify_wrapper_lib_on_macos()
if internal_libomp_loading:
load_lib_omp()
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment