I would like to use this C++ library from julia: https://github.com/ORNL/Tasmanian
there is a Python interface which I tried to use with PyCall but without success. I’m now wondering how hard it would be to wrap this as a julia package. I have seen both Cxx.jl and CxxWrap.jl, but somewhere someone mentioned that probably the easiest approach would be to add some EXTERN "C { } calls in the library. I don’t know that means. any hints and ideas much appreciated.
The build creates a shared library object. Is it possible to just link to that somehow? I’m thinking of how easy it is to do a ccall(:funcname,"library_name").
The easiest approach really depends on the library and the use case. If a C interface already exists, directly using ccall is probably the simplest approach. Glancing at the documentation, it looks like the Fortran interface is still experimental, but the Python interface (which looks more complete, also at first glance) also uses a set of C functions, so it may be worth looking into copying that approach. First thing to check is if the required functionality is available through one of the C interfaces, though. If you still need to write a lot of C wrapper functions yourself, then using CxxWrap.jl or Cxx.jl is probably faster once you get over the initial learning curve.
Cool. You might also consider generating binaries for the Tasmanian libraries. BinaryBuilder is pretty new, but it works great. It looks like this is a CMake build, so it might be pretty easy. With pre-built libraries, it’ll be easier for users to install the package.