Skip to content

Commit 4e0fb09

Browse files
Update cuvs to properly create a NCCL::NCCL target (rapidsai#720)
Previously cuvs was relying on the fact that nccl would be found when passed as `-lnccl` and be found on one of the implicit link directories. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Divye Gala (https://github.com/divyegala) URL: rapidsai#720
1 parent d0f5005 commit 4e0fb09

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

cpp/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,22 @@ if(BUILD_SHARED_LIBS)
579579
)
580580

581581
if(BUILD_MG_ALGOS)
582-
set(CUVS_COMMS_DEPENDENCY nccl)
582+
rapids_find_generate_module(
583+
NCCL
584+
HEADER_NAMES nccl.h
585+
LIBRARY_NAMES nccl
586+
)
587+
find_package(NCCL REQUIRED)
588+
target_link_libraries(cuvs_objs PRIVATE NCCL::NCCL)
589+
target_link_libraries(cuvs PRIVATE NCCL::NCCL)
583590
endif()
584591

585592
# Keep cuVS as lightweight as possible. Only CUDA libs and rmm should be used in global target.
586593
target_link_libraries(
587594
cuvs
588595
PUBLIC rmm::rmm raft::raft ${CUVS_CTK_MATH_DEPENDENCIES}
589596
PRIVATE nvidia::cutlass::cutlass $<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
590-
cuvs-cagra-search ${CUVS_COMMS_DEPENDENCY}
597+
cuvs-cagra-search
591598
)
592599

593600
if(NOT CUVS_COMPILE_DYNAMIC_ONLY)

cpp/tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ if(BUILD_TESTS)
206206

207207
if(BUILD_MG_ALGOS)
208208
ConfigureTest(
209-
NAME NEIGHBORS_MG_TEST PATH neighbors/mg/test_float.cu GPUS 1 PERCENT 100 ADDITIONAL_DEP nccl
209+
NAME NEIGHBORS_MG_TEST PATH neighbors/mg/test_float.cu GPUS 1 PERCENT 100 ADDITIONAL_DEP
210+
NCCL::NCCL
210211
)
211212
endif()
212213

0 commit comments

Comments
 (0)