Change library paths for binaries on Mac

From Teaching Wiki
Jump to navigation Jump to search

A brief summary of steps performed to get Jacktrip running without global qt5-library. XCode or the xcode commandline tools must be installed.

sources for changing library paths:

https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath

https://medium.com/@donblas/fun-with-rpath-otool-and-install-name-tool-e3e41ae86172

First pull the Nils-Branch from the Jacktrip repository https://github.com/jacktrip/jacktrip

create xcode project (mainly for gathering libraries)

left choose projects -> (Targets) jacktrip -> embed frameworks without signings

this copies libraries to the same folder


DYLD_PRINT_LIBRARIES=1 ./jacktrip shows all libraries to be loaded

create a subfolder libraries move all copied libraries in it (just for cleaner look)

use terminal command install_name_tool -change [librarypath the program is looking for at the moment] [new path the program should look] [name of program >./jacktrip<]

note that also the the library path of QtNetwork has to be changed to find QtCore.

commands to perform (be inside the buildpath of jacktrip):

install_name_tool -add_rpath @executable_path/libraries jacktrip

install_name_tool -change /usr/local/opt/qt@5/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork.framework/Versions/5/QtNetwork jacktrip

install_name_tool -change /usr/local/opt/qt@5/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore.framework/Versions/5/QtCore jacktrip

install_name_tool -change /usr/local/Cellar/qt@5/5.15.2/lib/QtCore.framework/Versions/5/QtCore QtCore.framework/Versions/5/QtCore libraries/QtNetwork.framework/Versions/5/QtNetwork