From 339878d7d45bd73b1a9335024310ccf899fd7cab Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 6 Dec 2023 12:35:54 -0800 Subject: [PATCH] Remove RAFT_BUILD_WHEELS and standardize Python builds (#2040) Some minor simplification in advance of the scikit-build-core migration to better align wheel and non-wheel Python builds. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/raft/pull/2040 --- ci/build_wheel_pylibraft.sh | 2 +- ci/build_wheel_raft_dask.sh | 2 +- python/pylibraft/CMakeLists.txt | 13 ++----------- python/raft-dask/CMakeLists.txt | 13 ++----------- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/ci/build_wheel_pylibraft.sh b/ci/build_wheel_pylibraft.sh index f17f038675..48e20f597e 100755 --- a/ci/build_wheel_pylibraft.sh +++ b/ci/build_wheel_pylibraft.sh @@ -4,6 +4,6 @@ set -euo pipefail # Set up skbuild options. Enable sccache in skbuild config options -export SKBUILD_CONFIGURE_OPTIONS="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF" +export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF" ci/build_wheel.sh pylibraft python/pylibraft diff --git a/ci/build_wheel_raft_dask.sh b/ci/build_wheel_raft_dask.sh index ff89f4da23..cad09602dc 100755 --- a/ci/build_wheel_raft_dask.sh +++ b/ci/build_wheel_raft_dask.sh @@ -4,6 +4,6 @@ set -euo pipefail # Set up skbuild options. Enable sccache in skbuild config options -export SKBUILD_CONFIGURE_OPTIONS="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF" +export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF" ci/build_wheel.sh raft-dask python/raft-dask diff --git a/python/pylibraft/CMakeLists.txt b/python/pylibraft/CMakeLists.txt index 1109eb79cc..3b0417b850 100644 --- a/python/pylibraft/CMakeLists.txt +++ b/python/pylibraft/CMakeLists.txt @@ -37,8 +37,6 @@ option(FIND_RAFT_CPP "Search for existing RAFT C++ installations before defaulti ON ) -option(RAFT_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF) - # If the user requested it we attempt to find RAFT. if(FIND_RAFT_CPP) find_package(raft ${pylibraft_version} REQUIRED COMPONENTS compiled) @@ -60,16 +58,9 @@ if(NOT raft_FOUND) set(BUILD_PRIMS_BENCH OFF) set(BUILD_ANN_BENCH OFF) set(RAFT_COMPILE_LIBRARY ON) + set(CUDA_STATIC_RUNTIME ON) - set(_exclude_from_all "") - if(RAFT_BUILD_WHEELS) - # Statically link dependencies if building wheels - set(CUDA_STATIC_RUNTIME ON) - # Don't install the raft C++ targets into wheels - set(_exclude_from_all EXCLUDE_FROM_ALL) - endif() - - add_subdirectory(../../cpp raft-cpp ${_exclude_from_all}) + add_subdirectory(../../cpp raft-cpp EXCLUDE_FROM_ALL) # When building the C++ libraries from source we must copy libraft.so alongside the # pairwise_distance and random Cython libraries TODO: when we have a single 'compiled' raft diff --git a/python/raft-dask/CMakeLists.txt b/python/raft-dask/CMakeLists.txt index f6ebd4c7ef..0deed549a7 100644 --- a/python/raft-dask/CMakeLists.txt +++ b/python/raft-dask/CMakeLists.txt @@ -34,8 +34,6 @@ option(FIND_RAFT_CPP "Search for existing RAFT C++ installations before defaulti OFF ) -option(RAFT_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF) - # If the user requested it we attempt to find RAFT. if(FIND_RAFT_CPP) find_package(raft ${raft_dask_version} REQUIRED COMPONENTS distributed) @@ -54,16 +52,9 @@ if(NOT raft_FOUND) set(RAFT_COMPILE_LIBRARIES OFF) set(RAFT_COMPILE_DIST_LIBRARY OFF) set(RAFT_COMPILE_NN_LIBRARY OFF) + set(CUDA_STATIC_RUNTIME ON) - set(_exclude_from_all "") - if(RAFT_BUILD_WHEELS) - # Statically link dependencies if building wheels - set(CUDA_STATIC_RUNTIME ON) - # Don't install the raft C++ targets into wheels - set(_exclude_from_all EXCLUDE_FROM_ALL) - endif() - - add_subdirectory(../../cpp raft-cpp ${_exclude_from_all}) + add_subdirectory(../../cpp raft-cpp EXCLUDE_FROM_ALL) list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/cmake/find_modules) find_package(NCCL REQUIRED) endif()