Skip to content

Conversation

hageboeck
Copy link
Member

TODO

Usually, CMake automatically sets RUNPATH when target_link_libraries is
used. However, since Core doesn't have other ROOT dependencies, its
RUNPATH might only contain external dependencies or remain empty.
To enable Core to find other ROOT libraries, its current location is
added to its BUILD_RPATH.
Since ROOT libraries are generally next to libCore, one can use its
location to shortcut library searches. The search order is now:
ROOT_LIBRARY_PATH, Root.DynamicPath, LD_LIBRARY_PATH (or its
equivalent), location of libCore, and then proceeding with ld loader
paths.
This allows users to override which libraries are loaded, and then
proceeds with the currently loaded ROOT libraries, before going into the
system.
To cover the gnuninstall case, switch mac beta and the linux arch-native
builds to gnuinstall.
This is done as an option override on special builds to not affect the
binaries we produce.
@hageboeck hageboeck self-assigned this Sep 30, 2025
Copy link

Test Results

    22 files      22 suites   3d 19h 2m 56s ⏱️
 3 683 tests  3 680 ✅ 0 💤 3 ❌
79 125 runs  79 120 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit 920940b.

@guitargeek
Copy link
Contributor

I have solved a similar problem in 47caba5 for TROOT, so TROOT::GetLibDir() should give you the right path already. Maybe you can re-use that?


ROOT_LINKER_LIBRARY(Core BUILTINS LZMA)

# This sets RUNPATH for libCore, which enables it to dlopen any ROOT library in its directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very good addition in any case 👍

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.

2 participants