-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
include julia.h with shared libraries #884
Comments
You can, by populating the PackageCompiler.jl/src/PackageCompiler.jl Lines 959 to 961 in 466aec3
with appropriate values. For example, to include the default init file header plus the Julia header file, you could try something like
|
Thanks. I will try that. I couldn't find it in the documentation anywhere. |
It is considered an "advanced" option and thus only documented in the References section. I'd be open to adding a section on custom header/init files in the main docs though.
No, you're right. You'd have to do this manually. I also see currently no sane way to automate this, since you'd have to transitively also include those headers. Except maybe to include the entire |
So it seems like this is still a valid issue? To somehow make this more manageable, or specify which functions to rehost in the shared library somehow. |
Yes, I still consider this to be a valid issue. However, it is unclear to me if such a functionality should be included in PackageCompiler.jl to be automated, or whether it is something that could be documented but would be left up to the user to do manually. Maybe @KristofferC has on opinion here? |
A bug was found in julia where @ccallable functions allocate memory for each argument triggering garbage collection. For a high-throughput loop this is a no go. It was observed that @cfunction function pointers do not allocate per each argument.
JuliaLang/julia#51894
Unfortunately for the shared-library use case with the PackageCompiler.jl using @cfunction interface requires a julia install because the "julia.h" include file is not available to shared libraries created with the PackageCompiler.jl.
Can julia.h be made available to shared libraries made with PackageCompiler.jl so that additional embedded functionality can also be accessed via embedded C julia commands? This would save an installation of Julia being required to link in with the shared library.
The text was updated successfully, but these errors were encountered: