Skip to content

[CMake] Build rootcint and genreflex as separate targets#19769

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:genreflex_rootcint
Oct 21, 2025
Merged

[CMake] Build rootcint and genreflex as separate targets#19769
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:genreflex_rootcint

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Aug 28, 2025

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).

@guitargeek guitargeek self-assigned this Aug 28, 2025
@guitargeek guitargeek requested a review from bellenot as a code owner August 28, 2025 12:26
@guitargeek guitargeek added in:Build System clean build Ask CI to do non-incremental build on PR labels Aug 28, 2025
@guitargeek guitargeek changed the title [CMake] Always create rootcint and genreflex as copies of rootcling [CMake] Build rootcint and genreflex as separate targets Aug 28, 2025
@guitargeek
Copy link
Copy Markdown
Contributor Author

To hide whitespace changes for easier review:

@pcanal
Copy link
Copy Markdown
Member

pcanal commented Aug 28, 2025

The cost is ... little cost ...

Side note: We do not support static library builds but we have had request for it, this would (silently) make them [avoidably] (even) bigger.

@pcanal
Copy link
Copy Markdown
Member

pcanal commented Aug 28, 2025

when DESTDIR is not set

I assume this is solvable by ... setting it :) (and/or handling the case more explicitly).

So the bigger hurdle is:

or because hard links are not allowed.

Where/when are hard links not allowed?

@guitargeek
Copy link
Copy Markdown
Contributor Author

Also Python wheels (I can look up the source again when on the computer)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 28, 2025

Test Results

    22 files      22 suites   3d 18h 28m 50s ⏱️
 3 690 tests  3 689 ✅ 0 💤 1 ❌
79 226 runs  79 221 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit 75b852c.

♻️ This comment has been updated with latest results.

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).
Copy link
Copy Markdown
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

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

Thank you!

@guitargeek
Copy link
Copy Markdown
Contributor Author

The cost is ... little cost ...

Side note: We do not support static library builds but we have had request for it, this would (silently) make them [avoidably] (even) bigger.

We are far from this anyway. Progress on static builds is tracked in this issue now:
#19944

If we have to provide static builds, the situation with the ROOT executables can be revisited.

@guitargeek guitargeek merged commit df2231a into root-project:master Oct 21, 2025
21 of 27 checks passed
@guitargeek guitargeek deleted the genreflex_rootcint branch October 21, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:Build System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants