You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently downloaded and compiled gdtk on macOS 15.7.4. When running the "l1d4-prep" command, the path to the libgas.so library isn't found. The path to the library has been added to my .zshrc file as instructed in the setup guide.
I was able to compile and run successfully on my Linux machine, so suspect it to be an issue with macOS. A quick search seems to indicate that macOS System Integrity Protection (SIP) is at issue and must be disabled for the library path and CFFI to work properly. Is there a workaround?
I tried this on my MacOS which is version 26.3.1. I encountered the same issue. Yes it seems that the System Integrity Protection strips the load library path when python executes.
Here is a temporary workaround. Edit the installed gas.py file. It would usually be located in: $HOME/gdtkinst/lib
Add these lines after: "import math"
import sys
if sys.platform == 'darwin':
import os
os.environ['DYLD_LIBRARY_PATH'] = os.getenv('DGD') + '/lib'
This will set the DYLD_LIBRARY_PATH just in time before the call to ffi.dlopen().
Note this is an edit of an installed file. If you re-install, then this edit will be wiped.
Activity
rjgollan-on-github commentedon Mar 14, 2026
I tried this on my MacOS which is version 26.3.1. I encountered the same issue. Yes it seems that the System Integrity Protection strips the load library path when python executes.
Here is a temporary workaround. Edit the installed gas.py file. It would usually be located in: $HOME/gdtkinst/lib
Add these lines after: "import math"
This will set the DYLD_LIBRARY_PATH just in time before the call to ffi.dlopen().
Note this is an edit of an installed file. If you re-install, then this edit will be wiped.
I will work with the dev team on a permanent fix.
fd-turbo commentedon Mar 16, 2026
This worked. Thanks
Add Rowan's fix for locating the dynamic library on MacOS.