Skip to content

Fix macOS CLI library lookup after relocation - #1677

Open
jdotc1 wants to merge 1 commit into
uclouvain:masterfrom
jdotc1:fix/macos-cli-install-rpath
Open

jdotc1 wants to merge 1 commit into
uclouvain:masterfrom
jdotc1:fix/macos-cli-install-rpath

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 17, 2026 •

Copy link
Copy Markdown

Fix installed macOS command-line tools failing to load @rpath/libopenjp2.7.dylib after relocation. Closes #1622.

For shared-library builds on macOS, append an executable-relative install RPATH to opj_compress, opj_decompress, and opj_dump. Derive it from the configured GNU install directories and retain any existing CMAKE_INSTALL_RPATH. Static builds and other platforms are unchanged.

Validation

On native macOS ARM64, the unmodified installed opj_decompress -h aborted after relocation with Library not loaded: @rpath/libopenjp2.7.dylib and no LC_RPATH's found.

After the change, CPack ZIPs extracted with the native archive utility into paths containing spaces passed six CLI launch checks, with all DYLD_* environment variables removed:

  • Default bin / lib: all three tools printed their help, using @loader_path/../lib.
  • Custom tools/bin / lib64: all three tools printed their help, using @loader_path/../../lib64; a supplied @loader_path/existing RPATH was retained.

Each tool's help path returned its expected status 1. The original compiled binaries were reused: both subsequent Ninja builds reported no work to do. Optional PNG, TIFF, LCMS2, and ZLIB package discovery was disabled for the focused local build. The diff check passed. No codec conformance corpus, numerical validation, full test suite, or Intel-host runtime check was performed. Hosted CI is separate from these local results.

@jdotc1

jdotc1 commented Oct 23, 2026

Copy link
Copy Markdown
Author

Could a maintainer approve the workflows for 37a466a? Build, Code Style, CIFuzz, and ABI check have been waiting with action_required since October 17. Thank you.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URGENT: dyld[83079]: Library not loaded: @rpath/libopenjp2.7.dylib

1 participant