-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationembeddingEmbedding Julia using the C APIEmbedding Julia using the C API
Description
For people wanting to call Julia from C/C++, I would generally recommend doing all of the type conversions on the Julia side, and then use jl_unbox_voidpointer(jl_eval_string("@cfunction(....)"))
to compile and extract a C function pointer that you can then call normally. This is vastly easier than constructing/unboxing Julia types from the C/C++ side.
It would be good to document this in the Embedding Julia manual, which currently doesn't mention @cfunction
at all.
(For example, this came up on stackoverflow in a question about calling the Julia SpecialFunctions.polygamma
function from C++.)
GunnarFarneback, melonedo, danilo-bc, pemryan and mhnsnpemryan
Metadata
Metadata
Assignees
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationembeddingEmbedding Julia using the C APIEmbedding Julia using the C API