Skip to content

Commit

Permalink
Install only the same Thrust files that Thrust itself installs (#8420)
Browse files Browse the repository at this point in the history
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.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Mark Harris (https://github.com/harrism)

URL: #8420
  • Loading branch information
robertmaynard authored Jun 9, 2021
1 parent 90e29d9 commit a9f15b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
10 changes: 0 additions & 10 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -598,16 +598,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"
Expand Down
18 changes: 17 additions & 1 deletion cpp/cmake/thirdparty/CUDF_GetThrust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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/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/dependencies/cub/")

endfunction()

set(CUDF_MIN_VERSION_Thrust 1.12.0)
Expand Down

0 comments on commit a9f15b8

Please sign in to comment.