From c4618eb54738965c31030b3427d705c91e73a3f0 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 1 Aug 2023 15:53:24 -0500 Subject: [PATCH] Use fetch_rapids.cmake. (#1319) This PR migrates RMM to use `fetch_rapids.cmake` like most RAPIDS repos. This makes it easier to define a single source if the upstream branch of rapids-cmake needs to change for testing, like in #1247. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Ray Douglass (https://github.com/raydouglass) - Robert Maynard (https://github.com/robertmaynard) URL: https://github.com/rapidsai/rmm/pull/1319 --- CMakeLists.txt | 6 +----- ci/release/update-version.sh | 5 +++-- fetch_rapids.cmake | 18 ++++++++++++++++++ python/CMakeLists.txt | 4 +--- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 fetch_rapids.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aeabbdc0..a0df2ff3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake - ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) -endif() -include(${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) +include(fetch_rapids.cmake) include(rapids-cmake) include(rapids-cpm) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 7314442ff..42378a2fe 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -31,14 +31,15 @@ function sed_runner() { # cpp update sed_runner 's/'" VERSION .*"'/'" VERSION ${NEXT_FULL_TAG}"'/g' CMakeLists.txt -sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' CMakeLists.txt # Python update sed_runner 's/'"rmm_version .*)"'/'"rmm_version ${NEXT_FULL_TAG})"'/g' python/CMakeLists.txt -sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' python/CMakeLists.txt sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/rmm/__init__.py sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pyproject.toml +# rapids-cmake version +sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' fetch_rapids.cmake + # cmake-format rapids-cmake definitions sed_runner 's/'"branch-.*\/cmake-format-rapids-cmake.json"'/'"branch-${NEXT_SHORT_TAG}\/cmake-format-rapids-cmake.json"'/g' ci/check_style.sh diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake new file mode 100644 index 000000000..1ff8119ba --- /dev/null +++ b/fetch_rapids.cmake @@ -0,0 +1,18 @@ +# ============================================================================= +# 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. +# ============================================================================= +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake + ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) +endif() +include(${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index a7306924e..7920bdd3b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,9 +16,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) set(rmm_version 23.10.00) -file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake - ${CMAKE_BINARY_DIR}/RAPIDS.cmake) -include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) +include(../fetch_rapids.cmake) project( rmm-python