Skip to main content

build-test-cudf-java

Build and test cudf Java bindings (cudf-java) inside a cudf devcontainer. Use when the user asks to build, compile, or test Java code in the cudf repository.

来源信息

仓库
NVIDIA/cudf
最近来源活动
2026年8月17日 19:29
检测到的 SKILL.md 语言
英语
星标
9,776
分支
1,130

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
3 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
build-test-cudf-java
description
Build and test cudf Java bindings (cudf-java) inside a cudf devcontainer. Use when the user asks to build, compile, or test Java code in the cudf repository.
# Build and Test cudf-java ## Prerequisites ### JDK and Maven Ensure JDK (17+) and Maven are installed: ```bash java -version && mvn --version ``` If either is missing, detect the OS and install using the appropriate package manager. Hints: - **Debian/Ubuntu** (`apt`): `sudo apt-get update -qq && sudo apt-get install -y -qq default-jdk maven` - **Fedora/RHEL** (`dnf`): `sudo dnf install -y java-17-openjdk-devel maven` - **Arch** (`pacman`): `sudo pacman -S --noconfirm jdk17-openjdk maven` - **macOS** (`brew`): `brew install openjdk@17 maven` Detect the OS by checking which package manager is available (e.g. `command -v apt-get`, `command -v dnf`, etc.) and use the matching command. Run all Maven commands below from the `java/` directory. ## Choose a libcudf provider Prefer the installed nightly package when the changes are limited to Java or JNI and the user has not requested a libcudf source rebuild: - [Build JNI against an installed nightly libcudf](references/nightly-libcudf.md), then continue at [Running Java tests](#running-java-tests). Use a local libcudf source build when the changes affect libcudf, require unreleased libcudf headers or symbols, no compatible nightly exists, or the user explicitly requests a source build: - [Build JNI against a local libcudf build](references/local-libcudf.md), then continue at [Running Java tests](#running-java-tests). ## Running Java tests **Always run `mvn install $MVN_COMMON_OPTS -DskipTests` first** before running tests. The `mvn test` goal re-triggers the cmake/native build step. If `target/cmake-build` already contains fully built artifacts from a prior `mvn install`, this is an incremental no-op. But if the cmake-build directory was cleaned or is missing, `mvn test` may hit a race condition where the linker tries to link `libcudfjni.so` before `libarrow.a` is fully built, causing a `cannot find libarrow.a` error. If this happens, re-run `mvn install $MVN_COMMON_OPTS -DskipTests` to rebuild the native code cleanly, then retry `mvn test`. ### All tests ```bash mvn test $MVN_COMMON_OPTS ``` The POM routes tests that need special assertion or fork behavior to dedicated Surefire executions. ### Discovering tests Java test sources are at `src/test/java/ai/rapids/cudf/`. Use `find` or `glob` to discover test classes: ```bash find src/test/java -name "*Test.java" | head -20 ``` ### Specific test class ```bash mvn surefire:test@main-tests $MVN_COMMON_OPTS \ -Dtest="<ClassName>" ``` ### Specific test method ```bash mvn surefire:test@main-tests $MVN_COMMON_OPTS \ -Dtest="<ClassName>#<testName>" ``` Use the named `main-tests` execution for specific ordinary tests so `-Dtest` does not affect the separately configured executions. ### Tests with special configuration Invoke tests that require special configuration through their dedicated executions: ```bash mvn surefire:test@non-empty-null-test $MVN_COMMON_OPTS mvn surefire:test@fatal-cuda-test $MVN_COMMON_OPTS mvn surefire:test@native-deps-loader-test $MVN_COMMON_OPTS ```
在 GitHub 查看