Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ if(DETECT_CONDA_ENV)
endif()
endif()

# ##################################################################################################
# * find C++ libraries from wheels in site-packages --------------------------------------
find_package(Python COMPONENTS Interpreter)
if(Python_FOUND)
include(${rapids-cmake-dir}/cython-core/find_prefix_paths.cmake)
rapids_cython_find_prefix_paths("${Python_EXECUTABLE}" wheel_prefix_paths)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
list(APPEND CMAKE_PREFIX_PATH ${wheel_prefix_paths})
endif()

# ##################################################################################################
# * compiler options ---------------------------------------------------------

Expand Down
8 changes: 3 additions & 5 deletions cpp/cmake/thirdparty/get_cuvs.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#=============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
#=============================================================================

set(CUML_MIN_VERSION_cuvs "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00")

function(find_and_configure_cuvs)
set(oneValueArgs VERSION FORK PINNED_TAG EXCLUDE_FROM_ALL USE_CUVS_STATIC COMPILE_LIBRARY CLONE_ON_PIN)
set(oneValueArgs VERSION FORK PINNED_TAG EXCLUDE_FROM_ALL USE_CUVS_STATIC CLONE_ON_PIN)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

Expand Down Expand Up @@ -45,7 +45,6 @@ function(find_and_configure_cuvs)
"BUILD_CAGRA_HNSWLIB OFF"
"BUILD_CUVS_BENCH OFF"
"BUILD_MG_ALGOS ${CUVS_BUILD_MG_ALGOS}"

)

if(cuvs_ADDED)
Expand All @@ -61,13 +60,12 @@ endfunction()
# To use a different CUVS locally, set the CMake variable
# CPM_cuvs_SOURCE=/path/to/local/cuvs
find_and_configure_cuvs(VERSION ${CUML_MIN_VERSION_cuvs}
FORK rapidsai
FORK NVIDIA
PINNED_TAG ${rapids-cmake-checkout-tag}
EXCLUDE_FROM_ALL ${CUML_EXCLUDE_CUVS_FROM_ALL}
# When PINNED_TAG above doesn't match cuml,
# force local cuvs clone in build directory
# even if it's already installed.
CLONE_ON_PIN ${CUML_CUVS_CLONE_ON_PIN}
COMPILE_LIBRARY ${CUML_CUVS_COMPILED}
USE_CUVS_STATIC ${CUML_USE_CUVS_STATIC}
)
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#=============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
#=============================================================================
Expand Down Expand Up @@ -56,7 +56,7 @@ endfunction()
# To use a different RAFT locally, set the CMake variable
# CPM_raft_SOURCE=/path/to/local/raft
find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft}
FORK rapidsai
FORK NVIDIA
PINNED_TAG ${rapids-cmake-checkout-tag}
EXCLUDE_FROM_ALL ${CUML_EXCLUDE_RAFT_FROM_ALL}
# When PINNED_TAG above doesn't match cuml,
Expand Down
14 changes: 7 additions & 7 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,23 @@ dependencies:
use_cuda_wheels: "true"
packages:
- cuda-toolkit==13.3.*
# NOTE: 'tileiras' is needed too, but in CI that's provided by a system-installed CTK.
cutile_python:
specific:
- output_types: requirements
- output_types: [requirements, pyproject]
matrices:
- matrix:
cuda: "12.*"
packages:
- matrix:
cuda: "13.3"
cuda: "13.*"
packages:
- cuda-tile
- cuda-toolkit[tileiras]==13.3.*
- &cutile_python_cu13 cuda-tile
# if no matching matrix selectors passed, list the CUDA 13 requirement
# (as a source of documentation in the generated pyproject.toml)
- matrix:
cuda: "13.*"
packages:
- cuda-tile
- cuda-toolkit[tileiras]==13.*
- *cutile_python_cu13
cuda:
common:
- output_types: [conda]
Expand Down
3 changes: 3 additions & 0 deletions python/cuml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ project(
LANGUAGES ${language_list}
)

# Find C++ libraries from RAPIDS wheels in site-packages.
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
5 changes: 4 additions & 1 deletion python/libcuml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand All @@ -18,6 +18,9 @@ project(
LANGUAGES CXX CUDA
)

# Find C++ libraries from RAPIDS wheels in site-packages.
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar things are used in other parts of RAPIDS to ensure CMake targets installed in site-packages/ can be found.

Things like this were added in NVIDIA/cuvs#2565, for example.


# Check if cuml is already available. If so, it is the user's responsibility to ensure that the
# CMake package is also available at build time of the Python cuml package.
find_package(cuml "${RAPIDS_VERSION}")
Expand Down
Loading