@executable_path resolves to the directory of "the main executable for
the process" while @loader_path is the directory of "the mach-o binary
which contains the load command using @loader_path" (see man dyld).
This means that using @executable_path constrains where I can put
binaries that link to libospray if I need RPATH to resolve
correctly. In particular, if I install libospray into (say)
/usr/local/lib, the linker resolves RPATH references correctly only
if my linked executable is in /usr/local/*.
On the other hand, using @loader_path constrains only the
location of the libraries that libospray depends on, and my linked
executable can be anywhere in the file system.
@executable_path
resolves to the directory of "the main executable for the process" while@loader_path
is the directory of "the mach-o binary which contains the load command using @loader_path" (seeman dyld
).This means that using
@executable_path
constrains where I can put binaries that link tolibospray
if I needRPATH
to resolve correctly. In particular, if I installlibospray
into (say)/usr/local/lib
, the linker resolvesRPATH
references correctly only if my linked executable is in/usr/local/*
.On the other hand, using
@loader_path
constrains only the location of the libraries thatlibospray
depends on, and my linked executable can be anywhere in the file system.