We have a vendor C API that we are currently trying to wrap in Julia. I just have their headers and a dynamic library. Presently I am using ] generate to create new projects because of the way that our source is stored. We store everyone’s work in one gigantic git repo[1], so I am not sure that I can use PkgTemplates in a “no git repo” situation.
I looked around at other projects, like Interpolations and thought that a subdirectory like ./ext might be appropriate to store the *.so in? After that, I was thinking of hard-coding the path to the *.so into a global variable in the main Julia file:
src/NEAT.jl:
neatlib::String = "../ext/libneat.so"
function neatthing()
@ccall neatlib.do_neat()::Cvoid
end
NOT my idea, and sooner or later I’ll convince “them” to change it. ↩︎
To follow up, let me explain that .so files are usually distributed in a package artifact, and in turn these artifacts are usually listed in a JLL package, which you then list as a dependency of your Julia package. This way, when you load your Julia package, the JLL automatically grabs the correct .so file for the current platform.
JLL packages and their artifacts, in turn, are usually generated by a BinaryBuilder script. The easiest way to do this, at least for open-source software, is to make a pull request to the Yggdrasil repository, which will automatically run your script to generate cross-compiled binaries for all supported Julia platforms, and will then automatically upload and register the JLL package.
Note that BinaryBuilder and Yggdrasil also work for non open-source software that is provided by a vendor merely as a collection of .so files. See, for example the script to build a JLL for MKL.