-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Check duplicate issues.
- Checked for duplicates
Description
Attempting to install ROOT 6.36 via the Spack package manager on MacOS (multiple versions and architectures on different machines) builds without error, but the installation step fails to properly set the RPATH and ROOT is unable to find core libraries when executing or linking other ROOT-based packages.
Runtime error
``` dyld[79397]: Library not loaded: @rpath/libRint.6.36.so Referenced from: <27660B66-7EE2-3FB4-9855-E43EF17D9259> /Users/alfaci/jwilkins/spack/opt/spack/darwin-m1/root-6.36.00-s4iedayuyeec6kyav2zahhnvnepvy2gi/bin/root.exe Reason: tried: '/private/var/folders/8c/3pr52n2x4ng0j9p3rmqtfyvc0000gn/T/alfaci/spack-stage/spack-stage-root-6.36.00-s4iedayuyeec6kyav2zahhnvnepvy2gi/spack-build-s4ieday/lib/libRint.6.36.so' (no such file) [...] ```
There are also several errors appearing in the install step from install_name_tool, complaining about duplicate entries in the RPATH:
install_name_tool errors
``` error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/bin/root (for architecture arm64) option "-add_rpath /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/lib" would duplicate path, file already has LC_RPATH for: /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/lib error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/bin/root (for architecture arm64) option "-add_rpath /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/lib64" would duplicate path, file already has LC_RPATH for: /Users/alfaci/jwilkins/FairSoft_spack_splitrepos/spack/opt/spack/darwin-m1/root-6.36.00-bceszqc7of6ksgxwrbcwya3gjw4vtmwo/lib64 ```
I'm able to fix the issue on my side by patching RootBuildOptions.cmake to revert #18277 which appears for the first time in 6.36 - from some debugging (thanks also to @wdconinc) the issue appears to be some interaction between the gnuinstall flag in ROOT (which is applied by default in Spack), the explicitly set CMAKE_INSTALL_RPATHs from Spack, and the list(APPEND CAKE_INSTALL_RPATH..) in the current version of RootBuildOptions. I've tried adding various different flags to the recipe to fix the issue (e.g. explicitly setting CMAKE_SKIP_INSTALL_RPATH to false), but nothing seems to have helped.
The CMakeCache including the full set of CMake flags invoked by Spack is included under "Additional context"
See spack/spack-packages#215 for more context (Bringing it upstream as there's a chance this also interacts with source building under some combination of flags).
Reproducer
git clone https://github.com/spack/spack # check out spack package manager
cd spack
source share/spack/setup-env.sh # Set up paths for spack
spack env create testenv # Create and activate test environment
spacktivate testenv
spack add root@6.36.00 # Add ROOT version to environment spec
spack install # Concretise and install environment
rootROOT version
6.36.000
Installation method
Package manager (Spack)
Operating system
MacOS: 14.7.6 x86_64 ; 15.5 x86_64 ; 15.5 ARM64