We have a Julia framework that needs to interact with a lot of legacy Fortran/C(++) applications. Instead of manually preparing the proper interface for the applications which involves lots of manual type conversions, we are wondering if it was possible to instead add Julia get/set functions for primitives that can be called from the legacy apps.
The idea is the following:
Storage.jl
→ Shared Julia library created byPackageCompiler
. Stores data to be exchangedLegacyApp.f90/c/cpp
→ Embeds Storage.jl as a shared library and uses get/set Julia functions to retrieve and deposit data in module variables/structuresOrchestrator.jl
→ Deposits data in Storage.jl and callsLegacyApp.f90/.c/.cpp
withccall
I found Is it possible for "ccall" to call the shared library created by PackageCompiler.jl? - #52 by lionisxn which makes me pessimistic that this is possible, since it does not seem possible to interact with shared Julia libraries in Julia.
At this point I am just looking for confirmation. I was able to embed Storage.jl
just fine in C but as soon as I tried to do the same with ccall
in Julia things started to go poorly.