kermitt2 / entity-fishing

A machine learning tool for fishing entities
http://nerd.readthedocs.io/
Apache License 2.0
249 stars 24 forks source link

update to jdk 11, and grobid 0.8.1 #164

Open lfoppiano opened 4 months ago

lfoppiano commented 4 months ago

I managed to have the build work and it seems that there are issues with the tests. I haven't tried to run it, yet.

Here the broken test classes:

KBUtilitiesTest
CustomisationTest
ProcessTextTest

All the failing test are due to the same error, and I think it's due to the fact that I lmdbjni does not exists for arm 64.

Could not load library. Reasons: [no lmdbjni64-0.4.6 in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], no lmdbjni-0.4.6 in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], no lmdbjni in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], Can't load library: /var/folders/mk/scd8428n18jfgh3jdthbvpz00000gn/T/liblmdbjni-64-0-7539440420833364823.4]
java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no lmdbjni64-0.4.6 in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], no lmdbjni-0.4.6 in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], no lmdbjni in java.library.path: [/Users/lfoppiano/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .], Can't load library: /var/folders/mk/scd8428n18jfgh3jdthbvpz00000gn/T/liblmdbjni-64-0-7539440420833364823.4]
    at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:187)
    at org.fusesource.hawtjni.runtime.Library.load(Library.java:143)
    at org.fusesource.lmdbjni.JNI.<clinit>(JNI.java:41)
    at org.fusesource.lmdbjni.Env.create(Env.java:57)
    at org.fusesource.lmdbjni.Env.<init>(Env.java:51)
    at com.scienceminer.nerd.kb.db.KBDatabase.<init>(KBDatabase.java:39)
    at com.scienceminer.nerd.kb.db.StringRecordDatabase.<init>(StringRecordDatabase.java:20)
    at com.scienceminer.nerd.kb.db.ConceptDatabase.<init>(ConceptDatabase.java:18)
    at com.scienceminer.nerd.kb.db.KBUpperEnvironment.buildConceptDatabase(KBUpperEnvironment.java:220)
    at com.scienceminer.nerd.kb.db.KBUpperEnvironment.initDatabases(KBUpperEnvironment.java:117)
    at com.scienceminer.nerd.kb.db.KBUpperEnvironment.<init>(KBUpperEnvironment.java:59)
    at com.scienceminer.nerd.kb.UpperKnowledgeBase.<init>(UpperKnowledgeBase.java:76)
    at com.scienceminer.nerd.kb.UpperKnowledgeBase.getNewInstance(UpperKnowledgeBase.java:58)
    at com.scienceminer.nerd.kb.UpperKnowledgeBase.getInstance(UpperKnowledgeBase.java:48)
    at com.scienceminer.nerd.kb.KBUtilitiesTest.setUp(KBUtilitiesTest.java:15)

[...]
lfoppiano commented 4 months ago

@kermitt2 I've created a Github action that should be able to build it. I tried to run the tests but they fail because there is no data in the database. It should work with the latest grobid version compiled with JDK 11.

kermitt2 commented 4 months ago

Hi @lfoppiano ! Thank you.

Indeed simply removing the --add-opens jdk.incubator.foreign makes it working with jdk 11, which is funny because I added all these modules, including this specific one, to have it running on jdk >8.

About the tests, they can be run only after downloading the data files and installing them, I think it has always been like that. But I can confirm that the tests are fine with the data.

I will merge the PR when grobid version 0.8.1 is published - I updated the master so that it works with version 0.8.0 and jdk 11.