From 94836627fd3fa3bee97cab7ad9a809daddca84f5 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 26 Apr 2023 00:20:52 -0500 Subject: [PATCH 1/3] Test rapids-cmake branch with CCCL updates to 2.1.0. --- fetch_rapids.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index 6554998ec1..81eb36b950 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -12,6 +12,8 @@ # the License. # ============================================================================= if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUML_RAPIDS.cmake) + set(rapids-cmake-repo bdice/rapids-cmake) + set(rapids-cmake-branch cccl-update-2.1.0) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/CUML_RAPIDS.cmake ) From c5e0193b56791372743d93fa1add48b860fee057 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 26 Apr 2023 22:54:56 -0500 Subject: [PATCH 2/3] Add thrust and rmm before raft, so that rapids-cmake controls them correctly. --- cpp/CMakeLists.txt | 3 +++ cpp/cmake/thirdparty/get_rmm.cmake | 23 +++++++++++++++++++++++ cpp/cmake/thirdparty/get_thrust.cmake | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 cpp/cmake/thirdparty/get_rmm.cmake create mode 100644 cpp/cmake/thirdparty/get_thrust.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 0ad691fdbf..2b36b5fde2 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -220,6 +220,9 @@ 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_rmm.cmake) include(cmake/thirdparty/get_raft.cmake) if(LINK_TREELITE) diff --git a/cpp/cmake/thirdparty/get_rmm.cmake b/cpp/cmake/thirdparty/get_rmm.cmake new file mode 100644 index 0000000000..5503133dda --- /dev/null +++ b/cpp/cmake/thirdparty/get_rmm.cmake @@ -0,0 +1,23 @@ +#============================================================================= +# Copyright (c) 2021-2022, 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. +#============================================================================= + +function(find_and_configure_rmm) + include(${rapids-cmake-dir}/cpm/rmm.cmake) + rapids_cpm_rmm(BUILD_EXPORT_SET cuml-exports + INSTALL_EXPORT_SET cuml-exports) +endfunction() + +find_and_configure_rmm() diff --git a/cpp/cmake/thirdparty/get_thrust.cmake b/cpp/cmake/thirdparty/get_thrust.cmake new file mode 100644 index 0000000000..2a70175255 --- /dev/null +++ b/cpp/cmake/thirdparty/get_thrust.cmake @@ -0,0 +1,24 @@ +# ============================================================================= +# Copyright (c) 2022-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. +# ============================================================================= + +# 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) +endfunction() + +find_and_configure_thrust() From 5d9311edf2356c3bf66baafb78e3d2485f846f37 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 12 Sep 2023 15:58:28 -0700 Subject: [PATCH 3/3] Define rapids-cmake variables outside if statement. --- fetch_rapids.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index 81eb36b950..447271e81d 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -11,9 +11,9 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= +set(rapids-cmake-repo bdice/rapids-cmake) +set(rapids-cmake-branch cccl-update-2.1.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUML_RAPIDS.cmake) - set(rapids-cmake-repo bdice/rapids-cmake) - set(rapids-cmake-branch cccl-update-2.1.0) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/CUML_RAPIDS.cmake )