Skip to content

Commit

Permalink
Only install thrust when using a non 'system' version (#9206)
Browse files Browse the repository at this point in the history
Previously cudf presumed that no system version of Thrust matched the version cudf required, but with the merger
of rapidsai/rmm#854 this isn't true.

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

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

URL: #9206
  • Loading branch information
robertmaynard authored Sep 13, 2021
1 parent 4349232 commit 28a6292
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions cpp/cmake/thirdparty/get_thrust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function(find_and_configure_thrust VERSION)
set(cpm_thrust_disconnect_update "")
endif()

# We currently require cuDF to always build with a custom
# version of thrust. This is needed so that build times of
# of cudf are kept reasonable, without this CI builds
# of cudf will be killed as some source file can take
# over 45 minutes to build
#
set(CPM_DOWNLOAD_ALL TRUE)
rapids_cpm_find(
Thrust ${VERSION}
BUILD_EXPORT_SET cudf-exports
Expand All @@ -40,26 +47,28 @@ function(find_and_configure_thrust VERSION)
thrust_create_target(cudf::Thrust FROM_OPTIONS)
endif()

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")
if(Thrust_SOURCE_DIR) # only install thrust when we have an in-source version
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/")
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/")


# Store where CMake can find our custom Thrust install
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(INSTALL Thrust [=[${CMAKE_CURRENT_LIST_DIR}/../../../include/libcudf/Thrust/]=] cudf-exports)
# Store where CMake can find our custom Thrust install
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(INSTALL Thrust [=[${CMAKE_CURRENT_LIST_DIR}/../../../include/libcudf/Thrust/]=] cudf-exports)
endif()
endfunction()

set(CUDF_MIN_VERSION_Thrust 1.12.0)
Expand Down

0 comments on commit 28a6292

Please sign in to comment.