Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into fea/support_embedded_patch_content
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Jan 13, 2025
2 parents b55da10 + 549c677 commit 4d21399
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 23 deletions.
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: |
Expand All @@ -24,11 +24,13 @@ repos:
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.8.0
rev: v1.17.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
5 changes: 5 additions & 0 deletions cmake-format-rapids-cmake.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@
"INSTALL_EXPORT_SET": 1
}
},
"rapids_cpm_rapids_logger": {
"pargs": {
"nargs": 0
}
},
"rapids_cpm_nvbench": {
"pargs": {
"nargs": 0,
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ dependencies:
common:
- output_types: [conda, requirements]
packages:
- cython>=0.29,<0.30
- cython
- libpng
- zlib
- output_types: [conda]
Expand Down
1 change: 1 addition & 0 deletions docs/packages/packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/packages/rapids_cpm_fmt
/packages/rapids_cpm_gbench
/packages/rapids_cpm_gtest
/packages/rapids_cpm_rapids_logger
/packages/rapids_cpm_nvbench
/packages/rapids_cpm_nvcomp
/packages/rapids_cpm_nvtx3
Expand Down
1 change: 1 addition & 0 deletions docs/packages/rapids_cpm_rapids_logger.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. cmake-module:: ../../rapids-cmake/cpm/rapids_logger.cmake
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

[tool.codespell]
# note: pre-commit passes explicit lists of files here, which this skip file list doesn't override -
# this is only to allow you to run codespell interactively
skip = "./.git"
# ignore short words, and typename parameters
ignore-regex = "\\b(.{1,4}|[A-Z]\\w*T)\\b"
builtin = "clear"
quiet-level = 3
67 changes: 67 additions & 0 deletions rapids-cmake/cpm/rapids_logger.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#=============================================================================
# Copyright (c) 2025, 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_cpm_rapids_logger
------------------------
.. versionadded:: v25.02.00
Allow projects to build `rapids-logger` via `CPM`.
Uses the version of rapids-logger :ref:`specified in the version file <cpm_versions>` for consistency
across all RAPIDS projects.
Unlike most `rapids_cpm` functions, this one does not support export sets because rapids-logger adds targets directly to the calling project's own export set and does not require its own exporting or to be found at all by consuming projects once the first project's call to rapids_make_logger has completed.
.. code-block:: cmake
rapids_cpm_rapids_logger( [<CPM_ARGS> ...])
.. |PKG_NAME| replace:: logger
.. include:: common_package_args.txt
Result Functions
^^^^^^^^^^^^^^^^
:cmake:command:`rapids_make_logger` is made available
#]=======================================================================]
function(rapids_cpm_rapids_logger)
list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.rapids_logger")

set(options)
set(one_value)
set(multi_value)
cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN})

include("${rapids-cmake-dir}/cpm/detail/package_details.cmake")
rapids_cpm_package_details(rapids_logger version repository tag shallow exclude)

include("${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake")
rapids_cpm_generate_patch_command(rapids_logger ${version} patch_command)

include("${rapids-cmake-dir}/cpm/find.cmake")
rapids_cpm_find(rapids_logger ${version} ${_RAPIDS_UNPARSED_ARGUMENTS}
CPM_ARGS
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow} ${patch_command}
EXCLUDE_FROM_ALL ON)

include("${rapids-cmake-dir}/cpm/detail/display_patch_status.cmake")
rapids_cpm_display_patch_status(logger)
endfunction()
6 changes: 4 additions & 2 deletions rapids-cmake/cpm/rmm.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, 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 @@ -39,6 +39,8 @@ for consistency across all RAPIDS projects.
Result Targets
^^^^^^^^^^^^^^
rmm::rmm target will be created
rmm::rmm_logger target will be created
rmm::rmm_logger_impl target will be created
Result Variables
^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -73,7 +75,7 @@ function(rapids_cpm_rmm)

include("${rapids-cmake-dir}/cpm/find.cmake")
rapids_cpm_find(rmm ${version} ${ARGN} ${_RAPIDS_UNPARSED_ARGUMENTS}
GLOBAL_TARGETS rmm::rmm
GLOBAL_TARGETS rmm::rmm rmm::rmm_logger rmm::rmm_logger_impl
CPM_ARGS
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
Expand Down
9 changes: 8 additions & 1 deletion rapids-cmake/cpm/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
"git_shallow": false,
"always_download": true,
"git_url": "https://github.com/NVIDIA/cuCollections.git",
"git_tag": "dc0f9fc20c2a544e53099e640a681b347532391a"
"git_tag": "096346b739da3fb1d9c3b402190c0a3a7e554440"
},
"rapids_logger": {
"version": "0.1.0",
"git_shallow": false,
"always_download": true,
"git_url": "https://github.com/rapidsai/rapids-logger.git",
"git_tag": "8968ab3337f31c845d4e3bf6c55ae89242ded22b"
},
"fmt": {
"version": "11.0.2",
Expand Down
2 changes: 1 addition & 1 deletion rapids-cmake/cython-core/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ macro(rapids_cython_init)
endif()

find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
find_program(CYTHON "cython")
find_program(CYTHON "cython" REQUIRED)

if(NOT CYTHON_FLAGS)
set(CYTHON_FLAGS "--directive binding=True,embedsignature=True,always_allow_keywords=True")
Expand Down
2 changes: 1 addition & 1 deletion rapids-cmake/export/export.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ calls to :cmake:command:`find_dependency`, or :cmake:command:`CPMFindPackage`.
rapids_export(BUILD example
EXPORT_SET example-targets
COMPONENTS A B
COMPONENTS A-export B-export
COMPONENTS_EXPORT_SET A-export B-export
)
This is needed so that :cmake:command:`rapids_export` can correctly
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/test/gpu_requirements.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 Down Expand Up @@ -77,7 +77,7 @@ function(rapids_test_gpu_requirements test_name)
set(percent ${_RAPIDS_TEST_PERCENT})
endif()

# verify that gpu and percent are withing the allowed bounds
# verify that gpu and percent are within the allowed bounds
if(NOT gpus GREATER_EQUAL 0)
message(FATAL_ERROR "rapids_test_gpu_requirements requires a numeric GPUS value [0-N].")
endif()
Expand Down
10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

2 changes: 2 additions & 0 deletions testing/cpm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ add_cmake_config_test( cpm_gtest-simple.cmake )
add_cmake_config_test( cpm_gtest-static.cmake )
add_cmake_config_test( cpm_gtest-explicit-static.cmake )

add_cmake_config_test( cpm_logger-simple.cmake )

add_cmake_config_test( cpm_nvbench-export.cmake SERIAL)
add_cmake_config_test( cpm_nvbench-simple.cmake SERIAL)
add_cmake_config_test( cpm_nvbench-already-found-fmt.cmake SERIAL)
Expand Down
48 changes: 48 additions & 0 deletions testing/cpm/cpm_logger-simple.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#=============================================================================
# Copyright (c) 2022-2025, 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/rapids_logger.cmake)

rapids_cpm_init()
rapids_cpm_rapids_logger()

set(logger_namespace rapids)
set(logger_target "${logger_namespace}_logger")
set(logger_impl_target "${logger_namespace}_logger_impl")

rapids_make_logger("${logger_namespace}")

function(check_target target)
if(NOT TARGET "${target}")
message(FATAL_ERROR "Target ${target} was not created.")
endif()
endfunction()

function(check_file fn)
if(NOT EXISTS "${fn}")
message(FATAL_ERROR "File ${fn} was not created.")
endif()
endfunction()

check_target("${logger_target}")
check_target("${logger_impl_target}")
check_target("${logger_namespace}::${logger_target}")
check_target("${logger_namespace}::${logger_impl_target}")

set(base_dir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${logger_namespace}")
check_file("${base_dir}/logger.hpp")
check_file("${base_dir}/logger_impl/logger_impl.hpp")
check_file("${base_dir}/logger_impl/logger.cpp")
14 changes: 13 additions & 1 deletion testing/cpm/cpm_rmm-simple.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, 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 @@ -21,10 +21,22 @@ rapids_cpm_init()
if(TARGET rmm::rmm)
message(FATAL_ERROR "Expected rmm::rmm not to exist")
endif()
if(TARGET rmm::rmm_logger)
message(FATAL_ERROR "Expected rmm::rmm_logger not to exist")
endif()
if(TARGET rmm::rmm_logger_impl)
message(FATAL_ERROR "Expected rmm::rmm_logger_impl not to exist")
endif()

rapids_cpm_rmm()
if(NOT TARGET rmm::rmm)
message(FATAL_ERROR "Expected rmm::rmm target to exist")
endif()
if(NOT TARGET rmm::rmm_logger)
message(FATAL_ERROR "Expected rmm::rmm_logger target to exist")
endif()
if(NOT TARGET rmm::rmm_logger_impl)
message(FATAL_ERROR "Expected rmm::rmm_logger_impl target to exist")
endif()

rapids_cpm_rmm()
4 changes: 3 additions & 1 deletion testing/utils/fill_cache/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, 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 @@ -23,6 +23,7 @@ include(${rapids-cmake-dir}/cpm/cccl.cmake)
include(${rapids-cmake-dir}/cpm/cuco.cmake)
include(${rapids-cmake-dir}/cpm/gbench.cmake)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
include(${rapids-cmake-dir}/cpm/rapids_logger.cmake)
include(${rapids-cmake-dir}/cpm/nvbench.cmake)
include(${rapids-cmake-dir}/cpm/nvcomp.cmake)
include(${rapids-cmake-dir}/cpm/nvtx3.cmake)
Expand All @@ -38,6 +39,7 @@ rapids_cpm_cccl(DOWNLOAD_ONLY ON)
rapids_cpm_cuco(DOWNLOAD_ONLY ON)
rapids_cpm_gbench(DOWNLOAD_ONLY ON)
rapids_cpm_gtest(DOWNLOAD_ONLY ON)
rapids_cpm_rapids_logger(DOWNLOAD_ONLY ON)
rapids_cpm_nvbench(DOWNLOAD_ONLY ON)
rapids_cpm_nvtx3(DOWNLOAD_ONLY ON)
rapids_cpm_rmm(DOWNLOAD_ONLY ON)
Expand Down

0 comments on commit 4d21399

Please sign in to comment.