From c6b5bca7b96783cc8251b8809438dfd8a801416b Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:37:49 -0700 Subject: [PATCH 1/7] pick new RAFT targets --- cpp/CMakeLists.txt | 6 +++--- cpp/cmake/thirdparty/get_raft.cmake | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c5a02cd670..acf35d6669 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -73,7 +73,7 @@ option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg # without installing all its components. This is useful if total file size is # at a premium and we do not expect other consumers to use any APIs of the # dependency except those that are directly linked to by the dependent library. -option(CUML_EXCLUDE_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) +option(CUML_ra_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_TREELITE_FROM_ALL "Exclude Treelite targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_CUMLPRIMS_MG_FROM_ALL "Exclude cumlprims_mg targets from cuML's 'all' target" OFF) option(CUML_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON) @@ -602,7 +602,7 @@ if(BUILD_CUML_CPP_LIBRARY) # These are always private: list(APPEND _cuml_cpp_private_libs - raft::raft + ${RAFT_LIB} $ $<$:CUDA::cufft${_ctk_static_suffix}> ${TREELITE_LIBS} @@ -622,7 +622,7 @@ if(BUILD_CUML_CPP_LIBRARY) # because cumlprims_mg and cuML inherit their CUDA libs from the raft::raft # INTERFACE target. list(APPEND ${_cuml_cpp_libs_var_name} - $<$:raft::compiled> + $<$:${RAFT_COMPILED_LIB}> $ ) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index b335b075b2..813ed470cb 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -36,19 +36,26 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " distributed") endif() + if(NOT PKG_USE_RAFT_STATIC) + set(RAFT_LIB raft::raft) + else() + set(RAFT_LIB raft::raft_static) + endif() + if(PKG_COMPILE_LIBRARY) - string(APPEND RAFT_COMPONENTS " compiled") + if(NOT PKG_USE_RAFT_STATIC) + string(APPEND RAFT_COMPONENTS " compiled") + set(RAFT_COMPILED_LIB raft::compiled) + else() + string(APPEND RAFT_COMPONENTS " compiled_static") + set(RAFT_COMPILED_LIB raft::compiled_static) + endif() set(RAFT_COMPILE_LIBRARY ON) else() set(RAFT_COMPILE_LIBRARY OFF) endif() - set(RAFT_BUILD_SHARED_LIBS ON) - if(${PKG_USE_RAFT_STATIC}) - set(RAFT_BUILD_SHARED_LIBS OFF) - endif() - # We need to set this each time so that on subsequent calls to cmake # the raft-config.cmake re-evaluates the RAFT_NVTX value set(RAFT_NVTX ${PKG_NVTX}) @@ -68,7 +75,6 @@ function(find_and_configure_raft) OPTIONS "BUILD_TESTS OFF" "BUILD_BENCH OFF" - "BUILD_SHARED_LIBS ${RAFT_BUILD_SHARED_LIBS}" "RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}" ) From 6efac97d94969bb7fb7af440bc946eea8b9c1d75 Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:40:26 -0700 Subject: [PATCH 2/7] fix typo --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index acf35d6669..472c856eab 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -73,7 +73,7 @@ option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg # without installing all its components. This is useful if total file size is # at a premium and we do not expect other consumers to use any APIs of the # dependency except those that are directly linked to by the dependent library. -option(CUML_ra_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) +option(CUML_EXCLUDE_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_TREELITE_FROM_ALL "Exclude Treelite targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_CUMLPRIMS_MG_FROM_ALL "Exclude cumlprims_mg targets from cuML's 'all' target" OFF) option(CUML_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON) From 2b52f32c4bb1eb8e93eb30c0d9db92da228b422a Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:43:16 -0700 Subject: [PATCH 3/7] fix target name --- cpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 472c856eab..1716dbb3cb 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -577,8 +577,8 @@ if(BUILD_CUML_CPP_LIBRARY) set(_cuml_cpp_public_libs) set(_cuml_cpp_private_libs) - if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft)) - copy_interface_excludes(INCLUDED_TARGET raft::raft TARGET ${CUML_CPP_TARGET}) + if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft_static)) + copy_interface_excludes(INCLUDED_TARGET raft::raft_static TARGET ${CUML_CPP_TARGET}) if(CUML_USE_RAFT_DIST AND (TARGET cuco::cuco)) list(APPEND _cuml_cpp_private_libs cuco::cuco) From 2d2a64939134233b2012ebf28c3a2df758245e8f Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:48:27 -0700 Subject: [PATCH 4/7] no such thing as raft::raft_static --- cpp/CMakeLists.txt | 6 +++--- cpp/cmake/thirdparty/get_raft.cmake | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 1716dbb3cb..0ad691fdbf 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -577,8 +577,8 @@ if(BUILD_CUML_CPP_LIBRARY) set(_cuml_cpp_public_libs) set(_cuml_cpp_private_libs) - if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft_static)) - copy_interface_excludes(INCLUDED_TARGET raft::raft_static TARGET ${CUML_CPP_TARGET}) + if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft)) + copy_interface_excludes(INCLUDED_TARGET raft::raft TARGET ${CUML_CPP_TARGET}) if(CUML_USE_RAFT_DIST AND (TARGET cuco::cuco)) list(APPEND _cuml_cpp_private_libs cuco::cuco) @@ -602,7 +602,7 @@ if(BUILD_CUML_CPP_LIBRARY) # These are always private: list(APPEND _cuml_cpp_private_libs - ${RAFT_LIB} + raft::raft $ $<$:CUDA::cufft${_ctk_static_suffix}> ${TREELITE_LIBS} diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 813ed470cb..d30d3c4392 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -36,13 +36,6 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " distributed") endif() - if(NOT PKG_USE_RAFT_STATIC) - set(RAFT_LIB raft::raft) - else() - set(RAFT_LIB raft::raft_static) - endif() - - if(PKG_COMPILE_LIBRARY) if(NOT PKG_USE_RAFT_STATIC) string(APPEND RAFT_COMPONENTS " compiled") From 22476cd795ca85d5ee79aa3ee083e88171b2a52e Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 17:17:14 -0700 Subject: [PATCH 5/7] bump From ce368d1fa20fe4ac75711d9f2a47d30363871251 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 5 Sep 2023 15:18:33 -0400 Subject: [PATCH 6/7] Propagate RAFT_COMPILED_LIB to correct scope --- cpp/cmake/thirdparty/get_raft.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index d30d3c4392..78262a167c 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -39,10 +39,10 @@ function(find_and_configure_raft) if(PKG_COMPILE_LIBRARY) if(NOT PKG_USE_RAFT_STATIC) string(APPEND RAFT_COMPONENTS " compiled") - set(RAFT_COMPILED_LIB raft::compiled) + set(RAFT_COMPILED_LIB raft::compiled PARENT_SCOPE) else() string(APPEND RAFT_COMPONENTS " compiled_static") - set(RAFT_COMPILED_LIB raft::compiled_static) + set(RAFT_COMPILED_LIB raft::compiled_static PARENT_SCOPE) endif() set(RAFT_COMPILE_LIBRARY ON) else() From 9658aa56d85e4f8baf415403d6cbd4afe7bbd0ca Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 5 Sep 2023 14:41:34 -0700 Subject: [PATCH 7/7] remove unnecessary variable setting --- cpp/cmake/thirdparty/get_raft.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 78262a167c..8919feb45d 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -44,9 +44,6 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " compiled_static") set(RAFT_COMPILED_LIB raft::compiled_static PARENT_SCOPE) endif() - set(RAFT_COMPILE_LIBRARY ON) - else() - set(RAFT_COMPILE_LIBRARY OFF) endif() # We need to set this each time so that on subsequent calls to cmake