From 6306661782b2cb737d90e6e44da681ec6e2f1de8 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 19 Dec 2024 04:21:05 +0000 Subject: [PATCH] Narrow scope since the logger is only needed in kmeans because cuml is reexporting cuvs types that depend on raft types. --- cpp/CMakeLists.txt | 2 +- python/cuml/cuml/cluster/CMakeLists.txt | 5 +++-- python/cuml/cuml/cluster/kmeans_utils.pxd | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 39c78ff3c1..0e9dfa04d0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -628,7 +628,7 @@ if(BUILD_CUML_CPP_LIBRARY) ) target_link_libraries(${CUML_CPP_TARGET} - PUBLIC rmm::rmm rmm::rmm_logger raft::raft_logger ${CUVS_LIB} + PUBLIC rmm::rmm rmm::rmm_logger ${CUVS_LIB} ${_cuml_cpp_public_libs} PRIVATE ${_cuml_cpp_private_libs} ) diff --git a/python/cuml/cuml/cluster/CMakeLists.txt b/python/cuml/cuml/cluster/CMakeLists.txt index 43d15ae6fa..6ef4a3afb3 100644 --- a/python/cuml/cuml/cluster/CMakeLists.txt +++ b/python/cuml/cuml/cluster/CMakeLists.txt @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -29,7 +29,8 @@ add_subdirectory(hdbscan) rapids_cython_create_modules( CXX SOURCE_FILES "${cython_sources}" - LINKED_LIBRARIES "${cuml_mg_libraries}" + # Need the raft logger to specify enum types for the kmeans parameters. + LINKED_LIBRARIES "${cuml_mg_libraries}" raft::raft_logger MODULE_PREFIX cluster_ ASSOCIATED_TARGETS cuml ) diff --git a/python/cuml/cuml/cluster/kmeans_utils.pxd b/python/cuml/cuml/cluster/kmeans_utils.pxd index 9386d0b38a..841ea2d3dc 100644 --- a/python/cuml/cuml/cluster/kmeans_utils.pxd +++ b/python/cuml/cuml/cluster/kmeans_utils.pxd @@ -24,6 +24,7 @@ cdef extern from "cuml/cluster/kmeans.hpp" namespace \ "cuvs::cluster::kmeans::params": enum InitMethod: KMeansPlusPlus, Random, Array + cdef extern from "raft/core/logger.hpp" namespace "raft": cdef enum class level_enum: trace