Skip to content

Commit

Permalink
Move required CMake version to 3.26.4 (#627)
Browse files Browse the repository at this point in the history
Move rapids-cmake over to requiring CMake 3.26.4 which the rest of RAPIDS has required for a couple of releases.

Therefore it deprecates the `rapids_cuda_patch_toolkit` module as it no longer is needed.

Fixes #315

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

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Bradley Dice (https://github.com/bdice)

URL: #627
  • Loading branch information
robertmaynard authored Jun 13, 2024
1 parent 116a5cc commit c4b5fd5
Show file tree
Hide file tree
Showing 78 changed files with 144 additions and 138 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
# cases it can fail due to CMAKE_MODULE_PREFIX not being exported properly

# Enforce the minimum required CMake version for all users
cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

set(rapids-cmake-dir "${CMAKE_CURRENT_LIST_DIR}/rapids-cmake")
if(NOT DEFINED CACHE{rapids-cmake-dir})
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/rapids_core_dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(rapids-dependencies LANGUAGES CXX)

Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
common:
- output_types: [conda, requirements]
packages:
- cmake>=3.23.1,!=3.25.0
- cmake>=3.26.4
- ninja
- output_types: conda
packages:
Expand Down
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
# limitations under the License.
#=============================================================================

cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/EXAMPLE_RAPIDS.cmake)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.10/RAPIDS.cmake
Expand Down
2 changes: 1 addition & 1 deletion rapids-cmake/cpm/cccl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function(rapids_cpm_cccl)
include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake")
rapids_cpm_generate_patch_command(CCCL ${version} patch_command)

# Ensure for CMake 3.24+ that the CCCL::Thrust target exists:
# Ensure that the CCCL::Thrust target exists by making all targets from the package GLOBAL
# https://github.com/NVIDIA/cccl/pull/1182
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON)

Expand Down
13 changes: 12 additions & 1 deletion rapids-cmake/cuda/patch_toolkit.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,11 @@ of cublas and cusolver targets are incorrect. This module must be called
from the same CMakeLists.txt as the first `find_project(CUDAToolkit)` to
patch the targets.
.. deprecated:: v24.08.00
``rapids_cuda_patch_toolkit`` has been deprecated and will be removed
in 24.10 as now the minimum CMake required to use rapids-cmake is
3.26.4.
.. note::
:cmake:command:`rapids_cpm_find` will automatically call this module
when asked to find the CUDAToolkit.
Expand All @@ -40,6 +45,12 @@ patch the targets.
function(rapids_cuda_patch_toolkit)
list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.patch_toolkit")

include("${rapids-cmake-dir}/cmake/detail/policy.cmake")
rapids_cmake_policy(DEPRECATED_IN 24.08
REMOVED_IN 24.10
MESSAGE [=[Usage of `rapids_cuda_patch_toolkit` has been deprecated as CMake has fixed the issue it solves.]=]
)

get_directory_property(itargets IMPORTED_TARGETS)
if(CMAKE_VERSION VERSION_LESS 3.24.2)
if(CUDA::cublas IN_LIST itargets)
Expand Down
7 changes: 1 addition & 6 deletions rapids-cmake/find/package.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -133,11 +133,6 @@ macro(rapids_find_package name)
# OPTIONAL find packages
if(${${name}_FOUND})

if(${name} STREQUAL "CUDAToolkit")
include("${rapids-cmake-dir}/cuda/patch_toolkit.cmake")
rapids_cuda_patch_toolkit()
endif()

set(_rapids_extra_info)
if(_RAPIDS_FIND_GLOBAL_TARGETS)
list(APPEND _rapids_extra_info "GLOBAL_TARGETS" ${_RAPIDS_FIND_GLOBAL_TARGETS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)
project(generate_resource_spec ${lang})

set(CMAKE_CUDA_ARCHITECTURES all)
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/test/detail/run_gpu_test.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

if(DEFINED ENV{CTEST_RESOURCE_GROUP_COUNT})
# cmake-lint: disable=E1120
Expand Down
2 changes: 1 addition & 1 deletion testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#=============================================================================

cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
project(rapids-cmake-testing LANGUAGES NONE)

enable_testing()
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-custom-prefix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES CXX)
rapids_cmake_write_git_revision_file(demo_version "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp")
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-dirty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES CXX)

Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-embed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES CXX)
rapids_cmake_write_git_revision_file(git_generated_header "${CMAKE_CURRENT_BINARY_DIR}/demo/git_version.hpp")
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-embed/verify_embedding.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)
file(STRINGS "${EXECUTABLE}" contents)

execute_process(
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-no-git/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES CXX)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)
file(STRINGS "${EXECUTABLE}" contents)

execute_process(
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_git_revision-simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake)
include(${rapids-cmake-dir}/export/export.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES CXX)
rapids_cmake_write_git_revision_file(demo_version "${CMAKE_CURRENT_BINARY_DIR}/demo/demo_git_version.hpp")
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_version-absolute/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 2.4 LANGUAGES NONE)
rapids_cmake_write_version_file("${CMAKE_CURRENT_BINARY_DIR}/demo/version.h")
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_version-all-zeroes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 0.0000.1 LANGUAGES NONE)
rapids_cmake_write_version_file(version.h)
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_version-custom-prefix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(RandomProjectName VERSION 3.2.0 LANGUAGES NONE)
rapids_cmake_write_version_file(demo_version.hpp PREFIX DEMO)
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_version-leading-zeroes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 09.00008.02 LANGUAGES NONE)
rapids_cmake_write_version_file(version.h)
Expand Down
4 changes: 2 additions & 2 deletions testing/cmake/write_version-relative/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
#=============================================================================
include(${rapids-cmake-dir}/cmake/write_version_file.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)

project(DEMO VERSION 3.2.0 LANGUAGES NONE)
rapids_cmake_write_version_file(demo_version.hpp)
Expand Down
4 changes: 2 additions & 2 deletions testing/cpm/cpm_cccl-simple.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,7 +44,7 @@ endif()
if(NOT TARGET CCCL::libcudacxx)
message(FATAL_ERROR "Expected CCCL::libcudacxx target to exist")
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24.0 AND NOT TARGET CCCL::Thrust)
if(NOT TARGET CCCL::Thrust)
message(FATAL_ERROR "Expected CCCL::Thrust target to exist")
endif()
if(NOT TARGET libcudacxx::libcudacxx)
Expand Down
4 changes: 2 additions & 2 deletions testing/cpm/cpm_find-add-pkg-source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/find.cmake)

cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)
project(rapids-cpm-find-add-pkg-source LANGUAGES CXX)

set(CPM_ZLIB_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mock_zlib_source_dir")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)
cmake_minimum_required(VERSION 3.26.4)
project(ZLIB LANGUAGES CXX)

add_library(MOCK_ZLIB INTERFACE)
Loading

0 comments on commit c4b5fd5

Please sign in to comment.