From 9a2cfe882301e10ba9e75f74ce79303e63685c7b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 5 Sep 2023 13:35:39 -0400 Subject: [PATCH 01/17] Support fmt use in debug builds (#456) Fixes #454 Backport of an upstream patch (https://github.com/fmtlib/fmt/pull/3352) to our version of fmt 9.1 Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/rapids-cmake/pull/456 --- rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff | 13 +++++++++++++ rapids-cmake/cpm/versions.json | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff diff --git a/rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff b/rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff new file mode 100644 index 00000000..9c778f41 --- /dev/null +++ b/rapids-cmake/cpm/patches/fmt/no_debug_warnings.diff @@ -0,0 +1,13 @@ +diff --git a/include/fmt/core.h b/include/fmt/core.h +index f6a37af..ffabe63 100644 +--- a/include/fmt/core.h ++++ b/include/fmt/core.h +@@ -286,7 +286,7 @@ + + // Enable minimal optimizations for more compact code in debug mode. + FMT_GCC_PRAGMA("GCC push_options") +-#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) ++#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) && !defined(__CUDACC__) + FMT_GCC_PRAGMA("GCC optimize(\"Og\")") + #endif + diff --git a/rapids-cmake/cpm/versions.json b/rapids-cmake/cpm/versions.json index 7bfc608c..d1a7dcbc 100644 --- a/rapids-cmake/cpm/versions.json +++ b/rapids-cmake/cpm/versions.json @@ -15,7 +15,14 @@ "fmt" : { "version" : "9.1.0", "git_url" : "https://github.com/fmtlib/fmt.git", - "git_tag" : "${version}" + "git_tag" : "${version}", + "patches" : [ + { + "file" : "fmt/no_debug_warnings.diff", + "issue" : "No warnings during debug builds [https://github.com/fmtlib/fmt/issues/3351]", + "fixed_in" : "10.0" + } + ] }, "GTest" : { "version" : "1.13.0", From 05a37e19518a92fa9776f70ad4b5862fe6bc8830 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Sep 2023 15:18:40 -0500 Subject: [PATCH 02/17] Use `conda mambabuild` not `mamba mambabuild` (#457) With the release of conda 23.7.3, `mamba mambabuild` stopped working. With boa installed, `conda mambabuild` uses the mamba solver, so just use that instead. See also https://github.com/rapidsai/cudf/issues/14068. Authors: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/rapids-cmake/pull/457 --- ci/build_cpp.sh | 2 +- dependencies.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 1daef26b..335fa54c 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -11,6 +11,6 @@ rapids-print-env rapids-logger "Begin cpp build" -rapids-mamba-retry mambabuild conda/recipes/rapids_core_dependencies +rapids-conda-retry mambabuild conda/recipes/rapids_core_dependencies rapids-upload-conda-to-s3 cpp diff --git a/dependencies.yaml b/dependencies.yaml index 9c6f20e5..fca7f1b0 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -132,7 +132,7 @@ dependencies: packages: - pip - pip: - - sphinxcontrib-moderncmakedomain + - sphinxcontrib-moderncmakedomain - sphinx - sphinx-copybutton - sphinx_rtd_theme @@ -145,6 +145,9 @@ dependencies: - scikit-build>=0.13.1 - libpng - zlib + - output_types: [conda] + packages: + - fmt==9.1.0 style_checks: common: - output_types: [conda, requirements] From bed21c2563820d3298537f37f57135a6057b1673 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 Sep 2023 14:21:25 -0500 Subject: [PATCH 03/17] Update to clang 16.0.6. (#459) This PR updates rapids-cmake to use clang 16.0.6. The previous version 16.0.1 has some minor formatting issues affecting several RAPIDS repos. Authors: - Bradley Dice (https://github.com/bdice) Approvers: None URL: https://github.com/rapidsai/rapids-cmake/pull/459 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96462e88..8369d5dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: ) - id: check-json - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v16.0.1 + rev: v16.0.6 hooks: - id: clang-format types_or: [c, c++, cuda] From 591117c062ee2167b817820d3b0c85d6ce065743 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 20 Sep 2023 08:29:20 -0400 Subject: [PATCH 04/17] cpm overrides don't occur when `CPM__SOURCE` exists (#458) Since the rapids-cmake cpm overrides hook into fetch content they previously would take priority over `CPM__SOURCE`. Now we don't add overrides when `CPM__SOURCE` exists. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/rapids-cmake/pull/458 --- rapids-cmake/cpm/package_override.cmake | 12 +++- testing/cpm/CMakeLists.txt | 1 + ...package_override-obey-cpm-source-var.cmake | 64 +++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 testing/cpm/cpm_package_override-obey-cpm-source-var.cmake diff --git a/rapids-cmake/cpm/package_override.cmake b/rapids-cmake/cpm/package_override.cmake index a70dd728..2cf87ec5 100644 --- a/rapids-cmake/cpm/package_override.cmake +++ b/rapids-cmake/cpm/package_override.cmake @@ -49,12 +49,18 @@ projects. .. note:: + .. versionadded:: v23.10.00 + + When the variable `CPM__SOURCE` exists, any override entries + for `package_name` will be ignored. + + +.. note:: If the override file doesn't specify a value or package entry the default version will be used. Must be called before any invocation of :cmake:command:`rapids_cpm_find`. - #]=======================================================================] function(rapids_cpm_package_override filepath) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_cpm_package_override") @@ -74,10 +80,10 @@ function(rapids_cpm_package_override filepath) # cmake-lint: disable=E1120 foreach(index RANGE ${package_count}) string(JSON package_name MEMBER "${json_data}" packages ${index}) - string(JSON data GET "${json_data}" packages "${package_name}") get_property(override_exists GLOBAL PROPERTY rapids_cpm_${package_name}_override_json DEFINED) - if(NOT override_exists) + if(NOT (override_exists OR DEFINED CPM_${package_name}_SOURCE)) # only add the first override for a project we encounter + string(JSON data GET "${json_data}" packages "${package_name}") set_property(GLOBAL PROPERTY rapids_cpm_${package_name}_override_json "${data}") set_property(GLOBAL PROPERTY rapids_cpm_${package_name}_override_json_file "${filepath}") endif() diff --git a/testing/cpm/CMakeLists.txt b/testing/cpm/CMakeLists.txt index b8e66ac1..c570d5c1 100644 --- a/testing/cpm/CMakeLists.txt +++ b/testing/cpm/CMakeLists.txt @@ -34,6 +34,7 @@ add_cmake_config_test( cpm_package_override-bad-path.cmake SHOULD_FAIL "rapids_c add_cmake_config_test( cpm_package_override-before-init.cmake ) add_cmake_config_test( cpm_package_override-empty.cmake ) add_cmake_config_test( cpm_package_override-multiple.cmake ) +add_cmake_config_test( cpm_package_override-obey-cpm-source-var.cmake ) add_cmake_config_test( cpm_package_override-patches.cmake ) add_cmake_config_test( cpm_package_override-simple.cmake ) diff --git a/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake b/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake new file mode 100644 index 00000000..ab10e855 --- /dev/null +++ b/testing/cpm/cpm_package_override-obey-cpm-source-var.cmake @@ -0,0 +1,64 @@ +#============================================================================= +# Copyright (c) 2021-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. +#============================================================================= +include(${rapids-cmake-dir}/cpm/init.cmake) +include(${rapids-cmake-dir}/cpm/package_override.cmake) + +rapids_cpm_init() + +# Need to write out an override file +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json + [=[ +{ + "packages" : { + "rmm" : { + "git_url" : "new_rmm_url", + "git_shallow" : "OFF", + "exclude_from_all" : "ON" + }, + "not_in_base" : { + "git_url" : "new_rmm_url", + "git_shallow" : "OFF", + "exclude_from_all" : "ON" + } + } +} + ]=]) + +set(CPM_rmm_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") +set(CPM_not_in_base_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") +rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) + +# Verify that the override doesn't exist due to `CPM_rmm_SOURCE` +include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") + +rapids_cpm_package_details(rmm version repository tag shallow exclude) +if(repository MATCHES "new_rmm_url") + message(FATAL_ERROR "custom url field should not be set, due to CPM_rmm_SOURCE") +endif() +if(shallow MATCHES "OFF") + message(FATAL_ERROR "shallow field should not be set, due to CPM_rmm_SOURCE") +endif() +if(CPM_DOWNLOAD_ALL) + message(FATAL_ERROR "CPM_DOWNLOAD_ALL should not be set, due to CPM_rmm_SOURCE") +endif() + +unset(version) +unset(repository) +unset(tag) +rapids_cpm_package_details(not_in_base version repository tag shallow exclude) +if(version OR repository OR tag) + message(FATAL_ERROR "rapids_cpm_package_details should not return anything for package that doesn't exist") +endif() From d34d98944c99fa170f266a4df7eafb7ed32adf9f Mon Sep 17 00:00:00 2001 From: Paul Taylor <178183+trxcllnt@users.noreply.github.com> Date: Thu, 21 Sep 2023 05:39:53 -0700 Subject: [PATCH 05/17] Update to CPM v0.38.5 (#460) Update to CPM [v0.38.5](https://github.com/cpm-cmake/CPM.cmake/releases/tag/v0.38.5). Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - Robert Maynard (https://github.com/robertmaynard) URL: https://github.com/rapidsai/rapids-cmake/pull/460 --- rapids-cmake/cpm/detail/download.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapids-cmake/cpm/detail/download.cmake b/rapids-cmake/cpm/detail/download.cmake index a1ca4119..1f67704d 100644 --- a/rapids-cmake/cpm/detail/download.cmake +++ b/rapids-cmake/cpm/detail/download.cmake @@ -42,8 +42,8 @@ function(rapids_cpm_download) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.download") # When changing version verify no new variables needs to be propagated - set(CPM_DOWNLOAD_VERSION 0.35.6) - set(CPM_DOWNLOAD_MD5_HASH c15cd4b7f511bc625c92ee6580821726) + set(CPM_DOWNLOAD_VERSION 0.38.5) + set(CPM_DOWNLOAD_MD5_HASH c98d14a13dfd1952e115979c095f6794) if(CPM_SOURCE_CACHE) # Expand relative path. This is important if the provided path contains a tilde (~) From 94fe5e06c34ab07a1fd71559d5a3d22c4b76a84f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 21 Sep 2023 09:07:28 -0400 Subject: [PATCH 06/17] Move rapids_cpm_package_override to CPM section of docs (#462) Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/rapids-cmake/pull/462 --- docs/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 6612f609..a2779df6 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -33,6 +33,7 @@ tracking of these dependencies for correct export support. /command/rapids_cpm_init /command/rapids_cpm_find + /command/rapids_cpm_package_override CPM Pre-Configured Packages *************************** @@ -57,7 +58,6 @@ package uses :ref:`can be found here. ` /packages/rapids_cpm_rmm /packages/rapids_cpm_spdlog /packages/rapids_cpm_thrust - /command/rapids_cpm_package_override .. _`cython`: From 59328e33347325f78f8358f86932c21b0d1c6f8b Mon Sep 17 00:00:00 2001 From: Jake Awe <50372925+AyodeAwe@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:53:03 -0500 Subject: [PATCH 07/17] Update image names (#461) PR updates `rapidsai/ci` references to `rapidsai/ci-conda` Authors: - Jake Awe (https://github.com/AyodeAwe) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/rapids-cmake/pull/461 --- .github/workflows/build.yaml | 2 +- .github/workflows/pr.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5971444b..619c06c6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -51,7 +51,7 @@ jobs: arch: "amd64" branch: ${{ inputs.branch }} build_type: ${{ inputs.build_type || 'branch' }} - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci-conda:latest" date: ${{ inputs.date }} node_type: "cpu4" run_script: "ci/build_docs.sh" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d4979eb4..99d0220e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -41,5 +41,5 @@ jobs: build_type: pull-request node_type: "cpu4" arch: "amd64" - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci-conda:latest" run_script: "ci/build_docs.sh" From c6746ecf073348b192ac0cc754dc8d3b7b5de7a9 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Fri, 22 Sep 2023 09:45:41 -0400 Subject: [PATCH 08/17] v23.12 Updates [skip ci] --- .github/workflows/build.yaml | 6 +++--- .github/workflows/pr.yaml | 10 +++++----- .github/workflows/test.yaml | 2 +- RAPIDS.cmake | 2 +- ci/build_docs.sh | 2 +- docs/basics.rst | 4 ++-- docs/conf.py | 4 ++-- rapids-cmake/rapids-version.cmake | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 619c06c6..f807b91d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -37,7 +37,7 @@ jobs: upload-conda: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -46,7 +46,7 @@ jobs: docs-build: if: github.ref_type == 'branch' secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 with: arch: "amd64" branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 99d0220e..8105141c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -17,26 +17,26 @@ jobs: - conda-cpp-tests - docs-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.12 checks: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.12 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 with: build_type: pull-request conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 with: build_type: pull-request docs-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 with: build_type: pull-request node_type: "cpu4" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 38b565a4..6c02a92f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: cpp-tests: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.10 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/RAPIDS.cmake b/RAPIDS.cmake index 78bcab75..157075f3 100644 --- a/RAPIDS.cmake +++ b/RAPIDS.cmake @@ -20,7 +20,7 @@ # Allow users to control which version is used if(NOT rapids-cmake-version) # Define a default version if the user doesn't set one - set(rapids-cmake-version 23.10) + set(rapids-cmake-version 23.12) endif() # Allow users to control which GitHub repo is fetched diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 892adbfb..531f7e72 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -16,7 +16,7 @@ conda activate docs rapids-print-env -export RAPIDS_VERSION_NUMBER="23.10" +export RAPIDS_VERSION_NUMBER="23.12" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build Sphinx docs" diff --git a/docs/basics.rst b/docs/basics.rst index 8cd89afd..7927c17b 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -13,7 +13,7 @@ Content `_ into yo cmake_minimum_required(...) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/_RAPIDS.cmake) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/_RAPIDS.cmake) endif() include(${CMAKE_CURRENT_BINARY_DIR}/_RAPIDS.cmake) @@ -58,7 +58,7 @@ like this: GIT_REPOSITORY https://github.com//rapids-cmake.git GIT_TAG ) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake) include(${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake) diff --git a/docs/conf.py b/docs/conf.py index fc0db2d0..c02b749c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,9 +25,9 @@ # built documents. # # The short X.Y version. -version = "23.10" +version = "23.12" # The full version, including alpha/beta/rc tags. -release = "23.10.00" +release = "23.12.00" # -- General configuration --------------------------------------------------- diff --git a/rapids-cmake/rapids-version.cmake b/rapids-cmake/rapids-version.cmake index 6d114d83..94024b14 100644 --- a/rapids-cmake/rapids-version.cmake +++ b/rapids-cmake/rapids-version.cmake @@ -17,5 +17,5 @@ # that breaks its usage by cpm/detail/package_details if(NOT DEFINED rapids-cmake-version) - set(rapids-cmake-version 23.10) + set(rapids-cmake-version 23.12) endif() From f51861eaa6e2ddcd75075074eb54b23b49052e5a Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Tue, 26 Sep 2023 11:39:15 -0700 Subject: [PATCH 09/17] Quote the list of patch files in case they have spaces in their paths (#463) The rapids cpm scripts fail when populating a dependency with patches if the build directory contains spaces in its path name. The reason is because the paths are not properly quoted in the cmake patch script generated from `command_template.cmake.in`. This PR properly quotes the list of patch file names. Authors: - Eric Niebler (https://github.com/ericniebler) - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/rapids-cmake/pull/463 --- rapids-cmake/cpm/patches/command_template.cmake.in | 2 +- .../cpm_generate_patch_command-current_json_dir.cmake | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rapids-cmake/cpm/patches/command_template.cmake.in b/rapids-cmake/cpm/patches/command_template.cmake.in index 8f5393b0..76980b9e 100644 --- a/rapids-cmake/cpm/patches/command_template.cmake.in +++ b/rapids-cmake/cpm/patches/command_template.cmake.in @@ -68,7 +68,7 @@ function(rapids_cpm_run_git_patch file issue) set(msg_state ${msg_state} PARENT_SCOPE) endfunction() -set(files @patch_files_to_run@) +set(files "@patch_files_to_run@") set(issues "@patch_issues_to_ref@") set(output_file "@log_file@") foreach(file issue IN ZIP_LISTS files issues) diff --git a/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake b/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake index 5d77d8f1..5cb74788 100644 --- a/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake +++ b/testing/cpm/cpm_generate_patch_command-current_json_dir.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2022, NVIDIA CORPORATION. +# 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. @@ -38,6 +38,11 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json "file" : "${current_json_dir}/example.diff", "issue" : "explain", "fixed_in" : "" + }, + { + "file" : "${current_json_dir}/example2.diff", + "issue" : "explain", + "fixed_in" : "" } ] } @@ -51,7 +56,7 @@ if(NOT patch_command) message(FATAL_ERROR "rapids_cpm_package_override specified a patch step for `pkg_with_patch`") endif() -set(to_match_string "set(files ${CMAKE_CURRENT_BINARY_DIR}/example.diff)") +set(to_match_string "set(files \"${CMAKE_CURRENT_BINARY_DIR}/example.diff;${CMAKE_CURRENT_BINARY_DIR}/example2.diff\")") list(POP_BACK patch_command script_to_run) file(READ "${script_to_run}" contents) From 9214ee34921eba69e611e5dca205f32b64ef579e Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 2 Oct 2023 19:21:01 -0500 Subject: [PATCH 10/17] Build CUDA 12.0 ARM conda packages. (#468) This PR builds conda packages using CUDA 12 on ARM. Closes #469. 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/rapids-cmake/pull/468 --- .github/workflows/build.yaml | 6 +++--- .github/workflows/pr.yaml | 10 +++++----- .github/workflows/test.yaml | 2 +- RAPIDS.cmake | 2 +- .../cuda/detail/invoke_set_all_architectures.cmake | 2 +- rapids-cmake/rapids-version.cmake | 2 +- testing/cuda/init_arch-all-via-undef/CMakeLists.txt | 2 +- testing/cuda/init_arch-rapids.cmake | 2 +- testing/cuda/set_arch-rapids.cmake | 2 +- testing/cuda/validate-cuda-rapids.cmake | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f807b91d..4e2b078b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120-arm with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -37,7 +37,7 @@ jobs: upload-conda: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@cuda-120-arm with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -46,7 +46,7 @@ jobs: docs-build: if: github.ref_type == 'branch' secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120-arm with: arch: "amd64" branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8105141c..f1b363de 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -17,26 +17,26 @@ jobs: - conda-cpp-tests - docs-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@cuda-120-arm checks: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@cuda-120-arm conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120-arm with: build_type: pull-request conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120-arm with: build_type: pull-request docs-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120-arm with: build_type: pull-request node_type: "cpu4" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6c02a92f..ba061ca2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: cpp-tests: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120-arm with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/RAPIDS.cmake b/RAPIDS.cmake index 157075f3..2b978813 100644 --- a/RAPIDS.cmake +++ b/RAPIDS.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake b/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake index c51ebf3e..25d8f930 100644 --- a/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake +++ b/rapids-cmake/cuda/detail/invoke_set_all_architectures.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/rapids-cmake/rapids-version.cmake b/rapids-cmake/rapids-version.cmake index 94024b14..e0b5253d 100644 --- a/rapids-cmake/rapids-version.cmake +++ b/rapids-cmake/rapids-version.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/testing/cuda/init_arch-all-via-undef/CMakeLists.txt b/testing/cuda/init_arch-all-via-undef/CMakeLists.txt index f91aa583..1c9a274b 100644 --- a/testing/cuda/init_arch-all-via-undef/CMakeLists.txt +++ b/testing/cuda/init_arch-all-via-undef/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/testing/cuda/init_arch-rapids.cmake b/testing/cuda/init_arch-rapids.cmake index f425b47b..06cf7525 100644 --- a/testing/cuda/init_arch-rapids.cmake +++ b/testing/cuda/init_arch-rapids.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/testing/cuda/set_arch-rapids.cmake b/testing/cuda/set_arch-rapids.cmake index 726bdfbe..bcc54b0a 100644 --- a/testing/cuda/set_arch-rapids.cmake +++ b/testing/cuda/set_arch-rapids.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. diff --git a/testing/cuda/validate-cuda-rapids.cmake b/testing/cuda/validate-cuda-rapids.cmake index 51972753..b1a52c9b 100644 --- a/testing/cuda/validate-cuda-rapids.cmake +++ b/testing/cuda/validate-cuda-rapids.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. From 3bc1394f5b89d7ebd69c0b04b66184fa30224922 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 9 Oct 2023 14:05:20 -0400 Subject: [PATCH 11/17] Thrust when exported now automatically calls `thrust_create_target` (#467) Instead of having each consuming project inject a code block into the `project-config.cmake` we instead have rapids-cmake call `thrust_create_target` right after `find_package(Thrust)`, only when thrust was found. This fixes two existing issues: 1. It removes the need for `rapids_cpm_thrust` to remove the the custom Thrust target from the global target set. Now that target will exist when rapids-cmake tries to promote it to global 2. It removes issues when multiple calls to `find_package(thrust)` occur before any calls to `thrust_create_target`. This creates some vexing issues when the thrust find calls resolve to different major versions of thrust Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/rapids-cmake/pull/467 --- cmake-format-rapids-cmake.json | 12 ++- rapids-cmake/cpm/libcudacxx.cmake | 12 +-- rapids-cmake/cpm/nvcomp.cmake | 8 +- rapids-cmake/cpm/thrust.cmake | 44 ++++------ .../detail/post_find_package_code.cmake | 84 +++++++++++++++++++ rapids-cmake/export/find_package_file.cmake | 34 +++++++- rapids-cmake/export/find_package_root.cmake | 34 +++++++- rapids-cmake/export/write_dependencies.cmake | 21 +++-- testing/cpm/CMakeLists.txt | 1 + testing/cpm/cpm_thrust-export.cmake | 12 +-- .../CMakeLists.txt | 63 ++++++++++++++ testing/export/CMakeLists.txt | 12 ++- .../export_package-build-post-find-code.cmake | 38 +++++++++ ...xport_package-install-post-find-code.cmake | 39 +++++++++ .../export/find_package_file-deprecated.cmake | 20 +++++ .../export/find_package_root-deprecated.cmake | 20 +++++ .../export/write_dependencies-root-dirs.cmake | 8 +- 17 files changed, 393 insertions(+), 69 deletions(-) create mode 100644 rapids-cmake/export/detail/post_find_package_code.cmake create mode 100644 testing/cpm/cpm_thrust-verify-post-find-code/CMakeLists.txt create mode 100644 testing/export/export_package-build-post-find-code.cmake create mode 100644 testing/export/export_package-install-post-find-code.cmake create mode 100644 testing/export/find_package_file-deprecated.cmake create mode 100644 testing/export/find_package_root-deprecated.cmake diff --git a/cmake-format-rapids-cmake.json b/cmake-format-rapids-cmake.json index d57f9fa2..a508e44f 100644 --- a/cmake-format-rapids-cmake.json +++ b/cmake-format-rapids-cmake.json @@ -230,14 +230,22 @@ }, "rapids_export_find_package_file": { "pargs": { - "nargs": 3, + "nargs": "3+", "flags": ["INSTALL", "BUILD"] + }, + "kwargs": { + "EXPORT_SET": 1, + "CONDITION": 1 } }, "rapids_export_find_package_root": { "pargs": { - "nargs": 4, + "nargs": "3+", "flags": ["INSTALL", "BUILD"] + }, + "kwargs": { + "EXPORT_SET": 1, + "CONDITION": 1 } }, "rapids_export_package": { diff --git a/rapids-cmake/cpm/libcudacxx.cmake b/rapids-cmake/cpm/libcudacxx.cmake index 6279adf8..3b775d28 100644 --- a/rapids-cmake/cpm/libcudacxx.cmake +++ b/rapids-cmake/cpm/libcudacxx.cmake @@ -101,18 +101,14 @@ function(rapids_cpm_libcudacxx) set(multi_value) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) - if(libcudacxx_SOURCE_DIR AND _RAPIDS_BUILD_EXPORT_SET) + if(libcudacxx_SOURCE_DIR) # Store where CMake can find our custom libcudacxx include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD libcudacxx "${libcudacxx_SOURCE_DIR}/lib/cmake" - ${_RAPIDS_BUILD_EXPORT_SET}) - endif() - - if(libcudacxx_SOURCE_DIR AND to_install) - include("${rapids-cmake-dir}/export/find_package_root.cmake") + rapids_export_find_package_root(BUILD libcudacxx "${libcudacxx_SOURCE_DIR}/lib/cmake" FOR + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET}) rapids_export_find_package_root(INSTALL libcudacxx [=[${CMAKE_CURRENT_LIST_DIR}/../../rapids/cmake/libcudacxx]=] - ${_RAPIDS_INSTALL_EXPORT_SET}) + EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install) endif() # Propagate up variables that CPMFindPackage provide diff --git a/rapids-cmake/cpm/nvcomp.cmake b/rapids-cmake/cpm/nvcomp.cmake index eea96038..4f8c669b 100644 --- a/rapids-cmake/cpm/nvcomp.cmake +++ b/rapids-cmake/cpm/nvcomp.cmake @@ -173,9 +173,9 @@ function(rapids_cpm_nvcomp) install(FILES "${nvcomp_ROOT}/LICENSE" DESTINATION info/ RENAME NVCOMP_LICENSE) endif() - if(_RAPIDS_BUILD_EXPORT_SET AND nvcomp_proprietary_binary) - # point our consumers to where they can find the pre-built version - rapids_export_find_package_root(BUILD nvcomp "${nvcomp_ROOT}" ${_RAPIDS_BUILD_EXPORT_SET}) - endif() + # point our consumers to where they can find the pre-built version + rapids_export_find_package_root(BUILD nvcomp "${nvcomp_ROOT}" + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET} + CONDITION nvcomp_proprietary_binary) endfunction() diff --git a/rapids-cmake/cpm/thrust.cmake b/rapids-cmake/cpm/thrust.cmake index 7e9f923c..04d453b1 100644 --- a/rapids-cmake/cpm/thrust.cmake +++ b/rapids-cmake/cpm/thrust.cmake @@ -40,6 +40,13 @@ across all RAPIDS projects. .. |PKG_NAME| replace:: Thrust .. include:: common_package_args.txt +.. versionadded:: v23.12.00 + When `BUILD_EXPORT_SET` is specified the generated build export set dependency + file will automatically call `thrust_create_target(::Thrust FROM_OPTIONS)`. + + When `INSTALL_EXPORT_SET` is specified the generated install export set dependency + file will automatically call `thrust_create_target(::Thrust FROM_OPTIONS)`. + Result Targets ^^^^^^^^^^^^^^ ::Thrust target will be created @@ -90,18 +97,23 @@ function(rapids_cpm_thrust NAMESPACE namespaces_name) set(multi_value) cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) - if(Thrust_SOURCE_DIR AND _RAPIDS_BUILD_EXPORT_SET) + set(post_find_code "if(NOT TARGET ${namespaces_name}::Thrust)" + " thrust_create_target(${namespaces_name}::Thrust FROM_OPTIONS)" "endif()") + + if(Thrust_SOURCE_DIR) # Store where CMake can find the Thrust-config.cmake that comes part of Thrust source code include("${rapids-cmake-dir}/export/find_package_root.cmake") + include("${rapids-cmake-dir}/export/detail/post_find_package_code.cmake") rapids_export_find_package_root(BUILD Thrust "${Thrust_SOURCE_DIR}/cmake" - ${_RAPIDS_BUILD_EXPORT_SET}) - endif() + EXPORT_SET ${_RAPIDS_BUILD_EXPORT_SET}) + rapids_export_post_find_package_code(BUILD Thrust "${post_find_code}" EXPORT_SET + ${_RAPIDS_BUILD_EXPORT_SET}) - if(Thrust_SOURCE_DIR AND _RAPIDS_INSTALL_EXPORT_SET AND to_install) - include("${rapids-cmake-dir}/export/find_package_root.cmake") rapids_export_find_package_root(INSTALL Thrust [=[${CMAKE_CURRENT_LIST_DIR}/../../rapids/cmake/thrust]=] - ${_RAPIDS_INSTALL_EXPORT_SET}) + EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install) + rapids_export_post_find_package_code(INSTALL Thrust "${post_find_code}" EXPORT_SET + ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install) endif() # Check for the existence of thrust_create_target so we support fetching Thrust with DOWNLOAD_ONLY @@ -113,26 +125,6 @@ function(rapids_cpm_thrust NAMESPACE namespaces_name) endif() endif() - # Since `GLOBAL_TARGET ${namespaces_name}::Thrust` will list the target to be promoted to global - # by `rapids_export` this will break consumers as the target doesn't exist when generating the - # dependencies.cmake file, but requires a call to `thrust_create_target` - # - # So determine what `BUILD_EXPORT_SET` and `INSTALL_EXPORT_SET` this was added to and remove - # ${namespaces_name}::Thrust - if(_RAPIDS_BUILD_EXPORT_SET) - set(target_name rapids_export_build_${_RAPIDS_BUILD_EXPORT_SET}) - get_target_property(global_targets ${target_name} GLOBAL_TARGETS) - list(REMOVE_ITEM global_targets "${namespaces_name}::Thrust") - set_target_properties(${target_name} PROPERTIES GLOBAL_TARGETS "${global_targets}") - endif() - - if(_RAPIDS_INSTALL_EXPORT_SET) - set(target_name rapids_export_install_${_RAPIDS_INSTALL_EXPORT_SET}) - get_target_property(global_targets ${target_name} GLOBAL_TARGETS) - list(REMOVE_ITEM global_targets "${namespaces_name}::Thrust") - set_target_properties(${target_name} PROPERTIES GLOBAL_TARGETS "${global_targets}") - endif() - # Propagate up variables that CPMFindPackage provide set(Thrust_SOURCE_DIR "${Thrust_SOURCE_DIR}" PARENT_SCOPE) set(Thrust_BINARY_DIR "${Thrust_BINARY_DIR}" PARENT_SCOPE) diff --git a/rapids-cmake/export/detail/post_find_package_code.cmake b/rapids-cmake/export/detail/post_find_package_code.cmake new file mode 100644 index 00000000..dc44630a --- /dev/null +++ b/rapids-cmake/export/detail/post_find_package_code.cmake @@ -0,0 +1,84 @@ +#============================================================================= +# 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. +#============================================================================= +include_guard(GLOBAL) + +#[=======================================================================[.rst: +rapids_export_post_find_package_code +------------------------------------ + +.. versionadded:: v23.12.00 + +Record for a set of CMake instructions to be executed after the package +has been found successfully. + +.. code-block:: cmake + + rapids_export_post_find_package_code((BUILD|INSTALL) + + + EXPORT_SET [ExportSetName] + [CONDITION ] + ) + +When using complicated find modules like `Thrust` you might need to run some code after +execution. Multiple calls to :cmake:command:`rapids_export_post_find_package_code` will append the +instructions to execute in call order. + +.. note: + The code will only be run if the package was found + +``BUILD`` + Record code to be executed immediately after `PackageName` has been found + for our our build directory export set. + +``INSTALL`` + Record code to be executed immediately after `PackageName` has been found + for our our install directory export set. + +``EXPORT_SET`` + List the export set name that this code should be attached too. If + no name is given the associated call will be ignored. + +``CONDITION`` + A boolean variable name, that when evaluates to undefined or a false value + will cause the associated call to be ignored. + +#]=======================================================================] +function(rapids_export_post_find_package_code type name code) + list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.post_find_package_code") + + set(options "") + set(one_value EXPORT_SET CONDITION) + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) + # Early terminate conditions + if(NOT _RAPIDS_EXPORT_SET OR NOT ${_RAPIDS_CONDITION}) + return() + endif() + + string(TOLOWER ${type} type) + set(export_set ${_RAPIDS_EXPORT_SET}) + + if(NOT TARGET rapids_export_${type}_${export_set}) + add_library(rapids_export_${type}_${export_set} INTERFACE) + endif() + + # if the code coming in is a list of string we will have `;`, so transform those to "\n" so we + # have a single string + string(REPLACE ";" "\n" code "${code}") + set_property(TARGET rapids_export_${type}_${export_set} APPEND_STRING + PROPERTY "${name}_POST_FIND_CODE" "${code}\n") +endfunction() diff --git a/rapids-cmake/export/find_package_file.cmake b/rapids-cmake/export/find_package_file.cmake index ed997885..c4b93257 100644 --- a/rapids-cmake/export/find_package_file.cmake +++ b/rapids-cmake/export/find_package_file.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -28,7 +28,8 @@ the associated export set. rapids_export_find_package_file( (BUILD|INSTALL) - + ( | EXPORT_SET [ExportSetName]) + [CONDITION ] ) When constructing export sets, espically installed ones it is @@ -50,11 +51,38 @@ rapids-cmake to ensure it is installed correct and added to of our install export set. This means that it will be installed as part of our packages CMake export set infrastructure +``EXPORT_SET`` + List the export set name that this code should be attached too. If + no name is given the associated call will be ignored. + +``CONDITION`` + A boolean variable name, that when evaluates to undefined or a false value + will cause the associated call to be ignored. + #]=======================================================================] -function(rapids_export_find_package_file type file_path export_set) +function(rapids_export_find_package_file type file_path) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.find_package_file") + include("${rapids-cmake-dir}/cmake/detail/policy.cmake") + + set(options "") + set(one_value EXPORT_SET CONDITION) + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) + # handle when we are given just an export set name and not `EXPORT_SET ` + if(_RAPIDS_UNPARSED_ARGUMENTS AND NOT _RAPIDS_COMPONENTS_EXPORT_SET) + rapids_cmake_policy(DEPRECATED_IN 23.12 + REMOVED_IN 24.02 + MESSAGE [=[Usage of `rapids_export_find_package_file` without an explicit `EXPORT_SET` key has been deprecated.]=] + ) + set(_RAPIDS_EXPORT_SET ${_RAPIDS_UNPARSED_ARGUMENTS}) + endif() + # Early terminate conditions + if(NOT _RAPIDS_EXPORT_SET OR NOT ${_RAPIDS_CONDITION}) + return() + endif() string(TOLOWER ${type} type) + set(export_set ${_RAPIDS_EXPORT_SET}) if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) diff --git a/rapids-cmake/export/find_package_root.cmake b/rapids-cmake/export/find_package_root.cmake index e924084b..71deffa3 100644 --- a/rapids-cmake/export/find_package_root.cmake +++ b/rapids-cmake/export/find_package_root.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -29,7 +29,8 @@ needs to be set to the provided path. rapids_export_find_package_root( (BUILD|INSTALL) - + ( | EXPORT_SET [ExportSetName]) + [CONDITION ] ) When constructing complicated export sets, espically ones that @@ -47,11 +48,38 @@ will find the packaged dependency. before any find_dependency calls for `PackageName` for our install directory export set. +``EXPORT_SET`` + List the export set name that the `directory_path` should be attached too. If + no name is given the associated call will be ignored. + +``CONDITION`` + A boolean variable name, that when evaluates to undefined or a false value + will cause the associated call to be ignored. + #]=======================================================================] -function(rapids_export_find_package_root type name dir_path export_set) +function(rapids_export_find_package_root type name dir_path) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.find_package_root_dir") + include("${rapids-cmake-dir}/cmake/detail/policy.cmake") + + set(options "") + set(one_value EXPORT_SET CONDITION) + set(multi_value "") + cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN}) + # handle when we are given just an export set name and not `EXPORT_SET ` + if(_RAPIDS_UNPARSED_ARGUMENTS AND NOT _RAPIDS_COMPONENTS_EXPORT_SET) + rapids_cmake_policy(DEPRECATED_IN 23.12 + REMOVED_IN 24.02 + MESSAGE [=[Usage of `rapids_export_find_package_root` without an explicit `EXPORT_SET` key has been deprecated.]=] + ) + set(_RAPIDS_EXPORT_SET ${_RAPIDS_UNPARSED_ARGUMENTS}) + endif() + # Early terminate conditions + if(NOT _RAPIDS_EXPORT_SET OR NOT ${_RAPIDS_CONDITION}) + return() + endif() string(TOLOWER ${type} type) + set(export_set ${_RAPIDS_EXPORT_SET}) if(NOT TARGET rapids_export_${type}_${export_set}) add_library(rapids_export_${type}_${export_set} INTERFACE) diff --git a/rapids-cmake/export/write_dependencies.cmake b/rapids-cmake/export/write_dependencies.cmake index 4f90b2d7..6080f481 100644 --- a/rapids-cmake/export/write_dependencies.cmake +++ b/rapids-cmake/export/write_dependencies.cmake @@ -42,6 +42,7 @@ a given export_set for the requested mode. CMake config module. #]=======================================================================] +# cmake-lint: disable=R0915 function(rapids_export_write_dependencies type export_set file_path) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.export.write_dependencies") @@ -88,14 +89,12 @@ endif()\n") endif() endif() - if(find_root_dirs) - foreach(package IN LISTS find_root_dirs) - get_property(root_dir_path TARGET rapids_export_${type}_${export_set} - PROPERTY "FIND_ROOT_FOR_${package}") - set(dep_content "set(${package}_ROOT \"${root_dir_path}\")") - string(APPEND _RAPIDS_EXPORT_CONTENTS "${dep_content}\n") - endforeach() - endif() + foreach(package IN LISTS find_root_dirs) + get_property(root_dir_path TARGET rapids_export_${type}_${export_set} + PROPERTY "FIND_ROOT_FOR_${package}") + set(dep_content "set(${package}_ROOT \"${root_dir_path}\")") + string(APPEND _RAPIDS_EXPORT_CONTENTS "${dep_content}\n") + endforeach() if(find_modules) cmake_path(GET file_path PARENT_PATH find_module_dest) @@ -116,6 +115,12 @@ endif()\n") file(READ "${dep_dir}/package_${dep}.cmake" dep_content) endif() string(APPEND _RAPIDS_EXPORT_CONTENTS "${dep_content}\n") + + get_property(post_find_code TARGET rapids_export_${type}_${export_set} + PROPERTY "${dep}_POST_FIND_CODE") + if(post_find_code) + string(APPEND _RAPIDS_EXPORT_CONTENTS "if(${dep}_FOUND)\n${post_find_code}\nendif()\n") + endif() endforeach() string(APPEND _RAPIDS_EXPORT_CONTENTS "\n") diff --git a/testing/cpm/CMakeLists.txt b/testing/cpm/CMakeLists.txt index c570d5c1..fd5112f8 100644 --- a/testing/cpm/CMakeLists.txt +++ b/testing/cpm/CMakeLists.txt @@ -88,3 +88,4 @@ add_cmake_config_test( cpm_spdlog-simple.cmake ) add_cmake_config_test( cpm_thrust-export.cmake ) add_cmake_config_test( cpm_thrust-simple.cmake ) +add_cmake_build_test( cpm_thrust-verify-post-find-code ) diff --git a/testing/cpm/cpm_thrust-export.cmake b/testing/cpm/cpm_thrust-export.cmake index 1727b374..5a7dae77 100644 --- a/testing/cpm/cpm_thrust-export.cmake +++ b/testing/cpm/cpm_thrust-export.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -30,13 +30,3 @@ get_target_property(packages rapids_export_install_test2 PACKAGE_NAMES) if(NOT Thrust IN_LIST packages) message(FATAL_ERROR "rapids_cpm_thrust failed to record thrust needs to be exported") endif() - -get_target_property(packages rapids_export_build_test GLOBAL_TARGETS) -if(A::Thrust IN_LIST packages) - message(FATAL_ERROR "rapids_cpm_thrust incorrectly added A::Thrust to build GLOBAL_TARGETS") -endif() - -get_target_property(packages rapids_export_install_test2 GLOBAL_TARGETS) -if(B::Thrust IN_LIST packages) - message(FATAL_ERROR "rapids_cpm_thrust incorrectly added B::Thrust to install GLOBAL_TARGETS") -endif() diff --git a/testing/cpm/cpm_thrust-verify-post-find-code/CMakeLists.txt b/testing/cpm/cpm_thrust-verify-post-find-code/CMakeLists.txt new file mode 100644 index 00000000..50451a4a --- /dev/null +++ b/testing/cpm/cpm_thrust-verify-post-find-code/CMakeLists.txt @@ -0,0 +1,63 @@ +#============================================================================= +# 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. +#============================================================================= +cmake_minimum_required(VERSION 3.23.1) +project(rapids-test-project LANGUAGES CXX) + +include(${rapids-cmake-dir}/cpm/init.cmake) +include(${rapids-cmake-dir}/cpm/thrust.cmake) +include(${rapids-cmake-dir}/export/export.cmake) + +set(CMAKE_INSTALL_LIBDIR "lib") + +rapids_cpm_init() + +rapids_cpm_thrust(NAMESPACE RapidsTest + GLOBAL_TARGETS RapidsTest::Thrust + INSTALL_EXPORT_SET example_export_set) + +add_library(fakeLib INTERFACE) +install(TARGETS fakeLib EXPORT example_export_set) +target_link_libraries(fakeLib INTERFACE RapidsTest::Thrust) + +rapids_export(INSTALL fake + EXPORT_SET example_export_set + NAMESPACE test:: + ) + +# Install our project so we can verify `thrust_create_target` is called +# automatically in the export-set +add_custom_target(install_project ALL + COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --prefix install/fake/ + ) + +# Add a custom command that verifies that the expect files have +# been installed for each component +file(WRITE "${CMAKE_BINARY_DIR}/install/CMakeLists.txt" [=[ +cmake_minimum_required(VERSION 3.20) +project(verify_install_targets LANGUAGES CXX) + +set(computed_path "${CMAKE_CURRENT_SOURCE_DIR}/fake/lib/cmake/fake/") +find_package(fake REQUIRED NO_DEFAULT_PATH HINTS ${computed_path}) +if(NOT TARGET RapidsTest::Thrust) + message(FATAL_ERROR "Failed to construct RapidsTest::Thrust target") +endif() +]=]) + +add_custom_target(verify_install_thrust_works ALL + COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_BINARY_DIR}/install/build" + COMMAND ${CMAKE_COMMAND} -S="${CMAKE_BINARY_DIR}/install" -B="${CMAKE_BINARY_DIR}/install/build" +) +add_dependencies(verify_install_thrust_works install_project) diff --git a/testing/export/CMakeLists.txt b/testing/export/CMakeLists.txt index 78d48dc0..4f36b3ae 100644 --- a/testing/export/CMakeLists.txt +++ b/testing/export/CMakeLists.txt @@ -48,16 +48,18 @@ add_cmake_config_test( export-verify-version.cmake ) add_cmake_config_test( export_component-build ) add_cmake_config_test( export_package-build-possible-dir.cmake ) -add_cmake_config_test( export_package-build-with-components.cmake ) +add_cmake_config_test( export_package-build-post-find-code.cmake ) add_cmake_config_test( export_package-build-with-components-and-version.cmake ) +add_cmake_config_test( export_package-build-with-components.cmake ) add_cmake_config_test( export_package-build-with-empty-components.cmake ) add_cmake_config_test( export_package-build-with-version.cmake ) add_cmake_config_test( export_package-build.cmake ) add_cmake_config_test( export_package-install-possible-dir.cmake ) -add_cmake_config_test( export_package-install.cmake ) -add_cmake_config_test( export_package-install-with-components.cmake ) +add_cmake_config_test( export_package-install-post-find-code.cmake ) add_cmake_config_test( export_package-install-with-components-and-version.cmake ) +add_cmake_config_test( export_package-install-with-components.cmake ) add_cmake_config_test( export_package-install-with-version.cmake ) +add_cmake_config_test( export_package-install.cmake ) add_cmake_config_test( export_package-multiple-export_sets.cmake ) add_cmake_config_test( write_dependencies-cpm-preserve-options.cmake ) @@ -69,3 +71,7 @@ add_cmake_config_test( write_dependencies-root-dirs.cmake ) add_cmake_build_test( write_language-multiple-nested-enables ) add_cmake_build_test( write_language-nested-dirs ) + +set(deprecated_message [=[rapids-cmake policy [deprecated=23.12 removed=24.02]: Usage of ]=]) +add_cmake_config_test( find_package_file-deprecated.cmake SHOULD_FAIL "${deprecated_message}") +add_cmake_config_test( find_package_root-deprecated.cmake SHOULD_FAIL "${deprecated_message}") diff --git a/testing/export/export_package-build-post-find-code.cmake b/testing/export/export_package-build-post-find-code.cmake new file mode 100644 index 00000000..0d88e964 --- /dev/null +++ b/testing/export/export_package-build-post-find-code.cmake @@ -0,0 +1,38 @@ +#============================================================================= +# 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. +#============================================================================= +include(${rapids-cmake-dir}/export/package.cmake) +include(${rapids-cmake-dir}/export/detail/post_find_package_code.cmake) + +rapids_export_package( BUILD FAKE_PACKAGE test_export_set VERSION 22.08) +rapids_export_post_find_package_code( BUILD FAKE_PACKAGE "set(a ON)" EXPORT_SET test_export_set) +rapids_export_post_find_package_code( bUILd FAKE_PACKAGE +[=[ +set(b ON) +set(c ON)]=] EXPORT_SET test_export_set) +rapids_export_post_find_package_code(build FAKE_PACKAGE "set(d ON);set(e ON)" EXPORT_SET test_export_set) + +include(${rapids-cmake-dir}/export/write_dependencies.cmake) +rapids_export_write_dependencies(BUILD test_export_set "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") + +set(to_match [=[if(FAKE_PACKAGE_FOUND)_set(a ON)_set(b ON)_set(c ON)_set(d ON)_set(e ON)__endif()]=]) + +file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" contents NEWLINE_CONSUME) +string(REPLACE "\n" "_" contents "${contents}") + +string(FIND "${contents}" "${to_match}" is_found) +if(is_found EQUAL -1) + message(FATAL_ERROR "rapids_export_write_dependencies(BUILD) failed to record rapids_export_post_find_package_code") +endif() diff --git a/testing/export/export_package-install-post-find-code.cmake b/testing/export/export_package-install-post-find-code.cmake new file mode 100644 index 00000000..094c7b7f --- /dev/null +++ b/testing/export/export_package-install-post-find-code.cmake @@ -0,0 +1,39 @@ +#============================================================================= +# 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. +#============================================================================= +include(${rapids-cmake-dir}/export/package.cmake) +include(${rapids-cmake-dir}/export/detail/post_find_package_code.cmake) + +rapids_export_package(INSTALL FAKE_PACKAGE test_export_set VERSION 22.08) +rapids_export_post_find_package_code(INSTALL FAKE_PACKAGE "set(a ON)" EXPORT_SET test_export_set) + +get_target_property(install_code rapids_export_install_test_export_set FAKE_PACKAGE_POST_FIND_CODE) +cmake_language(EVAL CODE "${install_code}") +if(NOT a) + message(FATAL_ERROR "rapids_export_post_find_package_code failed to record first call") +endif() + +include(${rapids-cmake-dir}/export/write_dependencies.cmake) +rapids_export_write_dependencies(INSTALL test_export_set "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") + +set(to_match [=[if(FAKE_PACKAGE_FOUND)_set(a ON)__endif()]=]) + +file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake" contents NEWLINE_CONSUME) +string(REPLACE "\n" "_" contents "${contents}") + +string(FIND "${contents}" "${to_match}" is_found) +if(is_found EQUAL -1) + message(FATAL_ERROR "rapids_export_write_dependencies(INSTALL) failed to record rapids_export_post_find_package_code") +endif() diff --git a/testing/export/find_package_file-deprecated.cmake b/testing/export/find_package_file-deprecated.cmake new file mode 100644 index 00000000..64da1dd5 --- /dev/null +++ b/testing/export/find_package_file-deprecated.cmake @@ -0,0 +1,20 @@ +#============================================================================= +# 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. +#============================================================================= +include(${rapids-cmake-dir}/export/find_package_file.cmake) + +project(rapids-project LANGUAGES CUDA) +set(CMAKE_ERROR_DEPRECATED ON) +rapids_export_find_package_file(BUILD [=[${CMAKE_CURRENT_LIST_DIR}/fake/build/path]=] test_set) diff --git a/testing/export/find_package_root-deprecated.cmake b/testing/export/find_package_root-deprecated.cmake new file mode 100644 index 00000000..8e635fa1 --- /dev/null +++ b/testing/export/find_package_root-deprecated.cmake @@ -0,0 +1,20 @@ +#============================================================================= +# 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. +#============================================================================= +include(${rapids-cmake-dir}/export/find_package_root.cmake) + +project(rapids-project LANGUAGES CUDA) +set(CMAKE_ERROR_DEPRECATED ON) +rapids_export_find_package_root(BUILD RMM [=[${CMAKE_CURRENT_LIST_DIR}/fake/build/path]=] test_set) diff --git a/testing/export/write_dependencies-root-dirs.cmake b/testing/export/write_dependencies-root-dirs.cmake index a3f5ea36..80655203 100644 --- a/testing/export/write_dependencies-root-dirs.cmake +++ b/testing/export/write_dependencies-root-dirs.cmake @@ -19,6 +19,9 @@ include(${rapids-cmake-dir}/export/write_dependencies.cmake) rapids_export_find_package_root(BUILD RMM [=[${CMAKE_CURRENT_LIST_DIR}/fake/build/path]=] test_set) rapids_export_write_dependencies(build test_set "${CMAKE_CURRENT_BINARY_DIR}/build_export_set.cmake") +rapids_export_find_package_root(BUILD RMM "/bad/install/path" EXPORT_SET ${unknown_var}) #ignored +rapids_export_find_package_root(BUILD RMM "/bad/install/path2" EXPORT_SET test_set CONDITION unknown_var) #ignored + # Parse the `build_export_set.cmake` file for correct escaped args # to `rapids_export_find_package_root` calls set(build_to_match_string [=[set(RMM_ROOT "${CMAKE_CURRENT_LIST_DIR}/fake/build/path"]=]) @@ -28,8 +31,11 @@ if(is_found EQUAL -1) message(FATAL_ERROR "rapids_export_write_dependencies(BUILD) failed to preserve variables in the directory path to rapids_export_find_package_root") endif() -rapids_export_find_package_root(install RMM "/first/install/path" test_set) +rapids_export_find_package_root(install RMM "/first/install/path" EXPORT_SET test_set) rapids_export_find_package_root(INSTALL RMM "/second/install/path" test_set) +set(to_install FALSE) +rapids_export_find_package_root(INSTALL RMM "/bad/install/path" EXPORT_SET test_set CONDITION to_install) #ignored + rapids_export_find_package_root(install PKG2 "/pkg2/install/path" test_set) rapids_export_write_dependencies(INSTALL test_set "${CMAKE_CURRENT_BINARY_DIR}/install_export_set.cmake") From 37428380a87aaf67ac9181f530a75cf86ba09c6c Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 9 Oct 2023 13:58:23 -0500 Subject: [PATCH 12/17] Express Python version in dependencies.yaml. (#470) This PR adds `py_version` to the `dependencies.yaml` file so that `rapids-cmake` expresses this in the same way as every other RAPIDS repository. The primary reason this might matter is for ensuring that compatible Python versions are used for style checks. Authors: - Bradley Dice (https://github.com/bdice) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/rapids-cmake/pull/470 --- dependencies.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index fca7f1b0..8a1dd36a 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -6,12 +6,14 @@ files: - build - cudatoolkit - docs + - py_version - test checks: output: none includes: - build - style_checks + - py_version docs: output: none includes: @@ -141,13 +143,27 @@ dependencies: - output_types: [conda, requirements] packages: - cython>=0.29,<0.30 - - python>=3.9,<3.11 - scikit-build>=0.13.1 - libpng - zlib - output_types: [conda] packages: - fmt==9.1.0 + py_version: + specific: + - output_types: conda + matrices: + - matrix: + py: "3.9" + packages: + - python=3.9 + - matrix: + py: "3.10" + packages: + - python=3.10 + - matrix: + packages: + - python>=3.9,<3.11 style_checks: common: - output_types: [conda, requirements] From f0d9bb2ecc4de5a7c8d1a895bb29458d7912e069 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Wed, 11 Oct 2023 10:29:32 -0400 Subject: [PATCH 13/17] Update Changelog [skip ci] --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86337537..d45d465f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +# rapids-cmake 23.10.00 (11 Oct 2023) + +## 🐛 Bug Fixes + +- Quote the list of patch files in case they have spaces in their paths ([#463](https://github.com/rapidsai/rapids-cmake/pull/463)) [@ericniebler](https://github.com/ericniebler) +- cpm overrides don't occur when `CPM_<pkg>_SOURCE` exists ([#458](https://github.com/rapidsai/rapids-cmake/pull/458)) [@robertmaynard](https://github.com/robertmaynard) +- Use `conda mambabuild` not `mamba mambabuild` ([#457](https://github.com/rapidsai/rapids-cmake/pull/457)) [@bdice](https://github.com/bdice) +- Support fmt use in debug builds ([#456](https://github.com/rapidsai/rapids-cmake/pull/456)) [@robertmaynard](https://github.com/robertmaynard) + +## 📖 Documentation + +- Move rapids_cpm_package_override to CPM section of docs ([#462](https://github.com/rapidsai/rapids-cmake/pull/462)) [@robertmaynard](https://github.com/robertmaynard) +- Improve docs around fetch content and rapids-cmake overrides ([#444](https://github.com/rapidsai/rapids-cmake/pull/444)) [@robertmaynard](https://github.com/robertmaynard) + +## 🚀 New Features + +- Bump cuco version ([#452](https://github.com/rapidsai/rapids-cmake/pull/452)) [@PointKernel](https://github.com/PointKernel) + +## 🛠️ Improvements + +- Update image names ([#461](https://github.com/rapidsai/rapids-cmake/pull/461)) [@AyodeAwe](https://github.com/AyodeAwe) +- Update to CPM v0.38.5 ([#460](https://github.com/rapidsai/rapids-cmake/pull/460)) [@trxcllnt](https://github.com/trxcllnt) +- Update to clang 16.0.6. ([#459](https://github.com/rapidsai/rapids-cmake/pull/459)) [@bdice](https://github.com/bdice) +- Use `copy-pr-bot` ([#455](https://github.com/rapidsai/rapids-cmake/pull/455)) [@ajschmidt8](https://github.com/ajschmidt8) + # rapids-cmake 23.08.00 (9 Aug 2023) ## 🐛 Bug Fixes From bd341fbf696f6484545381626d7a7ff7cdfcada0 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 11 Oct 2023 18:34:23 -0500 Subject: [PATCH 14/17] Use branch-23.12 workflows. (#472) This PR switches back to using `branch-23.12` for CI workflows because the CUDA 12 ARM conda migration is complete. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Jake Awe (https://github.com/AyodeAwe) URL: https://github.com/rapidsai/rapids-cmake/pull/472 --- .github/workflows/build.yaml | 6 +++--- .github/workflows/pr.yaml | 10 +++++----- .github/workflows/test.yaml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4e2b078b..f807b91d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -37,7 +37,7 @@ jobs: upload-conda: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -46,7 +46,7 @@ jobs: docs-build: if: github.ref_type == 'branch' secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 with: arch: "amd64" branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f1b363de..8105141c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -17,26 +17,26 @@ jobs: - conda-cpp-tests - docs-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.12 checks: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.12 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 with: build_type: pull-request conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 with: build_type: pull-request docs-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.12 with: build_type: pull-request node_type: "cpu4" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ba061ca2..6c02a92f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: cpp-tests: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120-arm + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 with: build_type: nightly branch: ${{ inputs.branch }} From e73fef6f9c1f0a8e70d983e0e3b8aca81b8b879d Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 16 Oct 2023 14:20:09 -0500 Subject: [PATCH 15/17] Update libcudacxx to 2.1.0 (#464) This PR separates out the libcudacxx update from #399. I am proposing to update only libcudacxx to 2.1.0, and leave thrust/cub pinned at 1.17.2 until all of RAPIDS is ready to update. Then we can move forward with #399 next. Separating the update for libcudacxx should allow RAPIDS to use some of the new features we want while giving more time to RAPIDS libraries to migrate to CCCL 2.1.0 (particularly for breaking changes in Thrust/CUB). **Immediate benefits of bumping only libcudacxx to 2.1.0:** - Enables migration to Thrust/CUB 2.1.0 to be done more incrementally, because we could merge PRs using `cuda::proclaim_return_type` into cudf/etc. which would reduce the amount of unmerged code we're maintaining in the "testing PRs" while waiting for all RAPIDS repos to be ready for Thrust/CUB 2.1.0. - Unblocks work in rmm (https://github.com/rapidsai/rmm/pull/1095) and quite a few planned changes for cuCollections (such as https://github.com/NVIDIA/cuCollections/issues/332, https://github.com/NVIDIA/cuCollections/issues/331, https://github.com/NVIDIA/cuCollections/issues/289) **Risk Assessment:** This should be fairly low risk because libcudacxx 2.1.0 is similar to our current pinning of 1.9.1 -- the major version bump was meant to align with Thrust/CUB and isn't indicative of major breaking changes. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/rapids-cmake/pull/464 --- .../cpm/patches/command_template.cmake.in | 10 +++ .../cpm/patches/libcudacxx/install_rules.diff | 47 +++--------- ...aim_return_type_nv_exec_check_disable.diff | 74 +++++++++++++++++++ .../patches/libcudacxx/reroot_support.diff | 8 +- rapids-cmake/cpm/versions.json | 14 ++-- 5 files changed, 108 insertions(+), 45 deletions(-) create mode 100644 rapids-cmake/cpm/patches/libcudacxx/proclaim_return_type_nv_exec_check_disable.diff diff --git a/rapids-cmake/cpm/patches/command_template.cmake.in b/rapids-cmake/cpm/patches/command_template.cmake.in index 76980b9e..00249ab8 100644 --- a/rapids-cmake/cpm/patches/command_template.cmake.in +++ b/rapids-cmake/cpm/patches/command_template.cmake.in @@ -68,6 +68,16 @@ function(rapids_cpm_run_git_patch file issue) set(msg_state ${msg_state} PARENT_SCOPE) endfunction() +# We want to ensure that any patched files have a timestamp +# that is at least 1 second newer compared to the git checkout +# This ensures that all of CMake up-to-date install logic +# considers these files as modified. +# +# This ensures that if our patch contains additional install rules +# they will execute even when an existing install rule exists +# with the same destination ( and our patch is listed last ). +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) + set(files "@patch_files_to_run@") set(issues "@patch_issues_to_ref@") set(output_file "@log_file@") diff --git a/rapids-cmake/cpm/patches/libcudacxx/install_rules.diff b/rapids-cmake/cpm/patches/libcudacxx/install_rules.diff index b2c7f2a3..601c2f14 100644 --- a/rapids-cmake/cpm/patches/libcudacxx/install_rules.diff +++ b/rapids-cmake/cpm/patches/libcudacxx/install_rules.diff @@ -1,36 +1,18 @@ diff --git a/cmake/libcudacxxInstallRules.cmake b/cmake/libcudacxxInstallRules.cmake -index 446ccb50..ff622bb7 100644 +index bd92a3be..f99a5606 100644 --- a/cmake/libcudacxxInstallRules.cmake +++ b/cmake/libcudacxxInstallRules.cmake -@@ -1,5 +1,5 @@ - option(libcudacxx_ENABLE_INSTALL_RULES -- "Enable installation of libcudacxx" ${libcudacxx_TOPLEVEL_PROJECT} -+ "Enable installation of libcudacxx" ${LIBCUDACXX_TOPLEVEL_PROJECT} - ) - - if (NOT libcudacxx_ENABLE_INSTALL_RULES) -@@ -12,24 +12,27 @@ include(GNUInstallDirs) - # Libcudacxx headers - install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/cuda" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -+ PATTERN CMakeLists.txt EXCLUDE - ) - install(DIRECTORY "${libcudacxx_SOURCE_DIR}/include/nv" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" -+ PATTERN CMakeLists.txt EXCLUDE - ) - - # Libcudacxx cmake package - install(DIRECTORY "${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake" -- PATTERN libcudacxx-header-search EXCLUDE -+ PATTERN *.cmake.in EXCLUDE - ) - +@@ -28,10 +28,17 @@ install(DIRECTORY "${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx" # Need to configure a file to store CMAKE_INSTALL_INCLUDEDIR # since it can be defined by the user. This is common to work around collisions # with the CTK installed headers. +set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/libcudacxx") ++# Transform to a list of directories, replace each directory with "../" ++# and convert back to a string ++string(REGEX REPLACE "/" ";" from_install_prefix "${install_location}") ++list(TRANSFORM from_install_prefix REPLACE ".+" "../") ++list(JOIN from_install_prefix "" from_install_prefix) ++ configure_file("${libcudacxx_SOURCE_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in" "${libcudacxx_BINARY_DIR}/lib/cmake/libcudacxx/libcudacxx-header-search.cmake" @ONLY @@ -39,23 +21,16 @@ index 446ccb50..ff622bb7 100644 - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libcudacxx" + DESTINATION "${install_location}" ) - diff --git a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in -index 9e7e187c..cb3b946f 100644 +index 9e7e187c..6130197f 100644 --- a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in +++ b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in -@@ -1,8 +1,18 @@ +@@ -1,8 +1,12 @@ # Parse version information from version header: unset(_libcudacxx_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search + +# Find CMAKE_INSTALL_INCLUDEDIR=@CMAKE_INSTALL_INCLUDEDIR@ directory" -+set(from_install_prefix "@install_location@") -+ -+# Transform to a list of directories, replace each directory with "../" -+# and convert back to a string -+string(REGEX REPLACE "/" ";" from_install_prefix "${from_install_prefix}") -+list(TRANSFORM from_install_prefix REPLACE ".+" "../") -+list(JOIN from_install_prefix "" from_install_prefix) ++set(from_install_prefix "@from_install_prefix@") + find_path(_libcudacxx_VERSION_INCLUDE_DIR cuda/std/detail/__config NO_DEFAULT_PATH # Only search explicit paths below: diff --git a/rapids-cmake/cpm/patches/libcudacxx/proclaim_return_type_nv_exec_check_disable.diff b/rapids-cmake/cpm/patches/libcudacxx/proclaim_return_type_nv_exec_check_disable.diff new file mode 100644 index 00000000..df889828 --- /dev/null +++ b/rapids-cmake/cpm/patches/libcudacxx/proclaim_return_type_nv_exec_check_disable.diff @@ -0,0 +1,74 @@ +diff --git a/include/cuda/std/detail/libcxx/include/__functional/invoke.h b/include/cuda/std/detail/libcxx/include/__functional/invoke.h +index 1ab318d5..850d00a8 100644 +--- a/include/cuda/std/detail/libcxx/include/__functional/invoke.h ++++ b/include/cuda/std/detail/libcxx/include/__functional/invoke.h +@@ -342,6 +342,9 @@ _LIBCUDACXX_INLINE_VISIBILITY __nat __invoke(__any, _Args&& ...__args); + + // bullets 1, 2 and 3 + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -350,6 +353,9 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) + _NOEXCEPT_(noexcept((static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...))) + { return (static_cast<_A0&&>(__a0).*__f)(static_cast<_Args&&>(__args)...); } + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -358,6 +364,9 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) + _NOEXCEPT_(noexcept((__a0.get().*__f)(static_cast<_Args&&>(__args)...))) + { return (__a0.get().*__f)(static_cast<_Args&&>(__args)...); } + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -368,6 +377,9 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) + + // bullets 4, 5 and 6 + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -376,6 +388,9 @@ __invoke(_Fp&& __f, _A0&& __a0) + _NOEXCEPT_(noexcept(static_cast<_A0&&>(__a0).*__f)) + { return static_cast<_A0&&>(__a0).*__f; } + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -384,6 +399,9 @@ __invoke(_Fp&& __f, _A0&& __a0) + _NOEXCEPT_(noexcept(__a0.get().*__f)) + { return __a0.get().*__f; } + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template > + inline _LIBCUDACXX_INLINE_VISIBILITY +@@ -394,6 +412,9 @@ __invoke(_Fp&& __f, _A0&& __a0) + + // bullet 7 + ++#ifdef __CUDACC__ ++#pragma nv_exec_check_disable ++#endif + template + inline _LIBCUDACXX_INLINE_VISIBILITY + _LIBCUDACXX_CONSTEXPR decltype(_CUDA_VSTD::declval<_Fp>()(_CUDA_VSTD::declval<_Args>()...)) diff --git a/rapids-cmake/cpm/patches/libcudacxx/reroot_support.diff b/rapids-cmake/cpm/patches/libcudacxx/reroot_support.diff index 2b623988..7cadb9d5 100644 --- a/rapids-cmake/cpm/patches/libcudacxx/reroot_support.diff +++ b/rapids-cmake/cpm/patches/libcudacxx/reroot_support.diff @@ -1,10 +1,10 @@ diff --git a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in -index 8c44d990..365b9de0 100644 +index 6130197f..ec53d5de 100644 --- a/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in +++ b/lib/cmake/libcudacxx/libcudacxx-header-search.cmake.in -@@ -11,6 +11,7 @@ list(TRANSFORM from_install_prefix REPLACE ".+" "../") - list(JOIN from_install_prefix "" from_install_prefix) - +@@ -5,6 +5,7 @@ unset(_libcudacxx_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search + set(from_install_prefix "@from_install_prefix@") + find_path(_libcudacxx_VERSION_INCLUDE_DIR cuda/std/detail/__config + NO_CMAKE_FIND_ROOT_PATH # Don't allow CMake to re-root the search NO_DEFAULT_PATH # Only search explicit paths below: diff --git a/rapids-cmake/cpm/versions.json b/rapids-cmake/cpm/versions.json index d1a7dcbc..e7f90489 100644 --- a/rapids-cmake/cpm/versions.json +++ b/rapids-cmake/cpm/versions.json @@ -1,4 +1,3 @@ - { "packages" : { "benchmark" : { @@ -30,18 +29,23 @@ "git_tag" : "v${version}" }, "libcudacxx" : { - "version" : "1.9.1", + "version" : "2.1.0", "git_url" : "https://github.com/NVIDIA/libcudacxx.git", - "git_tag" : "branch/${version}", + "git_tag" : "${version}", "patches" : [ { "file" : "libcudacxx/install_rules.diff", - "issue" : "libcudacxx 1.X installs incorrect files [https://github.com/NVIDIA/libcudacxx/pull/428]", + "issue" : "libcudacxx installs incorrect files [https://github.com/NVIDIA/libcudacxx/pull/428]", "fixed_in" : "2.2" }, { "file" : "libcudacxx/reroot_support.diff", - "issue" : "Support conda-forge usage of CMake rerooting [https://github.com/NVIDIA/libcudacxx/pull/490]", + "issue" : "Support conda-forge usage of CMake rerooting [https://github.com/NVIDIA/libcudacxx/pull/490], requires libcudacxx/install_rules.diff.", + "fixed_in" : "2.2" + }, + { + "file" : "libcudacxx/proclaim_return_type_nv_exec_check_disable.diff", + "issue" : "Use pragma to disable execution checks in cuda::proclaim_return_type. [https://github.com/NVIDIA/libcudacxx/pull/448]", "fixed_in" : "2.2" } ] From 5a01aa25ef6d579875ad5d867883946baa4ed078 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 16 Oct 2023 16:56:11 -0400 Subject: [PATCH 16/17] target from write_git_revision now works with export sets (#474) The git revision target previously wouldn't work when you needed to export targets. Those prohibited projects from producing static targets while also using this function. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/rapids-cmake/pull/474 --- rapids-cmake/cmake/write_git_revision_file.cmake | 2 +- testing/cmake/write_git_revision-simple/CMakeLists.txt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rapids-cmake/cmake/write_git_revision_file.cmake b/rapids-cmake/cmake/write_git_revision_file.cmake index dbd34c5b..116a0907 100644 --- a/rapids-cmake/cmake/write_git_revision_file.cmake +++ b/rapids-cmake/cmake/write_git_revision_file.cmake @@ -113,6 +113,6 @@ function(rapids_cmake_write_git_revision_file target file_path) add_dependencies(${target} ${target}_compute_git_info) cmake_path(GET file_path PARENT_PATH file_path_dir) - target_include_directories(${target} INTERFACE ${file_path_dir}) + target_include_directories(${target} INTERFACE "$") endfunction() diff --git a/testing/cmake/write_git_revision-simple/CMakeLists.txt b/testing/cmake/write_git_revision-simple/CMakeLists.txt index d6415185..46e5d057 100644 --- a/testing/cmake/write_git_revision-simple/CMakeLists.txt +++ b/testing/cmake/write_git_revision-simple/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -14,6 +14,7 @@ # limitations under the License. #============================================================================= include(${rapids-cmake-dir}/cmake/write_git_revision_file.cmake) +include(${rapids-cmake-dir}/export/export.cmake) cmake_minimum_required(VERSION 3.23.1) @@ -26,3 +27,8 @@ rapids_cmake_write_git_revision_file(nested_version "${CMAKE_CURRENT_BINARY_DIR} add_executable(write_git_version main.cpp) target_link_libraries(write_git_version PRIVATE demo_version nested_version) target_compile_features(write_git_version PRIVATE cxx_std_14) + +install(TARGETS write_git_version EXPORT write_git) +rapids_export(BUILD DEMO + EXPORT_SET write_git + ) From 6269046e941b3f45f82d6f456a64bef4f69c69f8 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 17 Oct 2023 15:10:45 -0500 Subject: [PATCH 17/17] Add patch for libcudacxx memory resource. (#476) Adds a patch from https://github.com/NVIDIA/libcudacxx/pull/439/ for libcudacxx 2.1.0, to support ongoing memory resource work. cc: @miscco Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Michael Schellenberger Costa (https://github.com/miscco) - Robert Maynard (https://github.com/robertmaynard) URL: https://github.com/rapidsai/rapids-cmake/pull/476 --- .../patches/libcudacxx/memory_resource.diff | 22 +++++++++++++++++++ rapids-cmake/cpm/versions.json | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 rapids-cmake/cpm/patches/libcudacxx/memory_resource.diff diff --git a/rapids-cmake/cpm/patches/libcudacxx/memory_resource.diff b/rapids-cmake/cpm/patches/libcudacxx/memory_resource.diff new file mode 100644 index 00000000..077289fb --- /dev/null +++ b/rapids-cmake/cpm/patches/libcudacxx/memory_resource.diff @@ -0,0 +1,22 @@ +diff --git a/include/cuda/memory_resource b/include/cuda/memory_resource +index 4a904cda..32f3f210 100644 +--- a/include/cuda/memory_resource ++++ b/include/cuda/memory_resource +@@ -525,7 +525,16 @@ public: + && (((_Alloc_type == _AllocType::_Default) && resource_with<_Resource, _Properties...>) // + ||((_Alloc_type == _AllocType::_Async) && async_resource_with<_Resource, _Properties...>)))) // + basic_resource_ref(_Resource& __res) noexcept +- : _Resource_ref_base<_Alloc_type>(&__res, &__alloc_vtable<_Alloc_type, _Resource>) ++ : _Resource_ref_base<_Alloc_type>(_CUDA_VSTD::addressof(__res), &__alloc_vtable<_Alloc_type, _Resource>) ++ , _Filtered_vtable<_Properties...>(_Filtered_vtable<_Properties...>::template _Create<_Resource>()) ++ {} ++ ++ _LIBCUDACXX_TEMPLATE(class _Resource) ++ (requires (!_Is_basic_resource_ref<_Resource> ++ && (((_Alloc_type == _AllocType::_Default) && resource_with<_Resource, _Properties...>) // ++ ||((_Alloc_type == _AllocType::_Async) && async_resource_with<_Resource, _Properties...>)))) // ++ basic_resource_ref(_Resource* __res) noexcept ++ : _Resource_ref_base<_Alloc_type>(__res, &__alloc_vtable<_Alloc_type, _Resource>) + , _Filtered_vtable<_Properties...>(_Filtered_vtable<_Properties...>::template _Create<_Resource>()) + {} + diff --git a/rapids-cmake/cpm/versions.json b/rapids-cmake/cpm/versions.json index e7f90489..1838e0a6 100644 --- a/rapids-cmake/cpm/versions.json +++ b/rapids-cmake/cpm/versions.json @@ -47,6 +47,11 @@ "file" : "libcudacxx/proclaim_return_type_nv_exec_check_disable.diff", "issue" : "Use pragma to disable execution checks in cuda::proclaim_return_type. [https://github.com/NVIDIA/libcudacxx/pull/448]", "fixed_in" : "2.2" + }, + { + "file" : "libcudacxx/memory_resource.diff", + "issue" : "Allow {async_}resource_ref to be constructible from a pointer. [https://github.com/NVIDIA/libcudacxx/pull/439]", + "fixed_in" : "2.2" } ] },