diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 63a91d4971f..370e665106d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -346,11 +346,19 @@ target_include_directories(cugraph "$" ) +set(COMPILED_RAFT_LIB "") if(CUDA_STATIC_RUNTIME) get_target_property(_includes raft::raft INTERFACE_INCLUDE_DIRECTORIES) target_include_directories(cugraph PUBLIC ${_includes}) # Add CTK include paths because we make our CTK library links private below target_include_directories(cugraph SYSTEM PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) + if(CUGRAPH_COMPILE_RAFT_LIB) + set(COMPILED_RAFT_LIB raft::compiled_static) + endif() +else() + if(CUGRAPH_COMPILE_RAFT_LIB) + set(COMPILED_RAFT_LIB raft::compiled) + endif() endif() ################################################################################ @@ -361,10 +369,10 @@ if (USE_CUGRAPH_OPS) rmm::rmm cugraph-ops::cugraph-ops++ $<$>:raft::raft> - $<$>:raft::compiled> + $<$>:${COMPILED_RAFT_LIB}> PRIVATE $<$:raft::raft> - $<$:raft::compiled> + $<$:${COMPILED_RAFT_LIB}> cuco::cuco cugraph::cuHornet NCCL::NCCL @@ -374,10 +382,10 @@ else() PUBLIC rmm::rmm $<$>:raft::raft> - $<$>:raft::compiled> + $<$>:${COMPILED_RAFT_LIB}> PRIVATE $<$:raft::raft> - $<$:raft::compiled> + $<$:${COMPILED_RAFT_LIB}> cuco::cuco cugraph::cuHornet NCCL::NCCL @@ -481,12 +489,12 @@ target_link_libraries(cugraph_c CUDA::cusparse${_ctk_static_suffix} rmm::rmm $<$>:raft::raft> - $<$>:raft::compiled> + $<$>:${COMPILED_RAFT_LIB}> PRIVATE cuco::cuco cugraph::cugraph $<$:raft::raft> - $<$:raft::compiled> + $<$:${COMPILED_RAFT_LIB}> ) ################################################################################ diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index aa341d0d70f..015b5b07920 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -30,16 +30,19 @@ function(find_and_configure_raft) set(CPM_DOWNLOAD_raft ON) endif() - set(BUILD_RAFT_SHARED ON) - if(PKG_USE_RAFT_STATIC) - set(BUILD_RAFT_SHARED OFF) + if(PKG_COMPILE_RAFT_LIB) + if(NOT PKG_USE_RAFT_STATIC) + string(APPEND RAFT_COMPONENTS " compiled") + else() + string(APPEND RAFT_COMPONENTS " compiled_static") + endif() endif() rapids_cpm_find(raft ${PKG_VERSION} GLOBAL_TARGETS raft::raft BUILD_EXPORT_SET cugraph-exports INSTALL_EXPORT_SET cugraph-exports - COMPONENTS compiled + COMPONENTS ${RAFT_COMPONENTS} CPM_ARGS EXCLUDE_FROM_ALL TRUE GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git @@ -49,7 +52,6 @@ function(find_and_configure_raft) "RAFT_COMPILE_LIBRARY ${PKG_COMPILE_RAFT_LIB}" "BUILD_TESTS OFF" "BUILD_BENCH OFF" - "BUILD_SHARED_LIBS ${BUILD_RAFT_SHARED}" ) if(raft_ADDED) diff --git a/python/cugraph/CMakeLists.txt b/python/cugraph/CMakeLists.txt index fc58c4de89c..f3b28623b12 100644 --- a/python/cugraph/CMakeLists.txt +++ b/python/cugraph/CMakeLists.txt @@ -65,7 +65,7 @@ if(NOT cugraph_FOUND) # Statically link dependencies if building wheels set(CUDA_STATIC_RUNTIME ON) set(USE_RAFT_STATIC ON) - set(CUGRAPH_COMPILE_RAFT_DIST_LIBS OFF) + set(CUGRAPH_COMPILE_RAFT_LIB ON) set(CUGRAPH_USE_CUGRAPH_OPS_STATIC ON) set(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL ON) set(ALLOW_CLONE_CUGRAPH_OPS ON) diff --git a/python/pylibcugraph/CMakeLists.txt b/python/pylibcugraph/CMakeLists.txt index 65ccdec1af8..b5b564e6881 100644 --- a/python/pylibcugraph/CMakeLists.txt +++ b/python/pylibcugraph/CMakeLists.txt @@ -65,7 +65,7 @@ if (NOT cugraph_FOUND) # Statically link dependencies if building wheels set(CUDA_STATIC_RUNTIME ON) set(USE_RAFT_STATIC ON) - set(CUGRAPH_COMPILE_RAFT_DIST_LIBS OFF) + set(CUGRAPH_COMPILE_RAFT_LIB ON) set(CUGRAPH_USE_CUGRAPH_OPS_STATIC ON) set(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL ON) set(ALLOW_CLONE_CUGRAPH_OPS ON)