-
Notifications
You must be signed in to change notification settings - Fork 105
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
How to use a dynamic library? #214
Comments
Hello! Thanks for your interest! Does it work for you?
|
Relates to #72 |
Hi, thanks a lot for coming back so quickly. The workaround mentioned in #72 seems to work, though. Calling this function does work in the IDE. |
Is the project you're working in IDE available in public? It would be great if I could reproduce this problem in my environment. I found the repo with these .so libraries on Github, but not the JAR you're using in DependsOn(). |
No, I am just tinkering ATM. But everything required to get the RDKit running on the JVM is available on Github. The The And the Thanks for your help. |
Thanks, reproduced. I have also published this JAR in Maven Central, so you may avoid downloading it manually: You may also build this JAR from this repo using |
Problem is following. To be successfully used in some code, native library should be loaded by the classloader that loaded this code or by one of its parents. In our case Lines classloaders (classloaders that load compiled snippets classes) have classloaders which load JARs as parents, and that's why the code in these JARs can't see the loaded native libraries. This issue is inside REPL evaluator, and reproduces in IDE scripting (i.e. main.kts scripts) as well. |
Wow, very cool. Thanks a TON for your help!!!! Kind regards, |
Hope it helped! |
Hi,
thanks a lot for this cool project!!
I would like to explore it for cheminformatics analysis and would therefore like to use the Java bindings of the RDKit toolkit.
The bindings consist of a
jar
artifact and a dynamic library (.so
for Linux).In the Idea IDE, I configure the program for the location of the dynamic library with this line in the
build.gradle.kts
:jvmArgs = listOf("-Djava.library.path=$rdkitKnime")
with
rdkitKnime
being the path to the dynamic library.Then, in the program, I call
System.loadLibrary("GraphMolWrap")
once, to actually load the library.Is there a corresponding possibility to modify the
java.library.path
in kotlin-jupyter?@file:Repository("file:///home/pahl/dev/github/knime-rdkit/org.rdkit.knime.bin.linux.x86_64/os/linux/x86_64")
followed by
System.loadLibrary("GraphMolWrap")
in a new cell does not work, it gives a
no GraphMolWrap in java.library.path
error.Many thanks for your help.
Kind regards,
Axel
The text was updated successfully, but these errors were encountered: