From f2ed48ed0694dd823e9498e63bee06e445c86ca0 Mon Sep 17 00:00:00 2001 From: Ansgar Wehrhahn <31626864+AWehrhahn@users.noreply.github.com> Date: Mon, 4 Apr 2022 13:02:35 +0200 Subject: [PATCH] fix macos --- src/pysme/smelib/libtools.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pysme/smelib/libtools.py b/src/pysme/smelib/libtools.py index 416b90b1..9315fb6c 100644 --- a/src/pysme/smelib/libtools.py +++ b/src/pysme/smelib/libtools.py @@ -11,7 +11,7 @@ import subprocess import sys import zipfile -from os.path import basename, dirname, exists, join +from os.path import basename, dirname, exists, join, realpath import wget @@ -69,6 +69,17 @@ def download_libsme(loc=None): os.remove(fname) + if system in ["macos"]: + # Need to adjust the install_names in the dylib + fname = realpath(get_full_libfile()) + logger.critical(fname) + sp = subprocess.run( + ["install_name_tool", "-id", fname, fname], capture_output=True + ) + logger.critical(sp.stdout.decode()) + logger.critical(sp.stderr.decode()) + sp.check_returncode() + def compile_interface(): """