-
Notifications
You must be signed in to change notification settings - Fork 463
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
Set native path with gradle #921
Conversation
…h, remove useless stuff for macOs, remove the jep library in grobid-home
I've made some small progress (on the macOs). In brief:
I can say "It works on my machine" 😂 |
Some feedback/question on your changes:
There's already a run task for the service Line 328 in 47cf1a1
Isn't redundant?
Does it make sense to have JEP native libraries in a python environment - given that it could be conda, python virtual environment, poetry, etc.? It seems opening plenty of cases and compatibility issues (it's also confusing with the DeLFT environment indicated in
This is related to #689. I though first about building automatically with Docker and embedding plenty of JEP native variants, but too complicated... In the latest version, I added a script to download and install JEP temporary, rebuild locally, and install the platform/python version compatible native JEP library under the GROBID native library path, see https://grobid.readthedocs.io/en/latest/Deep-Learning-models/#classic-python-and-virtualenv (point 4) and ./grobid-home/scripts/install_jep_lib.sh
Following the script, the JEP library would always be under grobid-home, without python specific environment, I think it should work all the time? |
[...]
Yes 🦢 😓 😅
I personally prefer to use the virtual environment, however, I'm good with using what you've already implemented. 😉 |
… run task system property
I've checked it out. After more than one week start again it's hard 😅 I'm wondering, can we really avoid dealing with the mess of the virtual envs? Sorry if I'm insisting on this...
|
The last commits are mostly commented code, I just want to keep it somewhere 😄 |
@lfoppiano The PR was normally just about setting the native path of JNI JEP under
What do you think? |
I went through the difference run tasks and adapted gradle for setting Tested on Linux-64, it works with OpenJDK 1.15 for the service, training commands, tests and evaluation commands (native Wapiti and JEP). For the batch mode, the @lfoppiano could you maybe test all these different run cases on Mac ? Normally that should work the same, but just to be sure before merging. |
I could not install easily JDK 15, so I tested with JDK 17.
|
See #688
As dynamically loading native libraries is not possible with JDK > 10 (or with complicated hacks depending on the JVM version), this PR tries to set the
java.library.path
at launch via Gradle.The current version covers lin64 only (service, training, evaluation)
To do:
grobid/grobid-core/src/main/java/org/grobid/core/main/LibraryLoader.java
Line 159 in 4757b0b