From 81f5bf72bec7c54dc68807147d469b2f71688ea0 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 11 Dec 2023 16:11:07 -0600 Subject: [PATCH] Use rapids_cpm_cccl. --- cpp/CMakeLists.txt | 5 ++- .../{get_thrust.cmake => get_cccl.cmake} | 13 ++++--- cpp/cmake/thirdparty/get_libcudacxx.cmake | 35 ------------------- 3 files changed, 8 insertions(+), 45 deletions(-) rename cpp/cmake/thirdparty/{get_thrust.cmake => get_cccl.cmake} (72%) delete mode 100644 cpp/cmake/thirdparty/get_libcudacxx.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c2b5437abf..029f7a7405 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -220,9 +220,8 @@ if(BUILD_CUML_TESTS OR BUILD_PRIMS_TESTS) find_package(Threads) endif() -# thrust before rmm, rmm before raft so we get the right version of thrust/rmm -include(cmake/thirdparty/get_thrust.cmake) -include(cmake/thirdparty/get_libcudacxx.cmake) +# CCCL before RMM, and RMM before RAFT +include(cmake/thirdparty/get_cccl.cmake) include(cmake/thirdparty/get_rmm.cmake) include(cmake/thirdparty/get_raft.cmake) diff --git a/cpp/cmake/thirdparty/get_thrust.cmake b/cpp/cmake/thirdparty/get_cccl.cmake similarity index 72% rename from cpp/cmake/thirdparty/get_thrust.cmake rename to cpp/cmake/thirdparty/get_cccl.cmake index 1477a8b397..0c126e320e 100644 --- a/cpp/cmake/thirdparty/get_thrust.cmake +++ b/cpp/cmake/thirdparty/get_cccl.cmake @@ -12,12 +12,11 @@ # the License. # ============================================================================= -# Use CPM to find or clone thrust -function(find_and_configure_thrust) - include(${rapids-cmake-dir}/cpm/thrust.cmake) - rapids_cpm_thrust(NAMESPACE cuml - BUILD_EXPORT_SET cuml-exports - INSTALL_EXPORT_SET cuml-exports) +# Use CPM to find or clone CCCL +function(find_and_configure_cccl) + include(${rapids-cmake-dir}/cpm/cccl.cmake) + rapids_cpm_cccl(BUILD_EXPORT_SET cuml-exports + INSTALL_EXPORT_SET cuml-exports) endfunction() -find_and_configure_thrust() +find_and_configure_cccl() diff --git a/cpp/cmake/thirdparty/get_libcudacxx.cmake b/cpp/cmake/thirdparty/get_libcudacxx.cmake deleted file mode 100644 index 54184ced34..0000000000 --- a/cpp/cmake/thirdparty/get_libcudacxx.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# ============================================================================= - -# This function finds thrust and sets any additional necessary environment variables. -function(find_and_configure_libcudacxx) - # Make sure we install libcudacxx beside our patched version of thrust - include(GNUInstallDirs) - set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/libcuml") - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_INCLUDEDIR}/lib") - - include(${rapids-cmake-dir}/cpm/libcudacxx.cmake) - rapids_cpm_libcudacxx(BUILD_EXPORT_SET cuml-exports INSTALL_EXPORT_SET cuml-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 libcudacxx - [=[${CMAKE_CURRENT_LIST_DIR}/../../../include/libcuml/lib/rapids/cmake/libcudacxx]=] - EXPORT_SET cuml-exports - CONDITION libcudacxx_SOURCE_DIR - ) -endfunction() - -find_and_configure_libcudacxx()