diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a7ba3525..8c5bd5428 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,8 @@ rapids_cpm_init() add_subdirectory(rapids_logger) rapids_make_logger(rmm EXPORT_SET rmm-exports) +add_library(rmm::rmm_logger ALIAS rmm_logger) +add_library(rmm::rmm_logger_impl ALIAS rmm_logger_impl) include(cmake/thirdparty/get_cccl.cmake) include(cmake/thirdparty/get_nvtx.cmake) diff --git a/ci/check_symbols.sh b/ci/check_symbols.sh index 155e509da..377a93cac 100755 --- a/ci/check_symbols.sh +++ b/ci/check_symbols.sh @@ -53,7 +53,9 @@ for dso_file in ${dso_files}; do fi echo "checking for 'spdlog::' symbols..." - if grep -E 'spdlog\:\:' < "${symbol_file}"; then + if grep -E 'spdlog\:\:' < "${symbol_file}" \ + | grep -v 'std\:\:_Destroy_aux' + then raise-symbols-found-error 'spdlog::' fi echo "No symbol visibility issues found" diff --git a/cmake/thirdparty/get_spdlog.cmake b/cmake/thirdparty/get_spdlog.cmake index 212f604c3..febdf4c5c 100644 --- a/cmake/thirdparty/get_spdlog.cmake +++ b/cmake/thirdparty/get_spdlog.cmake @@ -17,6 +17,14 @@ function(find_and_configure_spdlog) include(${rapids-cmake-dir}/cpm/spdlog.cmake) rapids_cpm_spdlog( + # The conda package for fmt is hard-coded to assume that we use a preexisting fmt library. This + # is why we have always had a libfmt linkage despite choosing to specify the header-only version + # of fmt. We need a more robust way of modifying this to support fully self-contained build and + # usage even in environments where fmt and/or spdlog are already present. The crudest solution + # would be to modify the interface compile definitions and link libraries of the spdlog target, + # if necessary. For now I'm specifying EXTERNAL_FMT_HO here so that in environments where spdlog + # is cloned and built from source we wind up with the behavior that we expect, but we'll have to + # resolve this properly eventually. FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET rmm-exports BUILD_EXPORT_SET rmm-exports) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 519c056b5..ad2cbf9e6 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -35,7 +35,6 @@ dependencies: - python>=3.10,<3.13 - rapids-build-backend>=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.10.0 -- spdlog>=1.14.1,<1.15 - sphinx - sphinx-copybutton - sphinx-markdown-tables diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index 86e887c21..520c7d743 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -34,7 +34,6 @@ dependencies: - python>=3.10,<3.13 - rapids-build-backend>=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.10.0 -- spdlog>=1.14.1,<1.15 - sphinx - sphinx-copybutton - sphinx-markdown-tables diff --git a/conda/recipes/librmm/meta.yaml b/conda/recipes/librmm/meta.yaml index 53e16ebdc..31aaf0e63 100644 --- a/conda/recipes/librmm/meta.yaml +++ b/conda/recipes/librmm/meta.yaml @@ -26,13 +26,13 @@ requirements: - {{ stdlib("c") }} host: - cuda-version ={{ cuda_version }} - # We require spdlog and fmt (which was de-vendored 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. + # We need fmt here for now because the conda spdlog package is hard-coded + # to use fmt as a compiled library, not header-only, so we must ensure that + # the library is present for now so that if a downstream library tries to + # build against rmm and some other package in its build environment uses + # fmt (or spdlog) that the default rmm build is consistent with such + # environments. - fmt {{ fmt_version }} - - spdlog {{ spdlog_version }} build: script_env: @@ -77,8 +77,8 @@ outputs: {% if cuda_major == "11" %} - cudatoolkit {% endif %} + # See comment about fmt in the build section above. - fmt {{ fmt_version }} - - spdlog {{ spdlog_version }} test: commands: - test -d "${PREFIX}/include/rmm" diff --git a/dependencies.yaml b/dependencies.yaml index 070248edb..f92268639 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -112,7 +112,6 @@ dependencies: - c-compiler - cxx-compiler - fmt>=11.0.2,<12 - - spdlog>=1.14.1,<1.15 specific: - output_types: conda matrices: diff --git a/include/rmm/detail/logging_assert.hpp b/include/rmm/detail/logging_assert.hpp index c3b12ffe3..d5b2ca10a 100644 --- a/include/rmm/detail/logging_assert.hpp +++ b/include/rmm/detail/logging_assert.hpp @@ -38,7 +38,7 @@ if (!success) { \ RMM_LOG_CRITICAL( \ "[" __FILE__ ":" RMM_STRINGIFY(__LINE__) "] Assertion " RMM_STRINGIFY(_expr) " failed."); \ - rmm::detail::logger().flush(); \ + rmm::default_logger().flush(); \ /* NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay) */ \ assert(success); \ } \ diff --git a/rapids_logger/logger_impl.hpp.in b/rapids_logger/logger_impl.hpp.in index 717a00ac9..d5b467571 100644 --- a/rapids_logger/logger_impl.hpp.in +++ b/rapids_logger/logger_impl.hpp.in @@ -26,10 +26,16 @@ // Start hiding before including spdlog headers. #pragma GCC visibility push(hidden) +// This issue claims to have been resolved in gcc 8, but we still seem to encounter it here. +// The code compiles and links and all tests pass, and nm shows symbols resolved as expected. +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattributes" #include #include #include +#pragma GCC diagnostic pop #include #include