From eb294920dc9777a5885a03a51c5d223d805e9fb7 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 13 Nov 2024 16:59:07 -0800 Subject: [PATCH 1/3] disable hnswlib if not compiling --- cpp/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d7eeb60b27..a74afeea7c 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -85,6 +85,10 @@ if(BUILD_CPU_ONLY) set(BUILD_TESTS OFF) endif() +if(NOT RAFT_COMPILE_LIBRARY) + set(BUILD_CAGRA_HNSWLIB OFF) +endif() + # Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs to # have different values for the `Threads::Threads` target. Setting this flag ensures # `Threads::Threads` is the same value across all builds so that cache hits occur @@ -105,12 +109,8 @@ message(VERBOSE "RAFT: Disable OpenMP: ${DISABLE_OPENMP}") message(VERBOSE "RAFT: Enable kernel resource usage info: ${CUDA_ENABLE_KERNELINFO}") message(VERBOSE "RAFT: Enable lineinfo in nvcc: ${CUDA_ENABLE_LINEINFO}") message(VERBOSE "RAFT: Enable nvtx markers: ${RAFT_NVTX}") -message(VERBOSE - "RAFT: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}" -) -message(VERBOSE - "RAFT: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}" -) +message(VERBOSE "RAFT: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}") +message(VERBOSE "RAFT: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}") # Set RMM logging level set(RMM_LOGGING_LEVEL From 28786de857602f99b9343d899e3f9ff5addedc67 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 13 Nov 2024 19:50:51 -0800 Subject: [PATCH 2/3] attempt to link hnswlib to raft::compiled --- cpp/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a74afeea7c..cce70df579 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -210,9 +210,6 @@ add_library(raft::raft ALIAS raft) target_include_directories( raft INTERFACE "$" "$" ) -if(BUILD_CAGRA_HNSWLIB) - target_link_libraries(raft INTERFACE hnswlib::hnswlib) -endif() if(NOT BUILD_CPU_ONLY) # Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target. @@ -619,6 +616,9 @@ if(TARGET raft_lib AND (NOT TARGET raft::raft_lib)) endif() target_link_libraries(raft_compiled INTERFACE raft::raft $) +if(BUILD_CAGRA_HNSWLIB) + target_link_libraries(raft_compiled PUBLIC hnswlib::hnswlib) +endif() # ################################################################################################## # * raft_compiled_static---------------------------------------------------------------------------- From e801d53121bf82cd68cc5de17f5a98419b3bb887 Mon Sep 17 00:00:00 2001 From: divyegala Date: Thu, 14 Nov 2024 11:01:50 -0800 Subject: [PATCH 3/3] try something else --- cpp/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index cce70df579..962c039af8 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -602,6 +602,7 @@ if(RAFT_COMPILE_LIBRARY) ${RAFT_CTK_MATH_DEPENDENCIES} # TODO: Once `raft::resources` is used everywhere, this # will just be cublas $ + $ ) # So consumers know when using libraft.so/libraft.a @@ -616,9 +617,6 @@ if(TARGET raft_lib AND (NOT TARGET raft::raft_lib)) endif() target_link_libraries(raft_compiled INTERFACE raft::raft $) -if(BUILD_CAGRA_HNSWLIB) - target_link_libraries(raft_compiled PUBLIC hnswlib::hnswlib) -endif() # ################################################################################################## # * raft_compiled_static----------------------------------------------------------------------------