Fix libjulia install name and libjulia-internal rpath on OS X #47053
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #40246.
This PR makes 3 main changes:
libjulia-internal.dylib
, by analogy withlibjulia-internal.so
libjulia.dylib
tolibjulia.1.dylib
JL_LIBJULIA_SONAME
to@rpath/libjulia.1.dylib
on MacI'm not sure if all 3 are necessary but I think they're all good changes in any case. In particular #2 means you can package
libjulia.1.dylib
without alibjulia.dylib
symlink.I also removed
JL_LIBJULIA_INTERNAL_SONAME
because it seems to be unused.I made a small test case to check that this fixes the issue (for me, at least).
It builds and runs a
test
program which embeds julia indirectly, vialibtest.dylib
. These both live in the parent directory oflibjulia.dylib
, with RPATHs set accordingly.The test results can be viewed here. Note that
src/mac_embedding_test/test.sh julia
is the patched build, and printssqrt(2.0)
successfully. On the other handsrc/mac_embedding_test/test.sh julia-1.6.7
uses the official Julia 1.6.7 build, and segfaults whenlibjulia-internal.dylib
tries to get a handle tolibjulia.dylib
.