Skip to content

Commit 664be00

Browse files
committed
Apply jar-matched native dependency pins
Signed-off-by: liyuan <yuali@nvidia.com>
1 parent 71d544f commit 664be00

4 files changed

Lines changed: 27 additions & 12 deletions

File tree

examples/UDF-Examples/RAPIDS-accelerated-UDFs/extract-cudf-libs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
# RAPIDS4SPARK_VERSION - rapids-4-spark version (e.g., 26.08.0 or 26.08.0-SNAPSHOT)
3333
# SCALA_VERSION - Scala binary version (e.g., 2.12, 2.13)
3434
# CUDA_VERSION - CUDA version (e.g., cuda11, cuda12)
35-
# CUDF_BRANCH - cuDF git branch for headers (e.g., main, branch-26.06)
35+
# CUDF_BRANCH - cuDF git branch for headers (e.g., main, branch-26.08)
3636
#
3737
# Example with overrides:
38-
# RAPIDS4SPARK_VERSION=26.06.0 CUDA_VERSION=cuda11 ./extract-cudf-libs.sh
38+
# RAPIDS4SPARK_VERSION=26.08.0 CUDA_VERSION=cuda12 ./extract-cudf-libs.sh
3939
###############################################################################
4040

4141
set -e

examples/UDF-Examples/RAPIDS-accelerated-UDFs/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,20 @@
461461
<phase>compile</phase>
462462
<configuration>
463463
<target>
464+
<available file="${project.build.directory}/jar-native-deps.properties"
465+
property="jar.native.deps.properties.exists"/>
466+
<condition property="prebuilt.cudf.requested">
467+
<equals arg1="${USE_PREBUILT_CUDF}" arg2="ON"/>
468+
</condition>
469+
<fail if:set="prebuilt.cudf.requested"
470+
unless:set="jar.native.deps.properties.exists"
471+
xmlns:if="ant:if"
472+
xmlns:unless="ant:unless"
473+
message="Prebuilt cuDF requires ${project.build.directory}/jar-native-deps.properties. Run dependency extraction first or set USE_PREBUILT_CUDF=OFF."/>
464474
<property file="${project.build.directory}/jar-native-deps.properties"/>
475+
<property name="jar.rapids.cmake.sha" value="main"/>
476+
<property name="jar.rapids.cmake.file" value=""/>
477+
<property name="jar.cudf.pins.file" value=""/>
465478
<mkdir dir="${udf.native.build.path}"/>
466479
<exec dir="${udf.native.build.path}"
467480
failonerror="true"

examples/UDF-Examples/RAPIDS-accelerated-UDFs/resolve-jni-cudf-pins.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ if [ ! -f "$JAR_PATH" ]; then
3131
exit 1
3232
fi
3333

34+
if ! command -v python3 >/dev/null 2>&1; then
35+
echo "ERROR: python3 is required to read jar metadata and validate cudf-pins" >&2
36+
exit 1
37+
fi
38+
3439
mkdir -p "$PINS_DIR"
3540
mkdir -p "$(dirname "$PROPERTIES_FILE")"
3641

3742
read_property_from_jar() {
3843
local entry="$1"
3944
local property="$2"
40-
if command -v python3 >/dev/null 2>&1; then
41-
python3 - "$JAR_PATH" "$entry" "$property" <<'PY'
45+
python3 - "$JAR_PATH" "$entry" "$property" <<'PY'
4246
import sys
4347
import zipfile
4448
@@ -55,12 +59,6 @@ for line in data.splitlines():
5559
print(value)
5660
break
5761
PY
58-
elif command -v unzip >/dev/null 2>&1; then
59-
unzip -p "$JAR_PATH" "$entry" 2>/dev/null | awk -F= -v key="$property" '$1 == key {print $2; exit}'
60-
else
61-
echo "ERROR: python3 or unzip is required to read $entry from $JAR_PATH" >&2
62-
exit 1
63-
fi
6462
}
6563

6664
normalize_github_raw_base() {

examples/UDF-Examples/RAPIDS-accelerated-UDFs/src/main/cpp/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Keep the same with https://github.com/rapidsai/rapids-cmake/blob/main/RAPIDS.cmake
1818
cmake_minimum_required(VERSION 4.0 FATAL_ERROR)
1919

20-
set(RAPIDS_CMAKE_BRANCH "release/26.02" CACHE STRING
20+
set(RAPIDS_CMAKE_BRANCH "main" CACHE STRING
2121
"rapids-cmake branch, tag, or commit to use for native dependencies")
2222
set(RAPIDS_CMAKE_FILE "" CACHE FILEPATH
2323
"Path to a pre-downloaded RAPIDS.cmake entrypoint")
@@ -278,7 +278,11 @@ if(SHOULD_USE_PREBUILT)
278278
# First, let rapids-cpm fetch the dependencies that cuDF needs
279279
message(STATUS "Fetching cuDF dependencies (this may take a few minutes)...")
280280

281-
rapids_cpm_init()
281+
if(RAPIDS_CMAKE_CPM_OVERRIDE_VERSION_FILE)
282+
rapids_cpm_init(OVERRIDE "${RAPIDS_CMAKE_CPM_OVERRIDE_VERSION_FILE}")
283+
else()
284+
rapids_cpm_init()
285+
endif()
282286

283287
# Set options to avoid building unnecessary components
284288
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)

0 commit comments

Comments
 (0)