Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a8c862f
decouple distance type
divyegala Nov 3, 2025
ac63cd1
more updates
divyegala Nov 3, 2025
1b6a045
more fixes
divyegala Nov 3, 2025
681c457
fix
divyegala Nov 3, 2025
b677206
add patch to faiss
divyegala Nov 3, 2025
f23bb38
one more cast
divyegala Nov 3, 2025
83625ef
combine faiss patches
divyegala Nov 4, 2025
692cfc5
correct path
divyegala Nov 4, 2025
aae2a97
install c headers
divyegala Nov 4, 2025
8055f35
correct dir structure
divyegala Nov 4, 2025
1605aa3
separate components
divyegala Nov 4, 2025
04558a6
find cuvs_cpp_headers in python
divyegala Nov 4, 2025
badbdbe
remove breaking change, make cuvs and cuvs_static separate packages
divyegala Nov 4, 2025
3f67d1a
revert
divyegala Nov 4, 2025
76fe703
put headers in main export list
divyegala Nov 4, 2025
33200be
merge upstream
divyegala Nov 4, 2025
1703c00
remove c api install from static conda package
divyegala Nov 4, 2025
afe06a8
Merge branch 'main' into cpp-headers-static-component
divyegala Nov 7, 2025
ad0cd41
Correct issues in adding cpp-headers target
robertmaynard Nov 13, 2025
ed34f0b
Correct issues found in CI / code review
robertmaynard Nov 14, 2025
ff2da42
remove out of date task comment
robertmaynard Nov 14, 2025
a35df39
Restore cuvs_cpp_headers
robertmaynard Nov 14, 2025
3df7f5f
Correct style issues found by CI
robertmaynard Nov 14, 2025
e201577
Correct breaks in find_package(cuvs) found by devcontainers
robertmaynard Nov 14, 2025
c682ecd
Refactor generate_cuvs_export to auto bring in cuvs::cuvs_static
robertmaynard Nov 17, 2025
e7ced8b
Merge branch 'release/25.12' into cpp-headers-static-component
robertmaynard Nov 24, 2025
336e9dc
Properly search for target files
robertmaynard Nov 24, 2025
6f21d3b
use the correct target names to guard includes with
robertmaynard Nov 24, 2025
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
35 changes: 14 additions & 21 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ option(CUVSC_STATIC_CUVS_LIBRARY "Link against statical version of libcuvs" OFF)
# Check if cuVS 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 cuvs package.
if(NOT TARGET cuvs::cuvs)
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED)
if(CUVSC_STATIC_CUVS_LIBRARY)
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED COMPONENTS cuvs_static)
else()
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED COMPONENTS cuvs_shared)
endif()
else()
set(BUILDING_FROM_CUVS ON)
endif()
Expand Down Expand Up @@ -167,40 +171,29 @@ if(PROJECT_IS_TOP_LEVEL)
include(CPack)

# Add CUDAToolkit as an export dependency
rapids_export_package(INSTALL CUDAToolkit cuvs-c-exports)
rapids_export_package(BUILD CUDAToolkit cuvs-c-exports)
rapids_export_package(INSTALL CUDAToolkit cuvs-exports)
rapids_export_package(BUILD CUDAToolkit cuvs-exports)

install(
TARGETS cuvs_c
DESTINATION ${lib_dir}
COMPONENT cuvs_c
COMPONENT c_api
EXPORT cuvs-c-exports
)

rapids_export(
INSTALL cuvs_c
VERSION "${RAPIDS_VERSION}"
EXPORT_SET cuvs-c-exports
GLOBAL_TARGETS cuvs_c
NAMESPACE cuvs::
)
rapids_export(
BUILD cuvs_c
VERSION "${RAPIDS_VERSION}"
EXPORT_SET cuvs-c-exports
GLOBAL_TARGETS cuvs_c
NAMESPACE cuvs::
)
install(
DIRECTORY include/cuvs
COMPONENT cuvs_c
COMPONENT c_api
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cuvs/core/c_config.h
COMPONENT cuvs_c
COMPONENT c_api
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cuvs/core/
)

include(../cpp/cmake/modules/generate_cuvs_export.cmake)
generate_cuvs_export(CLIB COMPONENTS c_api EXPORT_SETS cuvs-c-exports)

endif()

# ##################################################################################################
Expand Down
123 changes: 123 additions & 0 deletions conda/recipes/libcuvs/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,61 @@ cache:
- mkl-devel =2023

outputs:
- package:
name: libcuvs-headers
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very close to what we would want in a -dev package but perhaps reversed -- where libcuvs would be only runtime libs while libcuvs-dev would be runtime libs plus headers. See proposal in rapidsai/build-planning#46.

What is our main goal in splitting out the headers? I am curious if that approach for -dev packages still makes sense or not. It might be different in a world with JIT where runtime always requires headers.

Copy link
Contributor

Choose a reason for hiding this comment

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

We need the headers for both the cuvs and cuvs-static packages to work in a -dev sense, but don't want to have two conda packages that clobber the same headers so that is why they are in cpp-headers.

The extra complexity is that I am also planning for splitting out the C API from the libcuvs conda package. That would allow us to have libcuvs-c-dev which only installs the libcuvs.so, libcuvs_c.so and the C headers

In most cases, ${lib}-dev will likely just be a metapackage that pulls in ${lib} and ${lib}-headers

It looks like we match the proposal in 46

version: ${{ version }}
build:
string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }}
dynamic_linking:
overlinking_behavior: "error"
prefix_detection:
ignore_binary_files: True
script:
content: |
cmake --install cpp/build --component cuvs_cpp_headers
requirements:
build:
- cmake ${{ cmake_version }}
- ${{ stdlib("c") }}
host:
- librmm =${{ minor_version }}
- libraft-headers =${{ minor_version }}
- nccl ${{ nccl_version }}
- cuda-version =${{ cuda_version }}
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
run:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
- libcusparse
ignore_run_exports:
by_name:
- cuda-cudart
- cuda-version
- libaio
- libboost
- libcublas
- libcurand
- libcusolver
- libcusparse
- librmm
- mkl
- nccl
about:
homepage: ${{ load_from_file("python/libcuvs/pyproject.toml").project.urls.Homepage }}
license: ${{ load_from_file("python/libcuvs/pyproject.toml").project.license.text }}
summary: ${{ load_from_file("python/libcuvs/pyproject.toml").project.description }}

- package:
name: libcuvs
version: ${{ version }}
Expand All @@ -90,13 +145,73 @@ outputs:
script:
content: |
cmake --install cpp/build --component cuvs
cmake --install cpp/build --component cuvs_shared
cmake --install cpp/build --component c_api
cmake --install cpp/build --component hnswlib
requirements:
build:
- cmake ${{ cmake_version }}
- ${{ stdlib("c") }}
host:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- librmm =${{ minor_version }}
- libraft-headers =${{ minor_version }}
- nccl ${{ nccl_version }}
- cuda-version =${{ cuda_version }}
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
run:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
- libcurand
- libcusolver
- libcusparse
ignore_run_exports:
by_name:
- cuda-cudart
- cuda-version
- libaio
- libboost
- libcublas
- libcurand
- libcusolver
- libcusparse
- librmm
- mkl
- nccl
about:
homepage: ${{ load_from_file("python/libcuvs/pyproject.toml").project.urls.Homepage }}
license: ${{ load_from_file("python/libcuvs/pyproject.toml").project.license.text }}
summary: ${{ load_from_file("python/libcuvs/pyproject.toml").project.description }}

- package:
name: libcuvs-static
version: ${{ version }}
build:
string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }}
dynamic_linking:
overlinking_behavior: "error"
prefix_detection:
ignore_binary_files: True
script:
content: |
cmake --install cpp/build --component cuvs_static
cmake --install cpp/build --component hnswlib
requirements:
build:
- cmake ${{ cmake_version }}
- ${{ stdlib("c") }}
host:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- librmm =${{ minor_version }}
- libraft-headers =${{ minor_version }}
- nccl ${{ nccl_version }}
Expand All @@ -109,7 +224,9 @@ outputs:
- libcusparse-dev
run:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- libraft-headers =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl
- cuda-cudart
- libcublas
Expand Down Expand Up @@ -152,6 +269,7 @@ outputs:
- librmm =${{ minor_version }}
- libraft-headers =${{ minor_version }}
- nccl ${{ nccl_version }}
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- cuda-version =${{ cuda_version }}
- openblas # required by some CPU algos in benchmarks
Expand All @@ -162,6 +280,7 @@ outputs:
- libcusolver-dev
- libcusparse-dev
run:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- libraft-headers =${{ minor_version }}
Expand Down Expand Up @@ -237,6 +356,7 @@ outputs:
- ninja
- ${{ stdlib("c") }}
host:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- cuda-version =${{ cuda_version }}
- libraft-headers =${{ minor_version }}
Expand All @@ -249,6 +369,7 @@ outputs:
- libcusolver-dev
- libcusparse-dev
run:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- nccl
Expand Down Expand Up @@ -298,6 +419,7 @@ outputs:
- cmake ${{ cmake_version }}
- ${{ stdlib("c") }}
host:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- cuda-cudart-dev
- cuda-profiler-api
Expand All @@ -317,6 +439,7 @@ outputs:
- libboost-devel =1.87
- mkl-devel =2023
run:
- ${{ pin_subpackage("libcuvs-headers", exact=True) }}
- ${{ pin_subpackage("libcuvs", exact=True) }}
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- cuda-cudart
Expand Down
Loading