Hi,
setting up the Python LJM on macOS Sierra 10.12.5 I came across a couple of problems that I solved and this post might save some time to other Mac users.
1) Cannot load the LJM library libLabJackM.dylib. dlopen(libLabJackM.dylib, 6): image not found
The error has been documented in another post on this forum and the solution is to edit the ljm.py of the downloaded package and reinstall it
2) Once the error above was gone, I got the second one about "unsafe use of relative rpath" in the libLabJackM.dylib file :
using the otool command is possible to show which library libLabJackM.dylib dependends on (see below). liblabjackusb is referenced with relative path and this is considered unsafe, hence the error
otool -L /usr/local/lib/libLabJackM.dylib
/usr/local/lib/libLabJackM.dylib:
libLabJackM-1.14.6.dylib (compatibility version 1.14.6, current version 1.14.6)
/usr/local/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
liblabjackusb-2.6.0.dylib (compatibility version 2.6.0, current version 2.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
Is possible to use the "install_name_tool" command to correct the above:
sudo install_name_tool -change liblabjackusb-2.6.0.dylib /usr/local/lib/liblabjackusb-2.6.0.dylib /usr/local/lib/libLabJackM.dylib
Now, issuing the otool command once more we get the confirmation that the path of the dependencies has been modified to the absolute one:
otool -L /usr/local/lib/libLabJackM.dylib
/usr/local/lib/libLabJackM.dylib:
libLabJackM-1.14.6.dylib (compatibility version 1.14.6, current version 1.14.6)
/usr/local/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
/usr/local/lib/liblabjackusb-2.6.0.dylib (compatibility version 2.6.0, current version 2.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
hope this will help
cheers
stef
Thanks for reporting this. For future reference, LJM 1.1600 removes the dependency to liblabjackusb. Also, we will fix ljm.py and then update this thread.
We released a new version of the Python LJM interface which fixes the "Cannot load the LJM library libLabJackM.dylib. dlopen(libLabJackM.dylib, 6): image not found" error you were getting. It now tries to load libLabJackM.dylib first with no file path, and on failure will try again but with the full file path.
https://labjack.com/support/software/examples/ljm/python