Skip to content

Path to libgas.so not found on macosx #169

Open

Description

@fd-turbo

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?

Activity

  1. rjgollan-on-github commented on Mar 14, 2026

    @rjgollan-on-github
    Collaborator

    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.

    I will work with the dev team on a permanent fix.

  2. fd-turbo commented on Mar 16, 2026

    @fd-turbo
    Author

    This worked. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions