Skip to content

Commit

Permalink
Initial test at using scikit-build-core.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jul 25, 2023
1 parent 8efecbc commit 7200d8e
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ CUDA/GPU requirements:
You can obtain CUDA from [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads)

Python requirements:
* `scikit-build`
* `scikit-build-core`
* `cuda-python`
* `cython`

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ fi
# Build and install the rmm Python package
if (( NUMARGS == 0 )) || hasArg rmm; then
echo "building and installing rmm..."
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS}" python -m pip install --no-build-isolation --no-deps ${REPODIR}/python
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" python -m pip install --no-build-isolation --no-deps ${REPODIR}/python
fi
2 changes: 1 addition & 1 deletion ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ git diff

cd python

SKBUILD_CONFIGURE_OPTIONS="-DRMM_BUILD_WHEELS=ON" python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check
SKBUILD_CMAKE_ARGS="-DRMM_BUILD_WHEELS=ON" python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check

mkdir -p final_dist
python -m auditwheel repair -w final_dist dist/*
Expand Down
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- scikit-build-core
- spdlog>=1.11.0,<1.12
- tomli
name: all_cuda-118_arch-x86_64
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- scikit-build-core
- spdlog>=1.11.0,<1.12
- tomli
name: all_cuda-120_arch-x86_64
5 changes: 3 additions & 2 deletions conda/recipes/rmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ build:

requirements:
build:
# TODO: See discussion in https://github.com/conda-forge/scikit-build-feedstock/issues/69,
# should cmake/ninja be in this section or in host?
- cmake {{ cmake_version }}
- ninja
- {{ compiler('c') }}
Expand All @@ -61,8 +63,7 @@ requirements:
- cython >=0.29,<0.30
- librmm ={{ version }}
- python
- scikit-build >=0.13.1
- setuptools >=61.0.0
- scikit-build-core
- tomli # [py<311]
run:
{% if cuda_major == "11" %}
Expand Down
11 changes: 3 additions & 8 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,15 @@ dependencies:
common:
- output_types: [conda, requirements, pyproject]
packages:
- &cmake_ver cmake>=3.26.4
- cython>=0.29,<0.30
- ninja
- scikit-build>=0.13.1
- tomli
- scikit-build-core
- output_types: conda
packages:
- &cmake_ver cmake>=3.26.4
- ninja
- fmt>=9.1.0,<10
- spdlog>=1.11.0,<1.12
- python>=3.9,<3.11
- output_types: pyproject
packages:
- wheel
- setuptools>=61.0.0
specific:
- output_types: conda
matrices:
Expand Down
10 changes: 4 additions & 6 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

set(rmm_version 23.10.00)

set(rapids-cmake-repo "vyasr/rapids-cmake")
set(rapids-cmake-branch "feat/scikit-build-core")
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)

project(
rmm-python
VERSION ${rmm_version}
LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C
# language to be enabled here. The test project that is built in scikit-build to verify
# various linking options for the python library is hardcoded to build with C, so until
# that is fixed we need to keep C.
C CXX)
LANGUAGES CXX)

option(FIND_RMM_CPP "Search for existing RMM C++ installations before defaulting to local files"
OFF)
Expand Down Expand Up @@ -55,7 +53,7 @@ if(NOT rmm_FOUND)
add_subdirectory(../ rmm-cpp ${_exclude_from_all})
endif()

include(rapids-cython)
include(rapids-cython-core)
rapids_cython_init()

add_subdirectory(rmm/_cuda)
Expand Down
18 changes: 9 additions & 9 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
# limitations under the License.

[build-system]
build-backend = "setuptools.build_meta"
build-backend = "scikit_build_core.build"
requires = [
"cmake>=3.26.4",
"cuda-python>=11.7.1,<12.0a0",
"cython>=0.29,<0.30",
"ninja",
"scikit-build>=0.13.1",
"setuptools>=61.0.0",
"tomli",
"wheel",
"scikit-build-core",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`.

[project]
Expand Down Expand Up @@ -112,5 +107,10 @@ skip = [
"__init__.py",
]

[tool.setuptools]
license-files = ["LICENSE"]
[tool.scikit-build]
# TODO: There doesn't appear to be any way to be more specific about requirements, i.e. we can't skip specific versions if they are broken.
cmake.minimum-version = "3.23.1"
ninja.make-fallback = true
cmake.build-type = "Release"
sdist.reproducible = true
wheel.packages = ["rmm"]
11 changes: 0 additions & 11 deletions python/setup.py

This file was deleted.

0 comments on commit 7200d8e

Please sign in to comment.