Eric Firing <efiring@hawaii.edu> wrote:
> I'm curious: has anyone been looking into what it would take to enable
> f2py to handle modern Fortran in general? And into prospects for
> getting such an effort funded?
No need. Use Cython and Fortran 2003 ISO C bindings. That is the only
portable way to interop between Fortran and C (including CPython) anyway.
For my wdmtoolbox I have a f2py wrapped Fortran 77 library. Works great on Linux, but because of the 'C' wrapper that f2py creates you run into the same problem as Cython on Windows.
I guess if you first find a Windows machine, get it all setup, you may not have to futz with it too much, but I just don't want to do it for such a niche package. I probably have a handful of users.
So I've been toying with the idea to use ctypes + iso_c_binding. I could then use MinGW on Windows to compile the code for all versions of Python that have ctypes. I've tested this approach on a few functions and it works, but far from done.
My $0.02.
Kindest regards,
Tim