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

Remove RPATH for UPS installations #166

Closed
knoepfel opened this issue Jan 11, 2023 · 3 comments
Closed

Remove RPATH for UPS installations #166

knoepfel opened this issue Jan 11, 2023 · 3 comments

Comments

@knoepfel
Copy link

knoepfel commented Jan 11, 2023

In this issue, the PRODUCTS (and therefore LD_LIBRARY_PATH) environment variables contained a few directories, all of which contained ROOT installations:

PRODUCTS=/mu2e/ups:/cvmfs/fermilab.opensciencegrid.org/products/artdaq:/cvmfs/mu2e.opensciencegrid.org/artexternals`

Note that the KinKal UPS product was in /cvmfs/mu2e.... Because KinKal uses RPATH in its installation (see https://github.com/KFTrack/KinKal/blob/main/CMakeLists.txt#L104:L106), whenever a KinKal library is loaded, any library that can be found on the specified rpath will be favored over any libraries that have already been loaded via LD_LIBRARY_PATH. This results in a mixed environment, where (technically speaking) the one-definition rule is violated.

In the aforementioned issue, the sequence of events is the following:

  • ROOT libraries are loaded from /mu2e/ups
  • KinKal is loaded from /cvmfs/mu2e...
  • KinKal library favors /cvmfs/mu2e... installation of ROOT because of presence of rpath.
  • Now we have a mixture of libraries from /mu2e/ups and /cvmfs

resulting in the failure seen in that issue.

To fix this problem, we suggest removing RPATH from the installation of KinKal. This is achievable via the following replacement:

- # set RPATH options
- set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_SKIP_INSTALL_RPATH ON)
@kutschke
Copy link
Contributor

@brownd1978 How do you to proceed with this? One option is to follow Kyle's advice; that might affect your standalone test suite. The other option is to branch in the cmake file and do it the original way for non-Mu2e builds and Kyle's way for builds destined for Mu2e installs.

@brownd1978
Copy link
Contributor

brownd1978 commented Jan 12, 2023 via email

@brownd1978
Copy link
Contributor

Resolved with release v2.3.0

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

No branches or pull requests

3 participants