I would like to use OSQP in a C file that is meant to be wrapped in R and Python (and uploaded to CRAN and PyPI), and I’m wondering what would be the best way of accomplishing this using the OSQP packages in CRAN and PyPI as dependencies rather than a system install of OSQP library.
My first thought was to include all header files from OSQP in the package, generate osqp_configure.h and qdldl_types.h, and link to the shared object that the CRAN/PyPI install generates, but the demo example from
https://osqp.org/docs/examples/demo.html#c will segfault if I try that with the R shared object, and throw errors about not finding Python symbols with the Python shared object.
Ideally, I would like to use the OSQP C api directly rather than use Rcpp/Cython to call the R/Python functions which in turn would call the C functions. I think this can be done on Python by adding the OSQP binaries in a wheel and putting the headers in the package, but for R this would not be possible.
Any suggestions on how to create R/Python packages with C code that links to OSQP taking only the CRAN package as dependency?