-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Build rootcint
and genreflex
as separate targets
#19769
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
base: master
Are you sure you want to change the base?
Conversation
e6d39c4
to
9bc5328
Compare
rootcint
and genreflex
as copies of rootclingrootcint
and genreflex
as separate targets
This makes the CMake code more robust. Right now, we use some `install(CODE "execute_process(COMMAND ln -f ...` solution on unix to install `rootcint` and `genreflex`. This does not work in all cases, either because of the usage of `\$ENV{DESTDIR}` when `DESTDIR` is not set, or because hard links are not allowed. Always copying `rootcling` - already in the build tree - would avoid that problem, but by copying we risk sidestepping the CMake mechanisms to set the RPath correctly when installing the copies, which are not actual targets. To make makes things simpler and more robust, this commit suggests to build the `rootcing` and `genreflex` executables as separate targets from the same source. The cost is very little cost in memory (`rootcling` is only 31K, so copying two times only increases the size of ROOTs `bin` directory by 1.5 %) and little in compile time (the extra compile time is less than a second, not noticable in parallel builds).
9bc5328
to
0da49b0
Compare
To hide whitespace changes for easier review: |
ROOT_EXECUTABLE(rootls src/rootls.cxx LIBRARIES RIO Tree Core Rint ROOTNTuple) | ||
# To inherit the dependencies from rootcling | ||
add_dependencies(genreflex rootcling) | ||
add_dependencies(rootcint rootcint) |
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.
Is this maybe?
add_dependencies(rootcint rootcint) | |
add_dependencies(rootcint rootcling) |
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.
Oh... Yes thanks!
Side note: We do not support static library builds but we have had request for it, this would (silently) make them [avoidably] (even) bigger. |
I assume this is solvable by ... setting it :) (and/or handling the case more explicitly). So the bigger hurdle is:
Where/when are hard links not allowed? |
Also Python wheels (I can look up the source again when on the computer) |
Test Results 21 files 21 suites 3d 18h 26m 46s ⏱️ For more details on these failures, see this check. Results for commit 0da49b0. |
This makes the CMake code more robust.
Right now, we use some
install(CODE "execute_process(COMMAND ln -f ...
solution on unix to install
rootcint
andgenreflex
. This does notwork in all cases, either because of the usage of
\$ENV{DESTDIR}
whenDESTDIR
is not set, or because hard links are not allowed.Always copying
rootcling
- already in the build tree - would avoidthat problem, but by copying we risk sidestepping the CMake mechanisms
to set the RPath correctly when installing the copies, which are not
actual targets.
To make makes things simpler and more robust, this commit suggests to
build the
rootcing
andgenreflex
executables as separate targetsfrom the same source. The cost is very little cost in memory
(
rootcling
is only 31K, so copying two times only increases the sizeof ROOTs
bin
directory by 1.5 %) and little in compile time (the extracompile time is less than a second, not noticable in parallel builds).