Julia: Make embedding dirt-simple

Created on 9 Sep 2016  Â·  6Comments  Â·  Source: JuliaLang/julia

Embedding should work uniformly across all supported platforms according to the documentation. Further, embedding Julia installed in the standard way for a platform should require no arguments to jl_init.

Some related issues: #6327, #8757 , #14163, #17657.

embedding help wanted

Most helpful comment

I'm actively working it.

On Sep 10, 2016 11:28 AM, "Stefan Karpinski" [email protected]
wrote:

I've marked as milestone 1.0 but this could ideally happen sooner.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/JuliaLang/julia/issues/18421#issuecomment-246127673,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABf4buATdb2UdBvk8y0cZTt3QGb5nWONks5qovbngaJpZM4J4_Iq
.

All 6 comments

Getting jl_init to the point where it can be called without arguments is straightforward. Since it resides in libjulia, it (or some function within libjulia that might be in its call chain) can determine the path to the libjulia that is currently being called (via GetModuleHandleEx on windows, or dladdr on POSIX). From that, JULIA_HOME can be inferred, as well as the paths to try for the julia executable (cf. #18437) and system image.

I've marked as milestone 1.0 but this could ideally happen sooner.

I'm actively working it.

On Sep 10, 2016 11:28 AM, "Stefan Karpinski" [email protected]
wrote:

I've marked as milestone 1.0 but this could ideally happen sooner.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/JuliaLang/julia/issues/18421#issuecomment-246127673,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABf4buATdb2UdBvk8y0cZTt3QGb5nWONks5qovbngaJpZM4J4_Iq
.

For 1.0, I think ideally ./julia will link against sys.so directly and dispense with our duplication of the system linker. But since this complicates the -J option, we aren't quite there yet, and I'm not sure the specifics of the best way to fix that. For embedding applications though, I think that's already definitely the way to go (and jl_init just needs to be updated to accept the handles directly rather than using dlopen to look them up).

can we call this fixed by https://github.com/JuliaLang/julia/pull/21299 ?

I think so, yes.

Was this page helpful?
0 / 5 - 0 ratings