Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builtins/vdt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<BUILD_INTERFACE:${VDT_INCLUDE_DIR}> $<INSTALL_INTERFACE:include/>)
target_include_directories(VDT::VDT INTERFACE $<BUILD_INTERFACE:${VDT_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ROOT/builtins/>)

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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindVdt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions test/PostInstall/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:RVec>)
endif()
endif()
34 changes: 34 additions & 0 deletions test/PostInstall/testRVec.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Comment thread
hageboeck marked this conversation as resolved.
RVec can publicly depend on VDT, so here we ensure that the VDT headers are found correctly.
*/

#include <ROOT/RVec.hxx>

#include <iostream>

#define CHECK(ARG) \
if (!(ARG)) { \
success = false; \
std::cerr << #ARG << " failed\n"; \
}

int main()
{
bool success = true;

ROOT::RVec<ROOT::RVecD> 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;
}
Loading