diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cbb6c09b..b33ef5ad2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2018-2021, NVIDIA CORPORATION. +# Copyright (c) 2018-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 @@ -14,6 +14,10 @@ cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR) +# TODO(keith): REMOVE BEFORE MERGING +set(rapids-cmake-repo "kkraus14/rapids-cmake") +set(rapids-cmake-branch "spdlog_1.11_fmt") + if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.04/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RMM_RAPIDS.cmake) @@ -58,6 +62,7 @@ rapids_find_package( BUILD_EXPORT_SET rmm-exports INSTALL_EXPORT_SET rmm-exports) rapids_cpm_init() +include(cmake/thirdparty/get_fmt.cmake) include(cmake/thirdparty/get_spdlog.cmake) include(cmake/thirdparty/get_thrust.cmake) @@ -77,6 +82,7 @@ else() endif() target_link_libraries(rmm INTERFACE rmm::Thrust) +target_link_libraries(rmm INTERFACE fmt::fmt-header-only) target_link_libraries(rmm INTERFACE spdlog::spdlog_header_only) target_link_libraries(rmm INTERFACE dl) target_compile_features(rmm INTERFACE cxx_std_17 $) diff --git a/cmake/thirdparty/get_fmt.cmake b/cmake/thirdparty/get_fmt.cmake new file mode 100644 index 000000000..5787fb73f --- /dev/null +++ b/cmake/thirdparty/get_fmt.cmake @@ -0,0 +1,22 @@ +# ============================================================================= +# 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. +# ============================================================================= + +# Use CPM to find or clone fmt +function(find_and_configure_fmt) + + include(${rapids-cmake-dir}/cpm/fmt.cmake) + rapids_cpm_fmt(INSTALL_EXPORT_SET rmm-exports BUILD_EXPORT_SET rmm-exports) +endfunction() + +find_and_configure_fmt() diff --git a/cmake/thirdparty/get_spdlog.cmake b/cmake/thirdparty/get_spdlog.cmake index f78ae0262..24bbea89d 100644 --- a/cmake/thirdparty/get_spdlog.cmake +++ b/cmake/thirdparty/get_spdlog.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. You may obtain a copy of the License at @@ -16,7 +16,7 @@ function(find_and_configure_spdlog) include(${rapids-cmake-dir}/cpm/spdlog.cmake) - rapids_cpm_spdlog(INSTALL_EXPORT_SET rmm-exports) + rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET rmm-exports) rapids_export_package(BUILD spdlog rmm-exports) if(spdlog_ADDED) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index e075564df..499f5dbec 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -8,6 +8,7 @@ dependencies: - cuda-python>=11.7.1,<12.0 - cudatoolkit=11.8 - cython>=0.29,<0.30 +- fmt>=9.1.0,<10 - gcovr>=5.0 - ninja - numba>=0.49 @@ -17,5 +18,5 @@ dependencies: - pytest-cov - python>=3.8,<3.11 - scikit-build>=0.13.1 -- spdlog>=1.8.5,<1.9 +- spdlog>=1.11.0,<1.12 name: all_cuda-118_arch-x86_64 diff --git a/conda/recipes/librmm/conda_build_config.yaml b/conda/recipes/librmm/conda_build_config.yaml index ce0bbeec5..39dec9e5c 100644 --- a/conda/recipes/librmm/conda_build_config.yaml +++ b/conda/recipes/librmm/conda_build_config.yaml @@ -10,11 +10,14 @@ cuda_compiler: cmake_version: - ">=3.23.1,!=3.25.0" +fmt_version: + - ">=9.1.0,<10" + gtest_version: - "=1.10.0" spdlog_version: - - ">=1.8.5,<1.9" + - ">=1.11.0,<1.12" sysroot_version: - "2.17" diff --git a/conda/recipes/librmm/meta.yaml b/conda/recipes/librmm/meta.yaml index 61174c7b7..dd3e58b62 100644 --- a/conda/recipes/librmm/meta.yaml +++ b/conda/recipes/librmm/meta.yaml @@ -21,7 +21,14 @@ requirements: - {{ compiler('cuda') }} {{ cuda_version }} - sysroot_{{ target_platform }} {{ sysroot_version }} host: - - cudatoolkit {{ cuda_version }}.* + - cudatoolkit ={{ cuda_version }} + # We require spdlog and fmt (which was devendored from spdlog + # conda-forge packages in 1.11.0) so that the spdlog headers are not + # pulled by CPM and installed as a part of the rmm packages. However, + # building against librmm still requires these headers. They are also + # added as a run requirement via the packages' run_exports. + - fmt {{ fmt_version }} + - spdlog {{ spdlog_version }} build: script_env: @@ -54,6 +61,7 @@ outputs: - cmake {{ cmake_version }} run: - cudatoolkit {{ cuda_spec }} + - fmt {{ fmt_version }} - spdlog {{ spdlog_version }} test: commands: diff --git a/dependencies.yaml b/dependencies.yaml index 4c7a1f524..879892ba3 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -49,7 +49,8 @@ dependencies: - scikit-build>=0.13.1 - output_types: conda packages: - - spdlog>=1.8.5,<1.9 + - fmt>=9.1.0,<10 + - spdlog>=1.11.0,<1.12 checks: common: - output_types: [conda, requirements] diff --git a/include/rmm/logger.hpp b/include/rmm/logger.hpp index 8109eb888..318535a4e 100644 --- a/include/rmm/logger.hpp +++ b/include/rmm/logger.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -16,12 +16,8 @@ #pragma once -// If using GCC, temporary workaround for older libcudacxx defining _LIBCPP_VERSION -// undefine it before including spdlog, due to fmtlib checking if it is defined -// TODO: remove once libcudacxx is on Github and RAPIDS depends on it -#ifdef __GNUG__ -#undef _LIBCPP_VERSION -#endif +#include +#include #include #include @@ -115,3 +111,7 @@ inline spdlog::logger& logger() #define RMM_LOG_CRITICAL(...) SPDLOG_LOGGER_CRITICAL(&rmm::logger(), __VA_ARGS__) } // namespace rmm + +template <> +struct fmt::formatter : fmt::ostream_formatter { +}; diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index 1b1043b4a..b007d8f54 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/include/rmm/mr/device/detail/arena.hpp b/include/rmm/mr/device/detail/arena.hpp index c0e5df377..493fb6cb1 100644 --- a/include/rmm/mr/device/detail/arena.hpp +++ b/include/rmm/mr/device/detail/arena.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-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. @@ -24,8 +24,8 @@ #include +#include #include -#include #include #include diff --git a/include/rmm/mr/device/detail/coalescing_free_list.hpp b/include/rmm/mr/device/detail/coalescing_free_list.hpp index 8c5db7b02..d98ef7968 100644 --- a/include/rmm/mr/device/detail/coalescing_free_list.hpp +++ b/include/rmm/mr/device/detail/coalescing_free_list.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-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. @@ -16,14 +16,16 @@ #pragma once -#include #include #include +#include + #include #include #include #include +#include #include namespace rmm::mr::detail { diff --git a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp index 50495cb17..fa53e480a 100644 --- a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp +++ b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -20,6 +20,8 @@ #include #include +#include + #include #include diff --git a/include/rmm/mr/device/logging_resource_adaptor.hpp b/include/rmm/mr/device/logging_resource_adaptor.hpp index 60fd0d366..ee887f5b9 100644 --- a/include/rmm/mr/device/logging_resource_adaptor.hpp +++ b/include/rmm/mr/device/logging_resource_adaptor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/include/rmm/mr/device/pool_memory_resource.hpp b/include/rmm/mr/device/pool_memory_resource.hpp index 60ab60cf4..297b3f864 100644 --- a/include/rmm/mr/device/pool_memory_resource.hpp +++ b/include/rmm/mr/device/pool_memory_resource.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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,6 +29,8 @@ #include #include +#include + #include #include diff --git a/include/rmm/mr/device/tracking_resource_adaptor.hpp b/include/rmm/mr/device/tracking_resource_adaptor.hpp index fbcb44898..f1996ba01 100644 --- a/include/rmm/mr/device/tracking_resource_adaptor.hpp +++ b/include/rmm/mr/device/tracking_resource_adaptor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -19,6 +19,8 @@ #include #include +#include + #include #include #include diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 705f40ac7..8bea660d8 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,6 +16,10 @@ cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR) set(rmm_version 23.04.00) +# TODO(keith): REMOVE BEFORE MERGING +set(rapids-cmake-repo "kkraus14/rapids-cmake") +set(rapids-cmake-branch "spdlog_1.11_fmt") + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.04/RAPIDS.cmake ${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) diff --git a/tests/mr/device/callback_mr_tests.cpp b/tests/mr/device/callback_mr_tests.cpp index 101a75fc8..95dac93ec 100644 --- a/tests/mr/device/callback_mr_tests.cpp +++ b/tests/mr/device/callback_mr_tests.cpp @@ -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. @@ -24,7 +24,7 @@ #include -#include +#include #include #include