Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: ngscopeclient binary is missing RPATH load command #622

Open
rgov opened this issue Oct 29, 2023 · 4 comments
Open

macOS: ngscopeclient binary is missing RPATH load command #622

rgov opened this issue Oct 29, 2023 · 4 comments
Assignees
Labels
bug Something isn't working portability Stuff that doesn't work on some OS

Comments

@rgov
Copy link

rgov commented Oct 29, 2023

I built ngscopeclient on macOS 14.0. The binary links in several libraries using @rpath:

% otool -L $(which ngscopeclient) | grep @rpath  
	@rpath/libscopeprotocols.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libscopeexports.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libscopehal.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libvulkan.1.dylib (compatibility version 1.0.0, current version 1.3.231)

However the binary does not contain any LC_RPATH load commands, so @rpath is undefined.

% ngscopeclient                              
dyld[45566]: Library not loaded: @rpath/libscopeprotocols.dylib
  Referenced from: <87EE124C-9597-35DF-9F0A-5A19B4B39F9F> /opt/homebrew/Cellar/ngscopeclient/HEAD-6056adc/bin/ngscopeclient
  Reason: no LC_RPATH's found

Note: I built using the Homebrew formula in this issue.

@azonenberg
Copy link
Collaborator

@rgov
Copy link
Author

rgov commented Oct 29, 2023

I added the CMake argument -DCMAKE_INSTALL_RPATH="@loader_path/../lib;/opt/VulkanSDK/1.3.231.1/macOS/lib" to work around the issue.

Load command 50
    cmd LC_RPATH
     cmdsize 48
     path /opt/VulkanSDK/1.3.231.1/macOS/lib (offset 12)
Load command 54
     cmd LC_RPATH
     cmdsize 32
     path @loader_path/../lib (offset 12)

@azonenberg
Copy link
Collaborator

Yeah I don't think we currently have install support on macos (i.e. it's assumed you are running from the build directory).

Not surprised there's rough edges if you try to do a systemwide install, but the feedback is welcome as proper installability/packaging is one of the things we're trying to fix before the v0.1 release.

@azonenberg azonenberg added bug Something isn't working portability Stuff that doesn't work on some OS labels Nov 3, 2023
@lainy lainy self-assigned this Nov 4, 2023
@d235j
Copy link
Collaborator

d235j commented Jan 28, 2024

You probably need -DCMAKE_INSTALL_RPATH=#{rpath} in your formula, as many other formulas also have this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working portability Stuff that doesn't work on some OS
Projects
None yet
Development

No branches or pull requests

4 participants