[Mac] Cannot remove source files unless...

John Nash
  • John Nash
    John Nash

    I have been helping a few people install the Staden package on Macs. If I remove the source directory containing where I made the Staden Package, when I run any programs from the package, I get (tg_index is an example - it happens with everything):

    Endeavour:~ johnnash$ tg_index
    dyld: Library not loaded: /Users/johnnash/staden_install/staden.trunk/src/lib/libgap5.dylib
      Referenced from: /usr/local/staden/bin/tg_index
      Reason: image not found
    Trace/BPT trap: 5

    I can fix it by:

    export DYLD_LIBRARY_PATH=/usr/local/staden/lib/staden/:$DYLD_LIBRARY_PATH

    Is this a bug or have I missed something.  Of course, I'll add the above line to /etc/profile or ~/.bash_profile or whatever.


  • Hi John,

    Is there no DYLD_LIBRARY_PATH set up in the tg_index script?  I thought there was but without a Mac to test on it's hard to tell.



  • James Bonfield
    James Bonfield

    There is a couple of small bugs I detected recently, but have not yet fixed.

    In the source tree there are wrapper scripts for gap4, gap5, trev, tg_index, etc.  If you configure and build in a subdirectory, as recommended (eg mkdir build;cd build; ../configure) then the wrapper scripts are fine. However if you build in the toplevel directory you'll find that tg_index script gets overwritten by the tg_index binary.

    Secondly the wrapper script sets LD_LIBRARY_PATH, but needs to be tweaked on MacOS X to set DYLD_LIBRARY_PATH instead. Perhaps we should just make it set both so it'll work regardless.

    Note that that wrapper is only strictly necessary if you don't set up the environment. There is a staden.profile script installed into $STADENROOT/share/staden/staden.profile which sets up a bunch of environment variables. This does have explicit code for DYLD_LIBRARY_PATH so it should cure the problems.