Skip to content

Commit 0e6d35f

Browse files
authored
Adapt to rmm logger changes (#2513)
This PR adapts to breaking changes in rmm in rapidsai/rmm#1722. This PR is a breaking change because consumers of raft that use any functionality that touches rmm logging will need to link to the rmm::rmm_logger_impl target as well now. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) URL: #2513
1 parent c943181 commit 0e6d35f

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

cpp/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ target_include_directories(
180180
)
181181

182182
# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target.
183-
target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass CCCL::CCCL)
183+
target_link_libraries(
184+
raft INTERFACE rmm::rmm rmm::rmm_logger spdlog::spdlog_header_only cuco::cuco
185+
nvidia::cutlass::cutlass CCCL::CCCL
186+
)
184187

185188
target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
186189
target_compile_options(
@@ -288,8 +291,10 @@ if(RAFT_COMPILE_LIBRARY)
288291
"$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>"
289292
)
290293

291-
add_library(raft_lib SHARED $<TARGET_OBJECTS:raft_objs>)
292-
add_library(raft_lib_static STATIC $<TARGET_OBJECTS:raft_objs>)
294+
# Make sure not to add the rmm logger twice since it will be brought in as an interface source by
295+
# the rmm::rmm_logger_impl target.
296+
add_library(raft_lib SHARED $<FILTER:$<TARGET_OBJECTS:raft_objs>,EXCLUDE,rmm.*logger>)
297+
add_library(raft_lib_static STATIC $<FILTER:$<TARGET_OBJECTS:raft_objs>,EXCLUDE,rmm.*logger>)
293298

294299
set_target_properties(
295300
raft_lib raft_lib_static
@@ -313,6 +318,8 @@ if(RAFT_COMPILE_LIBRARY)
313318
# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
314319
target_link_options(${target} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")
315320
endforeach()
321+
target_link_libraries(raft_lib PRIVATE rmm::rmm_logger_impl)
322+
target_link_libraries(raft_lib_static PRIVATE rmm::rmm_logger_impl)
316323
endif()
317324

318325
if(TARGET raft_lib AND (NOT TARGET raft::raft_lib))

cpp/bench/prims/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function(ConfigureBench)
3232
PRIVATE raft::raft
3333
raft_internal
3434
$<$<BOOL:${ConfigureBench_LIB}>:raft::compiled>
35+
$<$<NOT:$<BOOL:${ConfigureBench_LIB}>>:bench_rmm_logger>
3536
${RAFT_CTK_MATH_DEPENDENCIES}
3637
benchmark::benchmark
3738
Threads::Threads
@@ -73,6 +74,9 @@ function(ConfigureBench)
7374

7475
endfunction()
7576

77+
add_library(bench_rmm_logger OBJECT)
78+
target_link_libraries(bench_rmm_logger PRIVATE rmm::rmm_logger_impl)
79+
7680
if(BUILD_PRIMS_BENCH)
7781
ConfigureBench(NAME CORE_BENCH PATH core/bitset.cu core/copy.cu main.cpp)
7882

cpp/cmake/thirdparty/get_spdlog.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
function(find_and_configure_spdlog)
1717

1818
include(${rapids-cmake-dir}/cpm/spdlog.cmake)
19-
rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET rmm-exports)
20-
rapids_export_package(BUILD spdlog rmm-exports)
19+
rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET raft-exports)
20+
rapids_export_package(BUILD spdlog raft-exports)
2121

2222
endfunction()
2323

24-
find_and_configure_spdlog()
24+
find_and_configure_spdlog()

0 commit comments

Comments
 (0)