Hi,
I’ve successfully built Slicer from source on macOS 11.1 but I am having trouble packaging the app. I’ve tried building with Qt installed from a web-installer and from homebrew.
When I try to package Slicer build with Qt from the web-installer the log shows lots of @rpath
errors like
warning: target '@rpath/QtGui.framework/Versions/5/QtGui' is not absolute...
warning: target '@rpath/QtGui.framework/Versions/5/QtGui' does not exist...
error: /Applications/DevelopmentTools/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: @rpath/QtGui.framework/Versions/5/QtGui (No such file or directory)
and the packaged app doesn’t run on the machine it was built.
When I do the same with the Qt that’s installed from homebrew there are no errors and the app launches on the machine it was built on but when I try to launch the app on a different machine the app crashes with an error saying a library was not loaded/found
Dyld Error Message:\
dyld: Using shared cache: 467A83CB-BA86-3F07-B652-B9256C74080A\
Library not loaded: /usr/local/opt/lz4/lib/liblz4.1.dylib\
Referenced from: /Applications/Slicer.app/Contents/lib/Slicer-4.13/libarchive.17.dylib\
Reason: image not found\
The rpath
issue was discussed in a number of posts here, like this one and this one and most important this one
From the forum posts it appears that the only way to create a Slicer (or a Slicelet) for distribution to end-users is to build Qt from source. Is it the only option? Might there be another solution that involves an extra step between building Slicer and running make package
in the Slicer-build
folder?
Any advice is appreciated.