RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.01k stars 182 forks source link

Use `@loader_path` instead of `@executable_path` on macOS #489

Closed carlocab closed 3 years ago

carlocab commented 3 years ago

@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.

johguenther commented 3 years ago

Thanks for this improvement! I manually merged into devel a884edc34ab1061ef215558c1e31b93eb463babd.

carlocab commented 3 years ago

Thanks!