delocate icon indicating copy to clipboard operation
delocate copied to clipboard

DYLD_LIBRARY_PATH not searched for libraries

Open peastman opened this issue 7 months ago • 3 comments

Describe the bug I'm setting DYLD_LIBRARY_PATH to tell delocate where to find my libraries, but it still fails to find them:

$ export DYLD_LIBRARY_PATH=/usr/local/openmm/lib
(openmm) CHM-Q05002H061:build peastman$ delocate-listdeps python/dist/OpenMM-8.1.0-cp39-cp39-macosx_11_0_arm64.whl
ERROR:delocate.libsana:
@rpath/libOpenMM.dylib not found:
  Needed by: /usr/local/openmm/lib/libOpenMMAmoeba.dylib
  Search path:

On the other hand, if I invoke it as a python module then it does work:

$ python -m delocate.cmd.delocate_listdeps python/dist/OpenMM-8.1.0-cp39-cp39-macosx_11_0_arm64.whl 
/Users/peastman/miniconda3/envs/openmm/lib/libc++.1.0.dylib
/usr/local/openmm/lib/libOpenMM.dylib
/usr/local/openmm/lib/libOpenMMAmoeba.dylib
/usr/local/openmm/lib/libOpenMMDrude.dylib
/usr/local/openmm/lib/libOpenMMRPMD.dylib

I tried modifying delocate_listdeps.main() to add the line

print(os.environ.get('DYLD_LIBRARY_PATH'))

at the very start. This confirms that the environment variable is seen when I run it with python -m, but not when I use the delocate-listdeps command line tool. Something in there is blocking the environment variables.

Platform (please complete the following information):

  • OS version: macOS 14.4.1
  • Delocate version: 0.11.0

peastman avatar Jul 19 '24 19:07 peastman