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

Ship rust application with libjulia #79

Open
Roger-luo opened this issue Apr 6, 2023 · 5 comments
Open

Ship rust application with libjulia #79

Roger-luo opened this issue Apr 6, 2023 · 5 comments

Comments

@Roger-luo
Copy link

It'd be very useful if we can ship a rust application with libjulia get included, I assume this should be possible if there is some kind of fake -src crate created for libjulia and let it finds local Julia and copy the shared library?

@Taaitaaiger
Copy link
Owner

I don't think such a crate is necessary, rather the binary needs to be able to find the libraries it depends on at runtime, either through environment variables or by setting an rpath. I have never tested this, though.

@Roger-luo
Copy link
Author

do we have something that finds libjulia at runtime already? so that we can ship a binary and link to system julia (or whatever other available) directly

@Taaitaaiger
Copy link
Owner

As I understand it, libjulia is dynamically linked, so as long as it can be found at runtime (via the Path environment variable on Windows, or LD_LIBRARY_PATH on Linux) it should be possible to use a binary compiled on another machine.

The only major limitation I expect is that the version of Julia must be compatible with jlrs, and that this version is used at compile time and runtime. It won't be possible to compile against Julia 1.6 and link against 1.8 at runtime, for example.

@Roger-luo
Copy link
Author

Is this because Julia doesn't have a stable ABI yet?

@Taaitaaiger
Copy link
Owner

Taaitaaiger commented Apr 7, 2023 via email

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