Skip to content

Commit

Permalink
improve DYLD_INSERT_LIBRARIES
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed Sep 21, 2024
1 parent b6a7293 commit 0807463
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions radian/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ def main(cleanup=None):
if not sys.platform.startswith("win"):
libPath = os.path.join(r_home, "lib")
ldpaths = os.path.join(r_home, "etc", "ldpaths")
libRBlas = os.path.join(libPath, "libRblas.dylib")

if "DYLD_INSERT_LIBRARIES" in os.environ:
del os.environ['DYLD_INSERT_LIBRARIES']
if sys.platform == "darwin":
if "DYLD_INSERT_LIBRARIES" in os.environ:
del os.environ['DYLD_INSERT_LIBRARIES']

if (
"R_LD_LIBRARY_PATH" not in os.environ
Expand Down Expand Up @@ -134,9 +136,6 @@ def main(cleanup=None):
os.environ[ld_library_var] = LD_LIBRARY_PATH

if sys.platform == "darwin":
# macOS python injects Accelarate Blas automatically
# note that it may be ignored for SIP protected python.
libRBlas = os.path.join(libPath, "libRblas.dylib")
if "DYLD_INSERT_LIBRARIES" not in os.environ:
os.environ["DYLD_INSERT_LIBRARIES"] = libRBlas
else:
Expand Down

0 comments on commit 0807463

Please sign in to comment.