From 6a005ad5d6f85bc0648febaaeb07979bdfc12b84 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Thu, 30 Jul 2026 09:14:23 +0200 Subject: [PATCH 1/3] [vdt] Add a second find hint for vdt headers. In order not to install the vdt headers into /usr/include or similar, a second find hint is added. This would allow for moving the headers to /ROOT/builtins/vdt. --- cmake/modules/FindVdt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/FindVdt.cmake b/cmake/modules/FindVdt.cmake index b9561085bd7ec..19f1b4256462a 100644 --- a/cmake/modules/FindVdt.cmake +++ b/cmake/modules/FindVdt.cmake @@ -34,7 +34,7 @@ # if(NOT VDT_INCLUDE_DIR) - find_path(VDT_INCLUDE_DIR NAME vdt/vdtMath.h PATH_SUFFIXES include) + find_path(VDT_INCLUDE_DIR NAME vdt/vdtMath.h PATH_SUFFIXES include/ ROOT/builtins/ include/ROOT/builtins/) endif() if(NOT VDT_LIBRARY) From c11b5eb6aeb8117e2e5bda20709fcc902630a17c Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Wed, 29 Jul 2026 15:57:29 +0200 Subject: [PATCH 2/3] [builtins] Install builtin vdt headers in ROOT/builtins/vdt. Currently, vdt headers are installed directly into ROOT's header install directory, which may clash with a genuine installation of vdt. Here, it's moved to /ROOT/builtins/. Partial fix of #8655. --- builtins/vdt/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtins/vdt/CMakeLists.txt b/builtins/vdt/CMakeLists.txt index a05772b0abaac..78f6ad056ed0e 100644 --- a/builtins/vdt/CMakeLists.txt +++ b/builtins/vdt/CMakeLists.txt @@ -30,12 +30,12 @@ set(VDT_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ginclude) add_library(VDT::VDT SHARED IMPORTED GLOBAL) add_dependencies(VDT::VDT BUILTIN_VDT) set_target_properties(VDT::VDT PROPERTIES IMPORTED_LOCATION ${VDT_LIBRARIES}) -target_include_directories(VDT::VDT INTERFACE $ $) +target_include_directories(VDT::VDT INTERFACE $ $) install(FILES ${VDT_LIBRARIES} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) install(DIRECTORY ${CMAKE_BINARY_DIR}/include/vdt - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT extra-headers) + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ROOT/builtins/ COMPONENT extra-headers) set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS VDT::VDT) set(VDT_VERSION ${ROOT_VDT_VERSION} PARENT_SCOPE) From 52dd7876b7937e342ee3f2529dcb5a5532f639ca Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Wed, 29 Jul 2026 16:53:02 +0200 Subject: [PATCH 3/3] [test] Add a post-install test for RVec. 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. --- test/PostInstall/CMakeLists.txt | 6 ++++++ test/PostInstall/testRVec.cxx | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 test/PostInstall/testRVec.cxx diff --git a/test/PostInstall/CMakeLists.txt b/test/PostInstall/CMakeLists.txt index 46db8536bf0df..d938c19121f13 100644 --- a/test/PostInstall/CMakeLists.txt +++ b/test/PostInstall/CMakeLists.txt @@ -61,4 +61,10 @@ if(BUILD_TESTING) PROPERTIES ENVIRONMENT PYTHONPATH=${ROOT_LIBRARY_DIR} ) endif() + + if(TARGET ROOT::ROOTVecOps) + add_executable(RVec testRVec.cxx) + target_link_libraries(RVec PUBLIC ROOT::ROOTVecOps) + add_test(NAME RVec COMMAND $) + endif() endif() diff --git a/test/PostInstall/testRVec.cxx b/test/PostInstall/testRVec.cxx new file mode 100644 index 0000000000000..485b22b09e241 --- /dev/null +++ b/test/PostInstall/testRVec.cxx @@ -0,0 +1,34 @@ +/* +RVec can publicly depend on VDT, so here we ensure that the VDT headers are found correctly. +*/ + +#include + +#include + +#define CHECK(ARG) \ + if (!(ARG)) { \ + success = false; \ + std::cerr << #ARG << " failed\n"; \ + } + +int main() +{ + bool success = true; + + ROOT::RVec rv{{1., 2., 3., 4., 5.}, {1., 2., 3., 4., 5.}}; + auto sum = rv[0] + rv[1]; + CHECK(sum.size() == rv[0].size()) + CHECK(sum[3] == 8.) + +#ifdef R__HAS_VDT + ROOT::RVecD rv2{1., 2., 3., 4., 5.}; + auto logs = fast_log(rv2); + CHECK(std::fabs(logs[0]) < 1.E-15) + CHECK(std::fabs(logs[1] - std::log(2.)) < 1.E-15); + if (!success) + std::cout << "logs=" << logs << "\n"; +#endif + + return success ? 0 : 1; +}