-
Notifications
You must be signed in to change notification settings - Fork 14
fix: link to ROOT::Core only #484
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
fix: link to ROOT::Core only #484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR restricts JANA2's ROOT dependency from the broad ROOT_LIBRARIES variable to the more specific ROOT::Core target, reducing unnecessary library linkage. The broader ROOT_LIBRARIES includes many unneeded components like RIO, Net, Hist, Graf, Tree, etc.
- Replaced
${ROOT_LIBRARIES}withROOT::Corefor direct ROOT usage - Removed explicit ROOT library linking when using podio, as
podio::podioRootIOprovides necessary ROOT IO libraries transitively - Applied changes consistently across all library targets and examples
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libraries/JANA/CMakeLists.txt | Updated jana2, jana2_static_lib, and jana2_shared_lib targets to link against ROOT::Core instead of ROOT_LIBRARIES, and removed redundant ROOT library specification when using podio |
| src/examples/misc/RootDatamodelExample/CMakeLists.txt | Updated RootDatamodelExample plugin to link against ROOT::Core instead of ROOT_LIBRARIES |
| CMakeLists.txt | Updated global link_libraries directive to use ROOT::Core instead of ROOT_LIBRARIES |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3ec9f51 to
37af9e6
Compare
|
Does this affect how much of ROOT you have to build? I naively assumed that ROOT_LIBRARIES is set to only include the ROOT libraries that were actually built and installed. I'd hate for you to have to build the entirety of ROOT, including dependencies such as Qt, simply so that JANA can Or is this PR more about getting us off of old-style CMake? |
|
Any idea how much of an effect this change has on EICrecon's compilation time? |
Yes, this is more of that :-) Just general minimal dependencies where possible. Shorter linking lines too. I don't think it affects compilation time too much (if ROOT is on cvmfs like for EICrecon inside eic-shell, then it pulls the libraries since they are on the command line, only to ignore them during linking). |
|
It really started out of an attempt at building all of EICrecon (or as much as possible) with C++20 modules. That would have an impact on compilation time since we have JANA as the most expensive headers and they are included in a whole bunch of places. It's likely going to be easier to get ROOT::Core to support modules than all of ROOT_LIBRARIES. |
|
I'm curious to hear how your adventures with modules go! |
JANA2 by default links against ROOT_LIBRARIES, which is much broader than needed (it includes all of Core Imt RIO Net Hist Graf Graf3d Gpad ROOTDataFrame Tree TreePlayer Rint Postscript Matrix Physics MathCore Thread MultiProc ROOTVecOps). (Yes, as-needed can get rid of some of this.)
This PR restricts the link target to ROOT::Core only, which is sufficient for everything in the project. ROOT IO is not implemented in the examples, but an extra target would need to be added to future targets that explicitly use it. The podioRootIO target links transitively to the necessary ROOT IO libraries, and they do not need to specified explicitly.