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

Fix MacOS rpath for local-core corner case #760

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Conversation

johnkerl
Copy link
Collaborator

@johnkerl johnkerl commented Oct 2, 2024

Before

On MacOS for TileDB-R -- noting that as an internal developer I always have a local copy of core checked out -- I've always noticed:

# build and install
rm -f *.tar.gz; R CMD build --no-build-vignettes --no-manual .
R CMD INSTALL --no-test-load --no-docs --no-html *tar.gz
$ R
> library(tiledb)
Error: package or namespace load failed for ‘tiledb’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/johnkerl/R/tiledb/libs/tiledb.so':
  dlopen(/Users/johnkerl/R/tiledb/libs/tiledb.so, 0x0006): Library not loaded: @rpath/libtiledb.dylib
  Referenced from: <9D75719F-D075-3D56-BDDF-7429ACB097EE> /Users/johnkerl/R/tiledb/libs/tiledb.so
  Reason: tried: '/Library/Frameworks/R.framework/Resources/lib/libtiledb.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-11.0.18+10/Contents/Home/lib/server/libtiledb.dylib' (no such file)

I've always had this workaround:

$ alias rpatch
alias rpatch='install_name_tool -add_rpath /usr/local/lib ~/R/tiledb/libs/tiledb.so'

after which I can do library(tiledb).

This is to say: the MacOS install is broken until/unless I manually fix the rpath.

After

# build and install
rm -f *.tar.gz; R CMD build --no-build-vignettes --no-manual .
R CMD INSTALL --no-test-load --no-docs --no-html *tar.gz
$ R
> library(tiledb)
TileDB R 0.30.1 with TileDB Embedded 2.26.2 on macOS 15.0.
See https://tiledb.com for more information about TileDB.

Note

We already did this for tiledbsoma here: single-cell-data/TileDB-SOMA#1372

The current PR simply copy-pastes the same logic to TileDB-R.

@ihnorton ihnorton merged commit 851018e into master Oct 2, 2024
1 check passed
@johnkerl johnkerl changed the title Fix MacOS rpath Fix MacOS rpath for local-core corner case Oct 2, 2024
@ihnorton ihnorton deleted the kerl/fix-macos-rpath branch October 2, 2024 02:35
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.

3 participants