Skip to content

Add xgboost4j support FreeBSD#12222

Merged
trivialfis merged 3 commits into
dmlc:masterfrom
huanghwh:master
Jun 4, 2026
Merged

Add xgboost4j support FreeBSD#12222
trivialfis merged 3 commits into
dmlc:masterfrom
huanghwh:master

Conversation

@huanghwh

@huanghwh huanghwh commented May 24, 2026

Copy link
Copy Markdown
Contributor

I use this command to build and test:

#!/bin/sh
cmake -B build -S . -GNinja \
  -DCMAKE_C_FLAGS="-I/usr/local/include" \
  -DCMAKE_CXX_FLAGS="-I/usr/local/include" \
  -DCMAKE_EXE_LINKER_FLAGS="-ldmlc -L/usr/local/lib" \
  -DCMAKE_SHARED_LINKER_FLAGS="-ldmlc -L/usr/local/lib -Wl,-s" \
  -DBUILD_WITH_SYSTEM_DMLC=ON -DJVM_BINDINGS=ON
cd build && ninja
export JAVA_HOME=/usr/local/openjdk17
cd ../jvm-packages && mvn install -DskipTests=true

@wbo4958

wbo4958 commented May 25, 2026

Copy link
Copy Markdown
Contributor

@trivialfis @hcho3, would you help check it?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds FreeBSD as a supported platform for the XGBoost JVM bindings by teaching the Java native library loader and JNI packaging script to recognize and place FreeBSD native artifacts under the expected resource path.

Changes:

  • Add FREEBSD to NativeLibLoader.OS and OS detection logic, and include a FreeBSD-specific OpenMP dependency hint on load failure.
  • Update the JNI build/packaging script to copy the native library into a freebsd/<arch> resource directory.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/NativeLibLoader.java Adds FreeBSD OS enum/detection and updates supported-OS docs + load-failure messaging.
jvm-packages/create_jni.py Adds FreeBSD mapping so the built .so is copied into the correct freebsd resources folder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trivialfis
trivialfis merged commit c78a218 into dmlc:master Jun 4, 2026
80 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants