Skip to content

Commit 4b95861

Browse files
committed
ref: build cuDF harness from source in CI
Fetch and build cuDF 26.04.00 through CMake instead of relying on a conda-provided libcudf. Update CI to use the CUDA 13.1 Ubuntu image, install CMake from apt, build with Ninja, and verify the release bundle runs with an $ORIGIN/lib RPATH.
1 parent 13b2af6 commit 4b95861

4 files changed

Lines changed: 74 additions & 46 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,65 @@
11
name: Build and Release
22

33
on:
4+
pull_request:
45
push:
56
tags:
67
- 'v*'
78
workflow_dispatch:
89

910
jobs:
1011
build:
12+
name: Build and Release
1113
runs-on: ubuntu-latest
1214
container:
13-
image: rapidsai/ci-conda:latest
15+
image: nvidia/cuda:13.1.0-devel-ubuntu24.04
1416

1517
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
19-
- name: Setup conda environment
18+
- name: Install build tools
2019
run: |
21-
conda create -n build-env -y -c rapidsai -c conda-forge -c nvidia \
22-
libcudf=26.04.00 \
20+
apt-get update
21+
apt-get install -y --no-install-recommends \
22+
ca-certificates \
23+
curl
24+
curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc -o /usr/share/keyrings/kitware-archive-keyring.asc
25+
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.asc] https://apt.kitware.com/ubuntu/ noble main' > /etc/apt/sources.list.d/kitware.list
26+
apt-get update
27+
apt-get install -y --no-install-recommends \
28+
build-essential \
2329
cmake \
24-
ninja \
25-
patchelf \
26-
gcc_linux-64 \
27-
gxx_linux-64
30+
git \
31+
ninja-build \
32+
tar \
33+
zlib1g-dev
34+
cmake --version
35+
/usr/local/cuda/bin/nvcc --version
36+
37+
- name: Checkout
38+
uses: actions/checkout@v4
2839

2940
- name: Build
30-
shell: bash -l {0}
3141
run: |
32-
source /opt/conda/etc/profile.d/conda.sh
33-
conda activate build-env
34-
mkdir build && cd build
35-
cmake -G Ninja \
42+
cmake -S . -B build -G Ninja \
3643
-DCMAKE_BUILD_TYPE=Release \
37-
-DBUILD_TEST_LIB=OFF \
38-
..
39-
ninja
44+
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
45+
-DBUILD_TEST_LIB=OFF
46+
cmake --build build
4047
4148
- name: Create bundle
42-
shell: bash -l {0}
4349
run: |
44-
source /opt/conda/etc/profile.d/conda.sh
45-
conda activate build-env
4650
chmod +x scripts/bundle.sh
4751
./scripts/bundle.sh
4852
53+
- name: Verify bundle
54+
run: |
55+
rm -rf /tmp/cudf-test-harness-bundle
56+
mkdir -p /tmp/cudf-test-harness-bundle
57+
tar -xzf build/bundle/cudf-test-harness-*.tar.gz -C /tmp/cudf-test-harness-bundle
58+
BINARY="$(echo /tmp/cudf-test-harness-bundle/*/cudf-test-harness)"
59+
readelf -d "$BINARY" | grep -F '$ORIGIN/lib'
60+
OUTPUT="$("$BINARY" 2>&1 || true)"
61+
echo "$OUTPUT" | grep 'Usage:'
62+
4963
- name: Upload artifact
5064
uses: actions/upload-artifact@v4
5165
with:

CLAUDE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ and a non-zero exit code should be returned.
2828

2929
## Building
3030

31-
Expect that this is being build in a CMake project, inside of a conda environment where the following has been run:
31+
Build with CMake:
3232

3333
```
34-
conda install -c rapidsai -c conda-forge -c nvidia rapidsai::libcudf
34+
cmake -S . -B build -G Ninja \
35+
-DCMAKE_BUILD_TYPE=Release \
36+
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
37+
-DBUILD_TEST_LIB=OFF
38+
cmake --build build
3539
```
3640

37-
The binary should build in debug mode with full debug symbols by default.
41+
The CMake configure step fetches and builds cuDF `26.04.00` from source, including the dependencies managed by cuDF's RAPIDS CMake files. This source-build path requires CMake 3.30.4 or newer and CUDA Toolkit 13.0 or newer. The binary builds in debug mode with full debug symbols by default when `CMAKE_BUILD_TYPE` is not set.
3842

3943
## Links
4044

CMakeLists.txt

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
cmake_minimum_required(VERSION 3.26)
1+
cmake_minimum_required(VERSION 3.30.4)
22

3-
project(cudf-test-harness LANGUAGES CXX CUDA)
3+
project(cudf-test-harness LANGUAGES C CXX CUDA)
44

55
# Default to Debug build with full debug symbols
66
if(NOT CMAKE_BUILD_TYPE)
@@ -9,13 +9,36 @@ endif()
99

1010
set(CMAKE_CXX_STANDARD 20)
1111
set(CMAKE_CXX_STANDARD_REQUIRED ON)
12+
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
1213

1314
# Debug flags
1415
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0")
1516
set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0")
1617

17-
# Find cuDF
18-
find_package(cudf REQUIRED)
18+
include(FetchContent)
19+
find_package(CUDAToolkit REQUIRED)
20+
21+
if(CUDAToolkit_VERSION VERSION_LESS 13.0)
22+
message(FATAL_ERROR "cuDF 26.04.00 source builds require CUDA Toolkit 13.0 or newer")
23+
endif()
24+
25+
foreach(option
26+
BUILD_TESTS
27+
BUILD_BENCHMARKS
28+
CUDF_BUILD_TESTUTIL
29+
CUDF_BUILD_STREAMS_TEST_UTIL
30+
CUDF_KVIKIO_REMOTE_IO
31+
)
32+
set(${option} OFF CACHE BOOL "Disabled for cudf-test-harness cuDF source build" FORCE)
33+
endforeach()
34+
35+
FetchContent_Declare(
36+
cudf
37+
GIT_REPOSITORY https://github.com/rapidsai/cudf.git
38+
GIT_TAG f9c3cf195768647ac39d98674a614ca414cd1baa
39+
SOURCE_SUBDIR cpp
40+
)
41+
FetchContent_MakeAvailable(cudf)
1942

2043
# Create the executable
2144
add_executable(cudf-test-harness
@@ -26,25 +49,21 @@ target_include_directories(cudf-test-harness PRIVATE
2649
${CMAKE_CURRENT_SOURCE_DIR}/include
2750
)
2851

29-
# Use the conda environment's libstdc++ to match cuDF
30-
# Must be linked before other libraries to override system libstdc++
3152
target_link_libraries(cudf-test-harness PRIVATE
32-
$ENV{CONDA_PREFIX}/lib/libstdc++.so
3353
cudf::cudf
3454
${CMAKE_DL_LIBS}
3555
)
3656

3757
# Set RPATH for bundled distribution (looks for libs relative to binary)
38-
# During build, also include conda lib path
3958
set_target_properties(cudf-test-harness PROPERTIES
40-
BUILD_RPATH "$ENV{CONDA_PREFIX}/lib"
4159
INSTALL_RPATH "$ORIGIN/lib"
4260
BUILD_WITH_INSTALL_RPATH OFF
4361
)
4462

4563
# Install target
4664
install(TARGETS cudf-test-harness
47-
RUNTIME DESTINATION bin
65+
RUNTIME DESTINATION .
66+
COMPONENT harness
4867
)
4968

5069
# Optional: Build test library

scripts/bundle.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ mkdir -p "$BUNDLE_PATH/lib"
2626

2727
echo "Collecting dependencies for $BINARY..."
2828

29-
# Copy the binary
30-
cp "$BINARY" "$BUNDLE_PATH/"
29+
# Install the binary so CMake applies the bundle RPATH.
30+
cmake --install "$BUILD_DIR" --prefix "$BUNDLE_PATH" --component harness
3131

3232
# Get all shared library dependencies (excluding system libraries we expect to exist)
3333
# We keep: libcu*, libnv*, librmm*, libcudf*, libarrow*, libstdc++, etc.
@@ -88,15 +88,6 @@ exec "${SCRIPT_DIR}/cudf-test-harness" "$@"
8888
WRAPPER_EOF
8989
chmod +x "$BUNDLE_PATH/cudf-test-harness.sh"
9090

91-
# Also patch the binary's rpath to look in ./lib (for direct execution)
92-
if command -v patchelf &> /dev/null; then
93-
echo "Patching rpath..."
94-
patchelf --set-rpath '$ORIGIN/lib' "$BUNDLE_PATH/cudf-test-harness"
95-
else
96-
echo "Warning: patchelf not found. Install it for direct binary execution."
97-
echo " Without it, use the wrapper script: ./cudf-test-harness.sh"
98-
fi
99-
10091
# Create tarball
10192
echo ""
10293
echo "Creating tarball..."

0 commit comments

Comments
 (0)