cmake: remove custom CMAKE_INSTALL_RPATH#46685
Merged
Conversation
a5c26a1 to
c725ba2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
The CMake builder in Spack actually adds incorrect rpaths. They are
unfiltered and incorrectly ordered compared to what the compiler wrapper
adds.
There is no need to paths to dependencies in `CMAKE_INSTALL_RPATH`
because of two reasons:
1. CMake preserves "toolchain" rpaths, which are rpaths injected
automatically, and the compiler wrapper is from CMake's perspective
part of the toolchain.
2. We use `CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON`, so libraries we link
to are rpath'ed automatically.
CMake does not create install rpaths to new directories in
CMAKE_INSTALL_PREFIX, so we continue to set our educated guess of
install rpaths `<prefix>/{lib,lib64}`.
and break circular deps between cmake & build_environment
1476cae to
d3c1061
Compare
Member
Author
|
@bernhardkaindl it looks like you're pushing unrelated changes to this branch? |
1238525 to
d3c1061
Compare
alalazo
approved these changes
Oct 14, 2024
arezaii
pushed a commit
to arezaii/spack
that referenced
this pull request
Oct 22, 2024
The CMake builder in Spack actually adds incorrect rpaths. They are
unfiltered and incorrectly ordered compared to what the compiler wrapper
adds.
There is no need to specify paths to dependencies in `CMAKE_INSTALL_RPATH`
because of two reasons:
1. CMake preserves "toolchain" rpaths, which includes the rpaths injected
by our compiler wrapper.
2. We use `CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON`, so libraries we link
to are rpath'ed automatically.
However, CMake does not create install rpaths to directories in the package's
own install prefix, so we set `CMAKE_INSTALL_RPATH` to the educated guess
`<prefix>/{lib,lib64}`, but omit dependencies.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The CMake builder in Spack actually adds incorrect rpaths. They are
unfiltered and incorrectly ordered compared to what the compiler wrapper
adds.
There is no need to specify paths to dependencies in
CMAKE_INSTALL_RPATHbecause of two reasons:
by our compiler wrapper.
CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON, so libraries we linkto are rpath'ed automatically.
However, CMake does not create install rpaths to directories in the package's
own install prefix, so we set
CMAKE_INSTALL_RPATHto the educated guess<prefix>/{lib,lib64}, but omit dependencies.This bit got lost after rebase of #44686 😢
Also breaks yet another circular dependency (cmake <-> build_environment)