Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wheel builds #12096

Merged
merged 146 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
bffc81d
Add initial cibuildwheel workflow
sevagh Jul 29, 2022
65e2fe4
Install cupy for cudf smoke test
sevagh Aug 19, 2022
80b5f94
Switch to pyarrow==9.0.0
sevagh Aug 24, 2022
b9278ab
Add pyarrow smoke test
sevagh Aug 25, 2022
2f4a1f5
Unit tests during cibuildwheel
sevagh Aug 25, 2022
abb25ec
DRY wheel workflow with unit tests
sevagh Aug 29, 2022
41ff0af
Add wheel pattern override
sevagh Aug 29, 2022
4a58cc8
Run CPP unit tests with _venv_placeholder
sevagh Aug 29, 2022
75657d4
Install libprotobuf-dev before unit test
sevagh Aug 29, 2022
744c92b
Debug stub issue
sevagh Aug 29, 2022
da7403c
Install tokenizers==0.10.2 to avoid Rust PEP517 compile
sevagh Aug 30, 2022
4323999
Retrigger build
sevagh Aug 30, 2022
738768d
Build dask_cudf
sevagh Aug 31, 2022
2f5b83e
Rebuild all
sevagh Aug 31, 2022
72d793b
Switch from -cuda11 to -cu11 suffix
sevagh Sep 1, 2022
db601d3
Run all gtests for libcudf
sevagh Sep 1, 2022
ea2a171
Change libcudf package-name
sevagh Sep 7, 2022
c66c85d
Don't auditwheel-repair cudf, see what happens
sevagh Sep 7, 2022
6a65eb5
Don't waste time rebuilding libcudf
sevagh Sep 7, 2022
bf9a754
Uncomment libcudf
sevagh Sep 7, 2022
60e4517
Don't need to unpack python static libs if avoiding building pyarrow …
sevagh Sep 7, 2022
00a1751
WIP
trxcllnt Sep 12, 2022
04a0ac6
remove print debugging
trxcllnt Sep 13, 2022
d8f7b3c
use the old ABI because arrow
trxcllnt Sep 14, 2022
c95738c
update github action to only build cudf wheel
trxcllnt Sep 14, 2022
fae72de
set include_package_data=True for scikit-build
trxcllnt Sep 14, 2022
aa42c14
remove cibw-environment from workflow that doesn't define it
trxcllnt Sep 14, 2022
4305233
add cudf to dask_cudf's install_requires
trxcllnt Sep 14, 2022
d463e1a
switch action repo back to rapidsai
trxcllnt Sep 15, 2022
544b341
pass env on a single line
trxcllnt Sep 15, 2022
db0487f
single line all the things
trxcllnt Sep 15, 2022
50fc10a
set python-package-cuda-suffix for dask-cudf
trxcllnt Sep 15, 2022
fd4fd49
install protoc from apt
trxcllnt Sep 15, 2022
9039700
check if multiple copies of libcuda.so are in the image on the CI runner
trxcllnt Sep 15, 2022
8ac6309
add syntax for protoc
trxcllnt Sep 15, 2022
5d1770c
print ldconfig, set ld_library_path before running tests
trxcllnt Sep 15, 2022
cb805f6
apt install protobuf-compiler because 3.8 is doing something odd
trxcllnt Sep 15, 2022
2e02df1
do protoc in CMake
trxcllnt Sep 15, 2022
d32b4f9
put /usr/lib/<arch>-linux-gnu in front of LD_LIBRARY_PATH in tests
trxcllnt Sep 15, 2022
4e002b7
fix typo
trxcllnt Sep 15, 2022
8475336
pin to numpy<1.23
trxcllnt Sep 16, 2022
ecf6e65
pin mimesis<4.1 and install tzdata
trxcllnt Sep 16, 2022
adf226b
formatting
trxcllnt Sep 16, 2022
88a91ae
define ld_library_path for the dask_cudf gpu smoketest
trxcllnt Sep 16, 2022
b74adbd
do syntax differently
trxcllnt Sep 16, 2022
1b42a4d
Try to build cuDF with manylinux_2_27
sevagh Sep 19, 2022
7ddc54c
Use different manylinux for x86, aarch64
sevagh Sep 20, 2022
0273d63
Upgrade pandas to 1.5 in setup.py
sevagh Sep 21, 2022
b9bd5bf
Switch to unified workflow for both arches
sevagh Sep 21, 2022
508b9e4
Can only test 2_31 aarch64 wheel on 2_31
sevagh Sep 21, 2022
39a6054
Switch to new parameter names
sevagh Sep 22, 2022
a28293e
Add platform specifier for CuPy dependency
sevagh Sep 23, 2022
35a4315
rapids-cmake PR #276 fixes this
sevagh Sep 27, 2022
9bb1109
Typo: RAPID_ -> RAPIDS_
sevagh Sep 27, 2022
55eb9e3
Override versioneer with env var
sevagh Sep 28, 2022
4338b61
Also override version of dask-cudf
sevagh Sep 28, 2022
a95bfa5
Testing build-tag incrementer
sevagh Sep 28, 2022
b0256c0
Testing build-tag incrementer
sevagh Sep 29, 2022
c08095b
Manually set -0- build tag
sevagh Sep 29, 2022
b994c45
Merge remote-tracking branch 'upstream/branch-22.10' into feat/cibuil…
sevagh Oct 3, 2022
c450202
Bump build-tag and add LICENSE files
sevagh Oct 3, 2022
e68fe6d
Typo in dask-cudf setup.py
sevagh Oct 3, 2022
10cef13
Add ptxcompiler and cubinlinker to cuDF install_requires
sevagh Oct 4, 2022
572f67a
Install ptxcompiler and cubinlinker in pre-test step
sevagh Oct 4, 2022
5632cd2
Merge remote-tracking branch 'origin/branch-22.10' into feat/cibuildw…
vyasr Oct 10, 2022
c09012a
Bump build tag.
vyasr Oct 10, 2022
d11625a
Add dask_cudf wheels back.
vyasr Oct 10, 2022
40ea0e3
Fix indentation.
vyasr Oct 10, 2022
8080fb8
Add concurrency rules so prior runs are canceled.
vyasr Oct 10, 2022
7e5dcf0
Bump build tag.
vyasr Oct 11, 2022
a09f081
Fix style.
vyasr Oct 11, 2022
9cc87e9
Bump cudf to use new ptxcompiler/cubinlinker
sevagh Oct 12, 2022
b645233
Centralized logic in used workflow.
vyasr Oct 13, 2022
b2192de
Also remove PIP_INDEX_URL.
vyasr Oct 13, 2022
e1d12bd
Bump build tag
sevagh Oct 13, 2022
d659c77
Add missing CUDF_BUILD_WHEELS=1 option
sevagh Oct 13, 2022
d837781
Bump build tags for x86_64 runners
sevagh Oct 13, 2022
7325033
Bump build tags for x86_64 runners
sevagh Oct 13, 2022
1558403
Clean rebuild for stable version 22.10.00
sevagh Oct 17, 2022
16c402a
Merge remote-tracking branch 'origin/branch-22.12' into feat/cibuildw…
vyasr Nov 8, 2022
52b1d2f
Remove LICENSE files.
vyasr Nov 8, 2022
653031c
Symlink license files.
vyasr Nov 8, 2022
a15516d
Rename the C++ option for disabling test utils to be more explicit.
vyasr Nov 8, 2022
a688ede
Revert unnecessary change to arrow files.
vyasr Nov 8, 2022
202b5e5
Update version.
vyasr Nov 8, 2022
fee22f4
Revert redundant EXCLUDE_FROM_ALL.
vyasr Nov 8, 2022
f592969
Clean up some of the Python CMake logic.
vyasr Nov 8, 2022
48d1b58
Add back dropped EXCLUDE_FROM_ALL.
vyasr Nov 8, 2022
881ca43
Match new library location for arrow.
vyasr Nov 9, 2022
b379d51
Update required versions and remove now unnecessary CUDA versioning c…
vyasr Nov 9, 2022
4fcd35e
Temporarily revert cuda-python update.
vyasr Nov 9, 2022
8d5ab49
Try removing potentially unnecessary flags.
vyasr Nov 9, 2022
7ec36ff
Put back the global targets flag for nvcomp.
vyasr Nov 9, 2022
2ff487d
Revert "Temporarily revert cuda-python update."
vyasr Nov 9, 2022
f0a71de
Fix style.
vyasr Nov 10, 2022
8ec10b1
Update to new workflow script.
vyasr Nov 10, 2022
568b65d
Add back push workflow for now to keep testing.
vyasr Nov 10, 2022
7d69dbe
Update all fields.
vyasr Nov 10, 2022
502c372
Temporarily comment out dask_cudf workflow since pure needs to be add…
vyasr Nov 10, 2022
89afdfb
Fix typo in repo.
vyasr Nov 10, 2022
0339b59
Set cupy-cuda11x in dask-cudf.
vyasr Nov 10, 2022
163ddd3
Fix build type for testing.
vyasr Nov 14, 2022
60d6284
Enable dask-cudf tests.
vyasr Nov 14, 2022
022a319
Fix whitespace.
vyasr Nov 14, 2022
d354b38
Test commit.
vyasr Nov 14, 2022
d93bb69
Undo test.
vyasr Nov 14, 2022
4d3badc
Merge remote-tracking branch 'origin/branch-22.12' into feat/cibuildw…
vyasr Nov 14, 2022
82d2f6a
Add missing license file.
vyasr Nov 14, 2022
6d8ac44
Remove setup_requires.
vyasr Nov 14, 2022
4915a1a
Put back setup_requires.
vyasr Nov 14, 2022
aa4e802
Remove redundant cudf requirement and also clean up dask test require…
vyasr Nov 14, 2022
88eb81a
Temporarily set cuda suffix until wheel is updated.
vyasr Nov 14, 2022
dd6aacb
Add pytest-xdist for dask_cudf.
vyasr Nov 15, 2022
1ca15fe
Add cupy requirements by arch to install_requires.
vyasr Nov 15, 2022
79b8946
Try removing requests and tokenizers.
vyasr Nov 15, 2022
8d8743d
Try removing Python static libs.
vyasr Nov 15, 2022
3ec9b2e
Revert "Add cupy requirements by arch to install_requires."
vyasr Nov 15, 2022
b9b79f2
Revert "Revert "Add cupy requirements by arch to install_requires.""
vyasr Nov 15, 2022
9d901ba
Try avoiding static libs explicitly.
vyasr Nov 15, 2022
a490a0f
Fix cupy.
vyasr Nov 15, 2022
7cf6995
Debug find.
vyasr Nov 15, 2022
5f1e8c6
Hint properly.
vyasr Nov 15, 2022
00f36e0
Put back libs for now.
vyasr Nov 15, 2022
8ccfe53
Remove dependency installation since that should be automated with a …
vyasr Nov 15, 2022
ce91f54
Remove hint.
vyasr Nov 15, 2022
6e14318
Try switching to FindNumpy.cmake.
vyasr Nov 15, 2022
2ce8292
Remove libraries again.
vyasr Nov 15, 2022
572aea7
Extend comment about FindPython.cmake.
vyasr Nov 15, 2022
21b0c29
Remove suffix specification.
vyasr Nov 15, 2022
b135b7f
Add cupy install to arm.
vyasr Nov 15, 2022
51b653e
Switch to the modern solution for dynamic dependencies.
vyasr Nov 15, 2022
938c3d7
Hardcode repo name in concurrency group
sevagh Nov 15, 2022
98f59a4
Use feat/pure-python-wheels branch of cibw
sevagh Nov 15, 2022
789a535
Install tokenizers==0.10.2 for aarch64 to avoid Rust compile
sevagh Nov 15, 2022
4b8d62d
Fix pip install command in test-before
sevagh Nov 16, 2022
5e1f094
Fix style.
vyasr Nov 16, 2022
f2e5617
Try removing numpy pin.
vyasr Nov 16, 2022
5842b73
Revert numba version change.
vyasr Nov 16, 2022
fb2dc7a
Address PR reviews.
vyasr Nov 16, 2022
f638b3c
Use RAPIDS_PY_WHEEL_CUDA_SUFFIX instead of PYTHON_PACKAGE_CUDA_SUFFIX
sevagh Nov 16, 2022
dad0760
Use main branch of shared-action-workflows
sevagh Nov 17, 2022
cb144a5
Patch __version__ to match wheel version
sevagh Nov 17, 2022
6088862
Apply __version__ fix to dask-cudf also
sevagh Nov 17, 2022
e7a291f
Use patched versioneer.get_version
sevagh Nov 17, 2022
e6d91ec
Complain if RAPIDS_PY_WHEEL_VERSIONEER_OVERRIDE is set but empty
sevagh Nov 17, 2022
882746a
Remove pull-request push trigger
sevagh Nov 17, 2022
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
77 changes: 77 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: cuDF wheels

on:
workflow_call:
inputs:
versioneer-override:
type: string
default: ''
build-tag:
type: string
default: ''
branch:
required: true
type: string
date:
required: true
type: string
sha:
required: true
type: string
build-type:
type: string
default: nightly

concurrency:
group: "cudf-${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
cudf-wheels:
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux.yml@main
with:
repo: rapidsai/cudf

build-type: ${{ inputs.build-type }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}

package-dir: python/cudf
package-name: cudf

python-package-versioneer-override: ${{ inputs.versioneer-override }}
python-package-build-tag: ${{ inputs.build-tag }}

skbuild-configure-options: "-DCUDF_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF"

test-extras: test

# Have to manually specify the cupy install location on arm.
# Have to also manually install tokenizers==0.10.2, which is the last tokenizers
# to have a binary aarch64 wheel available on PyPI
# Otherwise, the tokenizers sdist is used, which needs a Rust compiler
test-before-arm64: "pip install tokenizers==0.10.2 cupy-cuda11x -f https://pip.cupy.dev/aarch64"

test-unittest: "pytest -v -n 8 ./python/cudf/cudf/tests"
vyasr marked this conversation as resolved.
Show resolved Hide resolved
secrets: inherit
dask_cudf-wheel:
needs: cudf-wheels
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-pure.yml@main
with:
repo: rapidsai/cudf

build-type: ${{ inputs.build-type }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}

package-dir: python/dask_cudf
package-name: dask_cudf

python-package-versioneer-override: ${{ inputs.versioneer-override }}
python-package-build-tag: ${{ inputs.build-tag }}

test-extras: test
test-unittest: "pytest -v -n 8 ./python/dask_cudf/dask_cudf/tests"
secrets: inherit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,6 @@ docs/cudf/source/api_docs/generated/*
docs/cudf/source/api_docs/api/*
docs/cudf/source/user_guide/example_output/*
docs/cudf/source/user_guide/cudf.*Dtype.*.rst

# cibuildwheel
/wheelhouse
150 changes: 84 additions & 66 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ option(BUILD_TESTS "Configure CMake to build tests" ON)
option(BUILD_BENCHMARKS "Configure CMake to build (google & nvbench) benchmarks" OFF)
option(BUILD_SHARED_LIBS "Build cuDF shared libraries" ON)
option(JITIFY_USE_CACHE "Use a file cache for JIT compiled kernels" ON)
option(CUDF_BUILD_TESTUTIL "Whether to build the test utilities contained in libcudf" ON)
vyasr marked this conversation as resolved.
Show resolved Hide resolved
mark_as_advanced(CUDF_BUILD_TESTUTIL)
option(CUDF_USE_PROPRIETARY_NVCOMP "Download and use NVCOMP with proprietary extensions" ON)
option(CUDF_USE_ARROW_STATIC "Build and statically link Arrow libraries" OFF)
option(CUDF_ENABLE_ARROW_ORC "Build the Arrow ORC adapter" OFF)
Expand Down Expand Up @@ -94,6 +96,12 @@ message(VERBOSE "CUDF: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}"
rapids_cmake_build_type("Release")
set(CUDF_BUILD_TESTS ${BUILD_TESTS})
set(CUDF_BUILD_BENCHMARKS ${BUILD_BENCHMARKS})
if(BUILD_TESTS AND NOT CUDF_BUILD_TESTUTIL)
message(
FATAL_ERROR
"Tests cannot be built without building cudf test utils. Please set CUDF_BUILD_TESTUTIL=ON or BUILD_TESTS=OFF"
)
endif()

set(CUDF_CXX_FLAGS "")
set(CUDF_CUDA_FLAGS "")
Expand Down Expand Up @@ -133,12 +141,14 @@ include(cmake/Modules/ConfigureCUDA.cmake) # set other CUDA compilation flags
# find zlib
rapids_find_package(ZLIB REQUIRED)

# find Threads (needed by cudftestutil)
rapids_find_package(
Threads REQUIRED
BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
)
if(CUDF_BUILD_TESTUTIL)
# find Threads (needed by cudftestutil)
rapids_find_package(
Threads REQUIRED
BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
)
endif()

# add third party dependencies using CPM
rapids_cpm_init()
Expand All @@ -160,7 +170,9 @@ rapids_cpm_libcudacxx(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-expo
# find cuCollections Should come after including thrust and libcudacxx
include(cmake/thirdparty/get_cucollections.cmake)
# find or install GoogleTest
include(cmake/thirdparty/get_gtest.cmake)
if(CUDF_BUILD_TESTUTIL)
include(cmake/thirdparty/get_gtest.cmake)
endif()
# preprocess jitify-able kernels
include(cmake/Modules/JitifyPreprocessKernels.cmake)
# find cuFile
Expand Down Expand Up @@ -693,46 +705,48 @@ add_library(cudf::cudf ALIAS cudf)
# ##################################################################################################
# * build cudftestutil ----------------------------------------------------------------------------

add_library(
cudftestutil STATIC
tests/io/metadata_utilities.cpp
tests/utilities/base_fixture.cpp
tests/utilities/column_utilities.cu
tests/utilities/table_utilities.cu
tests/utilities/tdigest_utilities.cu
)
if(CUDF_BUILD_TESTUTIL)
add_library(
cudftestutil STATIC
tests/io/metadata_utilities.cpp
tests/utilities/base_fixture.cpp
tests/utilities/column_utilities.cu
tests/utilities/table_utilities.cu
tests/utilities/tdigest_utilities.cu
)

set_target_properties(
cudftestutil
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
)
set_target_properties(
cudftestutil
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
)

target_compile_options(
cudftestutil PUBLIC "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>>"
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>>"
)
target_compile_options(
cudftestutil PUBLIC "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>>"
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>>"
)

target_link_libraries(
cudftestutil
PUBLIC GTest::gmock GTest::gtest Threads::Threads cudf
PRIVATE $<TARGET_NAME_IF_EXISTS:conda_env>
)
target_link_libraries(
cudftestutil
PUBLIC GTest::gmock GTest::gtest Threads::Threads cudf
PRIVATE $<TARGET_NAME_IF_EXISTS:conda_env>
)

target_include_directories(
cudftestutil PUBLIC "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>"
)
target_include_directories(
cudftestutil PUBLIC "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>"
)

add_library(cudf::cudftestutil ALIAS cudftestutil)
add_library(cudf::cudftestutil ALIAS cudftestutil)

endif()
# ##################################################################################################
# * add tests -------------------------------------------------------------------------------------

Expand Down Expand Up @@ -787,24 +801,26 @@ install(DIRECTORY ${CUDF_SOURCE_DIR}/include/cudf ${CUDF_SOURCE_DIR}/include/cud
${CUDF_SOURCE_DIR}/include/nvtext DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
TARGETS cudftestutil
DESTINATION ${lib_dir}
EXPORT cudf-testing-exports
)
if(CUDF_BUILD_TESTUTIL)
install(
TARGETS cudftestutil
DESTINATION ${lib_dir}
EXPORT cudf-testing-exports
)

install(
EXPORT cudf-testing-exports
FILE cudf-testing-targets.cmake
NAMESPACE cudf::
DESTINATION "${lib_dir}/cmake/cudf"
)
install(
EXPORT cudf-testing-exports
FILE cudf-testing-targets.cmake
NAMESPACE cudf::
DESTINATION "${lib_dir}/cmake/cudf"
)

include("${rapids-cmake-dir}/export/write_dependencies.cmake")
rapids_export_write_dependencies(
INSTALL cudf-testing-exports
"${PROJECT_BINARY_DIR}/rapids-cmake/cudf/export/cudf-testing-dependencies.cmake"
)
include("${rapids-cmake-dir}/export/write_dependencies.cmake")
rapids_export_write_dependencies(
INSTALL cudf-testing-exports
"${PROJECT_BINARY_DIR}/rapids-cmake/cudf/export/cudf-testing-dependencies.cmake"
)
endif()

set(doc_string
[=[
Expand Down Expand Up @@ -894,6 +910,7 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/cudf-testing-targets.cmake")
endif()
]=]
)

string(APPEND build_code_string "${common_code_string}")

rapids_export(
Expand All @@ -905,15 +922,16 @@ rapids_export(
FINAL_CODE_BLOCK build_code_string
)

export(
EXPORT cudf-testing-exports
FILE ${CUDF_BINARY_DIR}/cudf-testing-targets.cmake
NAMESPACE cudf::
)
rapids_export_write_dependencies(
BUILD cudf-testing-exports "${CUDF_BINARY_DIR}/cudf-testing-dependencies.cmake"
)

if(CUDF_BUILD_TESTUTIL)
export(
EXPORT cudf-testing-exports
FILE ${CUDF_BINARY_DIR}/cudf-testing-targets.cmake
NAMESPACE cudf::
)
rapids_export_write_dependencies(
BUILD cudf-testing-exports "${CUDF_BINARY_DIR}/cudf-testing-dependencies.cmake"
)
endif()
# ##################################################################################################
# * make documentation ----------------------------------------------------------------------------

Expand Down
32 changes: 31 additions & 1 deletion python/cudf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ project(
option(FIND_CUDF_CPP "Search for existing CUDF C++ installations before defaulting to local files"
OFF
)
option(CUDF_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF)
option(USE_LIBARROW_FROM_PYARROW "Use the libarrow contained within pyarrow." OFF)
mark_as_advanced(USE_LIBARROW_FROM_PYARROW)

# Always build wheels against the pyarrow libarrow.
if(CUDF_BUILD_WHEELS)
set(USE_LIBARROW_FROM_PYARROW ON)
endif()

# If the user requested it we attempt to find CUDF.
if(FIND_CUDF_CPP)
if(USE_LIBARROW_FROM_PYARROW)
Expand Down Expand Up @@ -69,8 +75,32 @@ if(NOT cudf_FOUND)

set(BUILD_TESTS OFF)
set(BUILD_BENCHMARKS OFF)
add_subdirectory(../../cpp cudf-cpp)

set(_exclude_from_all "")
if(CUDF_BUILD_WHEELS)
# We don't build C++ tests when building wheels, so we can also omit the test util and shrink
# the wheel by avoiding embedding GTest.
set(CUDF_BUILD_TESTUTIL OFF)

# Statically link cudart if building wheels
set(CUDA_STATIC_RUNTIME ON)

# Need to set this so all the nvcomp targets are global, not only nvcomp::nvcomp
# https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_TARGETS_GLOBAL.html#variable:CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON)

# Don't install the cuDF C++ targets into wheels
set(_exclude_from_all EXCLUDE_FROM_ALL)
endif()

add_subdirectory(../../cpp cudf-cpp ${_exclude_from_all})

if(CUDF_BUILD_WHEELS)
include(cmake/Modules/WheelHelpers.cmake)
get_target_property(_nvcomp_link_libs nvcomp::nvcomp INTERFACE_LINK_LIBRARIES)
# Ensure all the shared objects we need at runtime are in the wheel
add_target_libs_to_wheel(LIB_DIR cudf TARGETS arrow_shared nvcomp::nvcomp ${_nvcomp_link_libs})
endif()
# Since there are multiple subpackages of cudf._lib that require access to libcudf, we place the
# library in the cudf directory as a single source of truth and modify the other rpaths
# appropriately.
Expand Down
1 change: 1 addition & 0 deletions python/cudf/LICENSE
37 changes: 37 additions & 0 deletions python/cudf/_custom_build/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2022, NVIDIA CORPORATION.

"""Custom build backend for cudf to get versioned requirements.

Based on https://setuptools.pypa.io/en/latest/build_meta.html
"""
import os
from functools import wraps

from setuptools import build_meta as _orig

# Alias the required bits
build_wheel = _orig.build_wheel
build_sdist = _orig.build_sdist


def replace_requirements(func):
@wraps(func)
def wrapper(config_settings=None):
orig_list = getattr(_orig, func.__name__)(config_settings)
append_list = [
f"rmm{os.getenv('RAPIDS_PY_WHEEL_CUDA_SUFFIX', default='')}"
]
return orig_list + append_list

return wrapper


get_requires_for_build_wheel = replace_requirements(
_orig.get_requires_for_build_wheel
)
get_requires_for_build_sdist = replace_requirements(
_orig.get_requires_for_build_sdist
)
get_requires_for_build_editable = replace_requirements(
_orig.get_requires_for_build_editable
)
Loading