From 837d8ada7c6ad8438887807b4faf66b02fe3a26b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 1 Jun 2021 11:06:58 -0400 Subject: [PATCH 1/2] Install only the same Thrust files that Thrust itself installs Fixes #8397 Recreate thrust's install rules so we don't install extra directories such as `.git`. We can't leverage thrust's install rules as that would break our layout as the cmake files would need to go into something like `lib/cmake/cudf/thirdparty?/lib/cmake/thrust`. This weird path is required as cudf packages a modified version of Thrust and we don't want that to be installed into a default system path. --- cpp/CMakeLists.txt | 10 ---------- cpp/cmake/thirdparty/CUDF_GetThrust.cmake | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 015c856d272..131143a4c8d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -597,16 +597,6 @@ install(DIRECTORY ${CUDF_GENERATED_INCLUDE_DIR}/include/libcudacxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcudf) -install(DIRECTORY ${Thrust_SOURCE_DIR}/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust - PATTERN "*.py" EXCLUDE - PATTERN "benchmark" EXCLUDE - PATTERN "build" EXCLUDE - PATTERN "doc" EXCLUDE - PATTERN "examples" EXCLUDE - PATTERN "test" EXCLUDE - PATTERN "testing" EXCLUDE) - include(CMakePackageConfigHelpers) configure_package_config_file(cmake/cudf-config.cmake.in "${CUDF_BINARY_DIR}/cmake/cudf-config.cmake" diff --git a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake index 343ade8664d..701adaaff9f 100644 --- a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake +++ b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake @@ -35,7 +35,23 @@ function(find_and_configure_thrust VERSION) thrust_create_target(cudf::Thrust FROM_OPTIONS) set(THRUST_LIBRARY "cudf::Thrust" PARENT_SCOPE) - set(Thrust_SOURCE_DIR "${Thrust_SOURCE_DIR}" PARENT_SCOPE) + + include(GNUInstallDirs) + install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/" + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.inl") + install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/" + FILES_MATCHING + PATTERN "*.cuh") + + install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/thrust/") + install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/cub/") + endfunction() set(CUDF_MIN_VERSION_Thrust 1.12.0) From ba62f3d8cd9e771d0bcdf06e0bb0ff4f2f26f5d1 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 1 Jun 2021 16:59:07 -0400 Subject: [PATCH 2/2] Correct cub install location to match thrust source location --- cpp/cmake/thirdparty/CUDF_GetThrust.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake index 701adaaff9f..2792786f553 100644 --- a/cpp/cmake/thirdparty/CUDF_GetThrust.cmake +++ b/cpp/cmake/thirdparty/CUDF_GetThrust.cmake @@ -43,14 +43,14 @@ function(find_and_configure_thrust VERSION) PATTERN "*.h" PATTERN "*.inl") install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/" FILES_MATCHING PATTERN "*.cuh") install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/thrust/") install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/cub/") + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/cub/") endfunction()