Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jvm-packages] Remove hard dependency on libjvm #9698

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

hcho3
Copy link
Collaborator

@hcho3 hcho3 commented Oct 22, 2023

Closes #9697

Follow the footstep of microsoft/onnxruntime#2873 to remove the hard link dependency on libjvm. The JVM process will load the correct sets of libraries prior to loading libxgboost4j, so we don't need to explicitly link Java libraries again.

With this fix, XGBoost4J will no longer be tightly coupled with any particular JDK.

Before:

$ otool -L libxgboost4j.dylib
libxgboost4j.dylib:
        @rpath/libxgboost4j.dylib (compatibility version 0.0.0, current version 0.0.0)
        /opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home/lib/server/libjvm.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

After:

$ otool -L libxgboost4j.dylib
libxgboost4j.dylib:
        @rpath/libxgboost4j.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

LGTM!

@hcho3 hcho3 merged commit 791de77 into dmlc:master Oct 22, 2023
21 checks passed
@hcho3 hcho3 deleted the remove_hard_jni_link branch October 22, 2023 06:14
hcho3 added a commit to hcho3/xgboost that referenced this pull request Oct 24, 2023
razdoburdin added a commit to IntelPython/xgboost_oneapi that referenced this pull request Oct 26, 2023
* [backport] Support pandas 2.1.0. (dmlc#9557) (dmlc#9655)

* [backport] Add support for cgroupv2. (dmlc#9651) (dmlc#9656)

* Bump version to 2.0.1. (dmlc#9660)

* [backport] [CI] Pull CentOS 7 images from NGC (dmlc#9666) (dmlc#9668)

* Fix build for GCC 8.x (dmlc#9670)

* [backport][pyspark] Support stage-level scheduling (dmlc#9519) (dmlc#9686)

Co-authored-by: Bobby Wang <wbo4958@gmail.com>

* Fix build for AppleClang 11 (dmlc#9684)

* Fix libpath logic for Windows (dmlc#9687)

* [CI] Build libxgboost4j.dylib for Intel Mac (dmlc#9704)

* [jvm-packages] Remove hard dependency on libjvm (dmlc#9698) (dmlc#9705)

* Use sys.base_prefix instead of sys.prefix (dmlc#9711)

* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too

---------

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
Co-authored-by: Bobby Wang <wbo4958@gmail.com>
razdoburdin added a commit to IntelPython/xgboost_oneapi that referenced this pull request Oct 26, 2023
* [backport] Support pandas 2.1.0. (dmlc#9557) (dmlc#9655)

* [backport] Add support for cgroupv2. (dmlc#9651) (dmlc#9656)

* Bump version to 2.0.1. (dmlc#9660)

* [backport] [CI] Pull CentOS 7 images from NGC (dmlc#9666) (dmlc#9668)

* Fix build for GCC 8.x (dmlc#9670)

* [backport][pyspark] Support stage-level scheduling (dmlc#9519) (dmlc#9686)

Co-authored-by: Bobby Wang <wbo4958@gmail.com>

* Fix build for AppleClang 11 (dmlc#9684)

* Fix libpath logic for Windows (dmlc#9687)

* [CI] Build libxgboost4j.dylib for Intel Mac (dmlc#9704)

* [jvm-packages] Remove hard dependency on libjvm (dmlc#9698) (dmlc#9705)

* Use sys.base_prefix instead of sys.prefix (dmlc#9711)

* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too

---------

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
Co-authored-by: Bobby Wang <wbo4958@gmail.com>
razdoburdin pushed a commit to IntelPython/xgboost_oneapi that referenced this pull request Oct 26, 2023
razdoburdin added a commit to razdoburdin/xgboost that referenced this pull request Oct 26, 2023
* [backport] Support pandas 2.1.0. (dmlc#9557) (dmlc#9655)

* [backport] Add support for cgroupv2. (dmlc#9651) (dmlc#9656)

* Bump version to 2.0.1. (dmlc#9660)

* [backport] [CI] Pull CentOS 7 images from NGC (dmlc#9666) (dmlc#9668)

* Fix build for GCC 8.x (dmlc#9670)

* [backport][pyspark] Support stage-level scheduling (dmlc#9519) (dmlc#9686)

Co-authored-by: Bobby Wang <wbo4958@gmail.com>

* Fix build for AppleClang 11 (dmlc#9684)

* Fix libpath logic for Windows (dmlc#9687)

* [CI] Build libxgboost4j.dylib for Intel Mac (dmlc#9704)

* [jvm-packages] Remove hard dependency on libjvm (dmlc#9698) (dmlc#9705)

* Use sys.base_prefix instead of sys.prefix (dmlc#9711)

* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too

---------

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
Co-authored-by: Bobby Wang <wbo4958@gmail.com>
razdoburdin pushed a commit to razdoburdin/xgboost that referenced this pull request Oct 26, 2023
razdoburdin added a commit to IntelPython/xgboost_oneapi that referenced this pull request Nov 23, 2023
* [backport] Support pandas 2.1.0. (dmlc#9557) (dmlc#9655)

* [backport] Add support for cgroupv2. (dmlc#9651) (dmlc#9656)

* Bump version to 2.0.1. (dmlc#9660)

* [backport] [CI] Pull CentOS 7 images from NGC (dmlc#9666) (dmlc#9668)

* Fix build for GCC 8.x (dmlc#9670)

* [backport][pyspark] Support stage-level scheduling (dmlc#9519) (dmlc#9686)

Co-authored-by: Bobby Wang <wbo4958@gmail.com>

* Fix build for AppleClang 11 (dmlc#9684)

* Fix libpath logic for Windows (dmlc#9687)

* [CI] Build libxgboost4j.dylib for Intel Mac (dmlc#9704)

* [jvm-packages] Remove hard dependency on libjvm (dmlc#9698) (dmlc#9705)

* Use sys.base_prefix instead of sys.prefix (dmlc#9711)

* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too

* [backport] Fix using categorical data with the ranker. (dmlc#9753) (dmlc#9778)

* [jvm-packages] Add Scala version suffix to xgboost-jvm package (dmlc#9776)

* Update JVM script (dmlc#9714)

* Bump version to 2.0.2; revamp pom.xml

* Update instructions in prepare_jvm_release.py

* Fix formatting

* fix merging for R-package/configure

---------

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
Co-authored-by: Bobby Wang <wbo4958@gmail.com>
Co-authored-by: Dmitry Razdoburdin <>
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.

[jvm-packages] Replace JNI with Java Native Access
2 participants