diff --git a/build.sh b/build.sh index c6e09c5bf..d53f7c354 100755 --- a/build.sh +++ b/build.sh @@ -48,13 +48,13 @@ HELP="$0 [ ...] [ ...] [--cmake-args=\"\"] [--cache-tool= /dev/null 2>&1 - fi - - # Try to uninstall via pip if it is installed - if [ -x "$(command -v pip)" ]; then - echo "Using pip to uninstall cuvs-dask" - pip uninstall -y cuvs-dask - - # Otherwise, try to uninstall through conda if that's where things are installed - elif [ -x "$(command -v conda)" ] && [ "$INSTALL_PREFIX" == "$CONDA_PREFIX" ]; then - echo "Using conda to uninstall cuvs-dask" - conda uninstall -y cuvs-dask - - # Otherwise, fail - else - echo "Could not uninstall cuvs-dask from pip or conda. cuvs-dask package will need to be manually uninstalled." - fi - fi exit 0 fi @@ -261,24 +239,14 @@ if hasArg --allgpuarch; then BUILD_ALL_GPU_ARCH=1 fi - -# Append `-DFIND_CUVS_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option. -if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUVS_CPP"* ]]; then - EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_CUVS_CPP=ON" -fi - if hasArg tests || (( ${NUMARGS} == 0 )); then BUILD_TESTS=ON CMAKE_TARGET="${CMAKE_TARGET};${TEST_TARGETS}" # Force compile library when needed test targets are specified - if [[ $CMAKE_TARGET == *"CLUSTER_TEST"* || \ - $CMAKE_TARGET == *"DISTANCE_TEST"* || \ - $CMAKE_TARGET == *"NEIGHBORS_ANN_CAGRA_TEST"* || \ - $CMAKE_TARGET == *"NEIGHBORS_ANN_IVF_TEST"* || \ - $CMAKE_TARGET == *"NEIGHBORS_ANN_NN_DESCENT_TEST"* || \ - $CMAKE_TARGET == *"NEIGHBORS_TEST"* || \ - $CMAKE_TARGET == *"STATS_TEST"* ]]; then + if [[ $CMAKE_TARGET == *"CAGRA_C_TEST"* || \ + $CMAKE_TARGET == *"INTEROP_TEST"* || \ + $CMAKE_TARGET == *"NEIGHBORS_ANN_CAGRA_TEST"* ]]; then echo "-- Enabling compiled lib for gtests" COMPILE_LIBRARY=ON fi @@ -304,13 +272,10 @@ if [[ ${CMAKE_TARGET} == "" ]]; then CMAKE_TARGET="all" fi -# Append `-DFIND_CUVS_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option. - - SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}" if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUVS_CPP"* ]]; then - SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS} -DFIND_CUVS_CPP=ON" + SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DFIND_CUVS_CPP=ON" fi # If clean given, run it prior to any other steps @@ -353,7 +318,6 @@ if (( ${NUMARGS} == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || has -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DCMAKE_CUDA_ARCHITECTURES=${CUVS_CMAKE_CUDA_ARCHITECTURES} \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DCUVS_COMPILE_LIBRARY=${COMPILE_LIBRARY} \ -DBUILD_C_LIBRARY=${COMPILE_LIBRARY} \ -DCUVS_NVTX=${NVTX} \ -DCUDA_LOG_COMPILE_TIME=${LOG_COMPILE_TIME} \ @@ -422,9 +386,9 @@ fi # Build and (optionally) install the cuvs Python package if (( ${NUMARGS} == 0 )) || hasArg python; then - SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \ - python -m pip install --no-build-isolation --no-deps ${REPODIR}/python/cuvs + python -m pip install --no-build-isolation --no-deps -vvv ${REPODIR}/python/cuvs fi if hasArg docs; then diff --git a/conda/environments/all_cuda-118_arch-aarch64.yaml b/conda/environments/all_cuda-118_arch-aarch64.yaml index e4f922378..d711fc555 100644 --- a/conda/environments/all_cuda-118_arch-aarch64.yaml +++ b/conda/environments/all_cuda-118_arch-aarch64.yaml @@ -20,6 +20,7 @@ dependencies: - cupy>=12.0.0 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - doxygen>=1.8.20 - gcc_linux-aarch64=11.* - gmock>=1.13.0 diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index a26314b22..b4c2c6857 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -20,6 +20,7 @@ dependencies: - cupy>=12.0.0 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - doxygen>=1.8.20 - gcc_linux-64=11.* - gmock>=1.13.0 diff --git a/conda/environments/all_cuda-122_arch-aarch64.yaml b/conda/environments/all_cuda-122_arch-aarch64.yaml index 91d55917a..85d96e5c9 100644 --- a/conda/environments/all_cuda-122_arch-aarch64.yaml +++ b/conda/environments/all_cuda-122_arch-aarch64.yaml @@ -21,6 +21,7 @@ dependencies: - cupy>=12.0.0 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - doxygen>=1.8.20 - gcc_linux-aarch64=11.* - gmock>=1.13.0 diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index f27d131ff..16cc655c6 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -21,6 +21,7 @@ dependencies: - cupy>=12.0.0 - cxx-compiler - cython>=3.0.0 +- dlpack>=0.8,<1.0 - doxygen>=1.8.20 - gcc_linux-64=11.* - gmock>=1.13.0 diff --git a/dependencies.yaml b/dependencies.yaml index d7562ce57..c94a66535 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -88,6 +88,7 @@ dependencies: packages: - &cmake_ver cmake>=3.26.4 - cython>=3.0.0 + - dlpack>=0.8,<1.0 - ninja - output_types: [conda] packages: diff --git a/python/cuvs/CMakeLists.txt b/python/cuvs/CMakeLists.txt index a37528a1f..67a77c92a 100644 --- a/python/cuvs/CMakeLists.txt +++ b/python/cuvs/CMakeLists.txt @@ -33,11 +33,17 @@ project( C CXX CUDA ) +################################################################################ +# - User Options -------------------------------------------------------------- + option(FIND_CUVS_CPP "Search for existing CUVS C++ installations before defaulting to local files" - OFF + ON ) -message("- FIND_CUVS_CPP: ${FIND_CUVS_CPP}") +message("CUVS_PY: Searching for existing cuVS C/C++ installations before defaulting to local files: ${FIND_CUVS_CPP}") + +################################################################################ +# - Process User Options ------------------------------------------------------ include(../../fetch_rapids.cmake) include(rapids-cmake) @@ -70,6 +76,9 @@ if(NOT cuvs_FOUND) install(TARGETS cuvs cuvs_c DESTINATION ${cython_lib_dir}) endif() +################################################################################ +# - Build Cython artifacts ----------------------------------------------------- + rapids_cython_init() add_subdirectory(cuvs/common) diff --git a/python/cuvs/pyproject.toml b/python/cuvs/pyproject.toml index 664cf2969..d86011e21 100644 --- a/python/cuvs/pyproject.toml +++ b/python/cuvs/pyproject.toml @@ -18,6 +18,7 @@ requires = [ "cmake>=3.26.4", "cuda-python>=11.7.1,<12.0a0", "cython>=3.0.0", + "dlpack>=0.8,<1.0", "ninja", "pylibraft==24.4.*", "rmm==24.4.*",