Skip to content

Make VDT a private dependency; don't install headers of builtins into the global install prefix - #22958

Open
hageboeck wants to merge 4 commits into
root-project:masterfrom
hageboeck:ROOT-8655_DontInstallHeadersOfBuiltins
Open

Make VDT a private dependency; don't install headers of builtins into the global install prefix#22958
hageboeck wants to merge 4 commits into
root-project:masterfrom
hageboeck:ROOT-8655_DontInstallHeadersOfBuiltins

Conversation

@hageboeck

@hageboeck hageboeck commented Jul 29, 2026

Copy link
Copy Markdown
Member

This improves the situation of #8655, by not unconditionally installing the XRootD and VDT headers into /include.

The only builtins that were publicly visible were XRootD and VDT. The former is already a private dependency, so its headers didn't need to be installed, any more. #22970
By outlining VDT from RVec.hxx, it can be made private, too. Therefore, it doesn't need to be installed, and modules are independent of whether or not VDT was present at build time, which fixes the last missing piece to close #9736.

A small post-install test was added to test that the RVec VDT functions work without an installed VDT.

@hageboeck hageboeck self-assigned this Jul 29, 2026
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 49m 41s ⏱️
 3 856 tests  3 856 ✅ 0 💤 0 ❌
79 447 runs  79 447 ✅ 0 💤 0 ❌

Results for commit 75a613f.

♻️ This comment has been updated with latest results.

@ferdymercury
ferdymercury requested a review from guitargeek July 29, 2026 15:52
@guitargeek

Copy link
Copy Markdown
Contributor

#ifdef R__HAS_VDT
#include <vdt/vdtMath.h>
#endif

#include <ROOT/RVec.hxx>

I was just suggesting to only forward declare vdt in this header 🙂 So ROOT builds with vdt=ON can also be used on systems where vdt is not in the default include path, which is improving the portability situation quite a bit:

So we'd have to update your new post-install test when my PR gets merged.

Maybe a more robust way (independent of my PR getting merged or not) to test what you actually want to cover ("ensure that the VDT headers are found correctly"), is just to check that the #include <vdt/vdtMath.h> header can be found? This can even be done at the post install CMake level with the usual header availability checks, I don't think we need a dedicated compiled test for that.

Or is there an advantage of testing this indirectly via RVec.hxx that I'm missing?

@hageboeck
hageboeck force-pushed the ROOT-8655_DontInstallHeadersOfBuiltins branch from 2b895e4 to 42fc1d7 Compare July 30, 2026 07:16

@vepadulano vepadulano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, two minor comments.

Comment thread test/PostInstall/testRVec.cxx Outdated
Comment thread test/PostInstall/testRVec.cxx
@hageboeck

Copy link
Copy Markdown
Member Author

#ifdef R__HAS_VDT
#include <vdt/vdtMath.h>
#endif

#include <ROOT/RVec.hxx>

I was just suggesting to only forward declare vdt in this header 🙂 So ROOT builds with vdt=ON can also be used on systems where vdt is not in the default include path, which is improving the portability situation quite a bit:

If VDT is not included, trying to call these functions would produce an error. So we are shifting the error on inclusion to an error on call. I think that's fair, but your installation is broken in both cases.
If you want, we can go ahead with the other PR, but I would still like to test that using a VDT function in RVec actually works if ROOT claims that it has VDT.

Maybe a more robust way (independent of my PR getting merged or not) to test what you actually want to cover ("ensure that the VDT headers are found correctly"), is just to check that the #include <vdt/vdtMath.h> header can be found? This can even be done at the post install CMake level with the usual header availability checks, I don't think we need a dedicated compiled test for that.

It's not exactly the same: If CMake finds the header (because you gave it enough search hints), you might still not be able to compile an RVec program, because we need to test that all the -I of the CMake target ROOT::ROOTVecOps are correct. That will be the case if we export things correctly, so I would like to keep compiling a program that includes RVec.hxx and tries to call a VDT function. What this program does is secondary, though, so any call of a vdt function will do.

So should we say:

  1. Finish and merge [RVec] Forward declare VDT functions in RVec.hxx header #22927
  2. Update the test in this PR here.

@guitargeek

Copy link
Copy Markdown
Contributor

So should we say:

1. Finish and merge [[RVec] Forward declare VDT functions in `RVec.hxx` header #22927](https://github.com/root-project/root/pull/22927)

2. Update the test in this PR here.

Agreed with that! Let's continue the discussion in #22927 for now, and then adapt the test in this PR.

@hageboeck
hageboeck force-pushed the ROOT-8655_DontInstallHeadersOfBuiltins branch 2 times, most recently from a4f5506 to 52dd787 Compare July 31, 2026 14:00
One of the only builtins that ROOT depends on publicly is VDT. When
using RVec.h, the VDT headers need to be visible, so this small test
tries to invoke a VDT function on an RVec.
@hageboeck
hageboeck force-pushed the ROOT-8655_DontInstallHeadersOfBuiltins branch from 52dd787 to e8f47f6 Compare August 4, 2026 11:42
@hageboeck
hageboeck force-pushed the ROOT-8655_DontInstallHeadersOfBuiltins branch from e8f47f6 to 9030b8f Compare August 4, 2026 11:49
@hageboeck
hageboeck requested a review from vepadulano August 4, 2026 11:49
@hageboeck

Copy link
Copy Markdown
Member Author

@guitargeek, here is what we discussed. VDT is now completely outlined, so we don't need to search it nor install it.

@hageboeck
hageboeck force-pushed the ROOT-8655_DontInstallHeadersOfBuiltins branch from 9030b8f to d6433c6 Compare August 4, 2026 12:09
@hageboeck hageboeck changed the title Don't install headers of builtins into the global install prefix Make VDT a private dependency; don't install headers of builtins into the global install prefix Aug 4, 2026
By moving all calls to VDT to the .cxx, the interpreter doesn't need to
know about it, and ROOT doesn't need to install builtin-vdt's headers.

- Outline all vdt-related functions in RVec.cxx
- Convert the builtin-vdt library from .so to header only
- Move the builtin-vdt artifacts to builtins/vdt/install
- Don't install any of VDT's artifacts

Fix root-project#9736.
Now that the VDT dependency is private, an installed ROOT does not
anymore require VDT.

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much for this!

Now, the compiler can't decide to inline the RVec fast_* functions anymore, but given this is an unclear presumed performance benefit to a niche user group this is an acceptable tradeoff to get more relocatable builds without public dependencies!

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.

[cmake] Diagnose missing header (and include path) for externally built libraries.

3 participants