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

help with compiling ninja/jep #26

Open
zcaudate opened this issue Aug 15, 2020 · 7 comments
Open

help with compiling ninja/jep #26

zcaudate opened this issue Aug 15, 2020 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@zcaudate
Copy link

I've compiled jep, which is a jni based embedded python runtime https://github.com/zcaudate/sample-jep-graal but am getting a weird output.

Have you seen something similar to this before?

@zcaudate
Copy link
Author

@BrunoBonacci
Copy link
Collaborator

Hi @zcaudate ,

It is probably because of the “closed world assumption” you have to provide at compile-time all the dependencies that you will use at runtime.

I’m currently on holidays with limited internet access but I’d suggest that you have a read to
https://www.graalvm.org/docs/Native-Image/user/JNI

Bruno

@zcaudate
Copy link
Author

zcaudate commented Aug 17, 2020

Thanks @BrunoBonacci. Enjoy your holidays!

The program compiles but is not working at runtime.

I did ask around about that and even attempted to hand code the JNI.json for about half a day before finding a better solution. The call to --agentlib does the instrumentation to generate the JNI.json.

Anyways. Most of the problems I've run into are captured here: ninia/jep#271 and I gave some more background here: babashka/babashka#517 who pointed me out to you.

I think I'm pretty close and it's not that urgent but any help would be great.

@BrunoBonacci
Copy link
Collaborator

Make sure that the native library is either embedded in your jar or the -Djna.library.path= is set correctly.

@zcaudate
Copy link
Author

The shared library is located here: /usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/jep/ after a brew install it uses JNI so I'm not sure that setting jna.library.path would help.

The layout of the folder looks like this:
Screen Shot 2020-08-18 at 3 44 40 pm

Where does the folder go?

When not compiled using Native Image, I'm doing a bootstrap call to an external python process to find this directory:
https://github.com/zcaudate/sample-jep-graal/blob/master/src/jep/graal.clj#L30

@BrunoBonacci
Copy link
Collaborator

BrunoBonacci commented Aug 18, 2020 via email

@zcaudate
Copy link
Author

Sweet. Thanks Bruno. I'll give it another go.

@BrunoBonacci BrunoBonacci added the help wanted Extra attention is needed label Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants