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

init_jl_runtime does not work with Python ctypes #144

Closed
tkf opened this issue Oct 30, 2018 · 1 comment
Closed

init_jl_runtime does not work with Python ctypes #144

tkf opened this issue Oct 30, 2018 · 1 comment

Comments

@tkf
Copy link
Member

tkf commented Oct 30, 2018

I find that loading .so file created by PackageCompiler.jl using Python ctypes is a bit tricky. It seems just calling init_jl_runtime() does not work.

Here is a MWE that works with Python ctypes. I had to call jl_init_with_image (or jl_init_with_image__threading) directly with the full path to the generated .so file:
https://gist.github.com/tkf/7a1b24ae13d01f417d616293db164b31

This version doesn't work. It calls init_jl_runtime() (and uses current master ded6405):
https://gist.github.com/tkf/d6562fc948b6418e82fb61560fd59719

It failed with:

ERROR: could not load library "/usr/bin/test.so"
/usr/bin/test.so: cannot open shared object file: No such file or directory

where /usr/bin/ was picked presumably because that's where my python executable is.

Both versions should be reproducible by just running make.

@KristofferC
Copy link
Sponsor Member

init_julia from the output of create_library should work. I tried it a day ago with ctypes.

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