Is it possible to compile a python package using a setup.py file that uses fortran code with the workflow described in https://www.fortran90.org/src/best-practices.html#interfacing-with-c?
In brief, the workflow described here is to:
- create a fortran wrapper function that defines c_iso_bindings for a fortran subroutine
- create a cython .pyx function that creates a function using the generated c code from step #1
Is it possible to compile the codes from both of these steps in a single setup.py file? The numpy distutils package seems to be best for compiling fortran source, while cython is compiled with its own distutils package.
The solution in this question added explicit fortran compiler calls to the setup.py file, and uses the cython distutils package. This seems both a little messy, and to introduce the possibility that different compilers are used to generate the code.