Skip to content

Commit

Permalink
FIX Multiple cleanups and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dantegd committed Mar 6, 2024
1 parent a45a039 commit 9127684
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 46 deletions.
52 changes: 8 additions & 44 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
Results can be interpreted with cpp/scripts/analyze_nvcc_log.py
-h - print this text
default action (no args) is to build libcuvs, tests, cuvs and cuvs-dask targets
default action (no args) is to build libcuvs, tests and cuvs targets
"
LIBCUVS_BUILD_DIR=${LIBCUVS_BUILD_DIR:=${REPODIR}/cpp/build}
SPHINX_BUILD_DIR=${REPODIR}/docs
DOXYGEN_BUILD_DIR=${REPODIR}/cpp/doxygen
PYTHON_BUILD_DIR=${REPODIR}/python/cuvs/_skbuild
BUILD_DIRS="${LIBCUVS_BUILD_DIR} ${PYTHON_BUILD_DIR} ${CUVS_DASK_BUILD_DIR}"
BUILD_DIRS="${LIBCUVS_BUILD_DIR} ${PYTHON_BUILD_DIR}"

# Set defaults for vars modified by flags to this script
CMAKE_LOG_LEVEL=""
Expand Down Expand Up @@ -218,28 +218,6 @@ if hasArg --uninstall; then
echo "Could not uninstall cuvs from pip or conda. cuvs package will need to be manually uninstalled"
fi
fi

if hasArg cuvs-dask || (( ${NUMARGS} == 1 )); then
echo "Uninstalling cuvs-dask package..."
if [ -e ${CUVS_DASK_BUILD_DIR}/install_manifest.txt ]; then
xargs rm -fv < ${CUVS_DASK_BUILD_DIR}/install_manifest.txt > /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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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} \
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-122_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 11 additions & 2 deletions python/cuvs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions python/cuvs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand Down

0 comments on commit 9127684

Please sign in to comment.