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

Problem native library #42

Closed
TBrb opened this issue Mar 19, 2021 · 4 comments
Closed

Problem native library #42

TBrb opened this issue Mar 19, 2021 · 4 comments

Comments

@TBrb
Copy link

TBrb commented Mar 19, 2021

Hi Shuttie,

Again, many thanks for this very useful library.

We have the following problem
microsoft/LightGBM#2742 (comment)

But it is already corrected in the last source files :) (We built locally and it solved this problem).
Is it possible to update lightgbm4j to have the latest sources ?

@shuttie
Copy link
Contributor

shuttie commented Mar 22, 2021

I'm not sure that it's a good idea to have a public unstable snapshot build of LightGBM binary in maven. But you can solve it by yourself, if you really need the snapshot build.

This thing takes the native libraries out of the jar resources from https://github.com/metarank/lightgbm4j/tree/main/src/main/resources. As resources are global to the ClassLoader (and in a simple case - they are global to the whole classpath) and taken in an explicit order, then you can do the following trick:

  • build a native library for your platform of choice.
  • create a ./src/main/resources/<platform>/x86_64 dir in your app
  • put the freshly-built native library there. Make sure that the name matches the one in the original lightgbm4j resources folder.

Then the native lib loader will prefer your binary to the one in the jar file, and it should work as-is.

@shuttie
Copy link
Contributor

shuttie commented Mar 23, 2021

@TBrb Luckily LightGBM released a new shiny 3.2.0 version, so you can try the new build: https://github.com/metarank/lightgbm4j/releases/tag/3.2.0-1. I've published it to maven-central already.

@shuttie
Copy link
Contributor

shuttie commented Mar 23, 2021

I'm closing the ticket as fixed, but if the problem persists - don't hesitate to reopen it.

@shuttie shuttie closed this as completed Mar 23, 2021
@TBrb
Copy link
Author

TBrb commented Mar 26, 2021

Hi Shuttie,

Sorry for the delay and many thanks for the new release !

I would like to help and contribute to the project, do you have priorities / road map ?

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

No branches or pull requests

2 participants