Skip to content

Commit 01372ba

Browse files
authored
Merge pull request #3 from vortex-data/ad/clean-up-build
ref: build cuDF harness from source in CI
2 parents 13b2af6 + edf46fd commit 01372ba

5 files changed

Lines changed: 132 additions & 85 deletions

File tree

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build and Release
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- '*'
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build and Release
13+
runs-on: runs-on=${{ github.run_id }}/runner=gpu/tag=cudf-test-harness
14+
container:
15+
image: nvidia/cuda:13.1.0-devel-ubuntu24.04
16+
17+
steps:
18+
- uses: runs-on/action@v2
19+
with:
20+
sccache: s3
21+
22+
- name: Configure sccache timeout
23+
run: |
24+
mkdir -p ~/.config/sccache
25+
echo 'server_startup_timeout_ms = 60000' > ~/.config/sccache/config
26+
27+
- name: Install sccache
28+
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
29+
30+
- name: Pre-start sccache server
31+
run: sccache --start-server
32+
33+
- name: Install build tools
34+
run: |
35+
apt-get update
36+
apt-get install -y --no-install-recommends \
37+
ca-certificates \
38+
curl
39+
curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc -o /usr/share/keyrings/kitware-archive-keyring.asc
40+
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
41+
apt-get update
42+
apt-get install -y --no-install-recommends \
43+
build-essential \
44+
cmake \
45+
git \
46+
ninja-build \
47+
tar \
48+
zlib1g-dev
49+
cmake --version
50+
/usr/local/cuda/bin/nvcc --version
51+
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Build
56+
run: |
57+
cmake -S . -B build -G Ninja \
58+
-DCMAKE_BUILD_TYPE=Release \
59+
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
60+
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
61+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
62+
-DCMAKE_CUDA_COMPILER_LAUNCHER=sccache \
63+
-DBUILD_TEST_LIB=OFF
64+
cmake --build build
65+
66+
- name: Create bundle
67+
run: |
68+
chmod +x scripts/bundle.sh
69+
./scripts/bundle.sh
70+
71+
- name: Verify bundle
72+
run: |
73+
rm -rf /tmp/cudf-test-harness-bundle
74+
mkdir -p /tmp/cudf-test-harness-bundle
75+
tar -xzf build/bundle/cudf-test-harness-*.tar.gz -C /tmp/cudf-test-harness-bundle
76+
BINARY="$(echo /tmp/cudf-test-harness-bundle/*/cudf-test-harness)"
77+
readelf -d "$BINARY" | grep -F '$ORIGIN/lib'
78+
OUTPUT="$("$BINARY" 2>&1 || true)"
79+
echo "$OUTPUT" | grep 'Usage:'
80+
81+
- name: Upload artifact
82+
if: startsWith(github.ref, 'refs/tags/')
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: cudf-test-harness-linux-x86_64
86+
path: build/bundle/*.tar.gz
87+
88+
- name: Release
89+
if: startsWith(github.ref, 'refs/tags/')
90+
uses: softprops/action-gh-release@v1
91+
with:
92+
files: build/bundle/*.tar.gz
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

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)