Charles R Harris <charlesr.harris@gmail.com> wrote:
Wasn't there a Cython project for wrapping Fortran? IIRC, it had the opposite problem, it could wrap newer versions of Fortran but couldn't hack Fortran 77.
f2py can wrap Fortran 90. Not in a portable way, but it knows the ABI of all major compilers. I prefer to use ISO_C_BINDING and Cython or ctypes myself (usually ctypes). David Cournapeau claims there is a stability issue when using gfortran and MSVC on Windows, due to the "MinGW run-time". Thus g77 is used to build the official binaries. I don't understand how using g77 is any better, as it creates code which depends on the MinGW run-time too. If David means that libgfortran depends on msvcrt.dll, that might be the case, but we are not going to share any CRT resources between Python and Fortran. Unless f2py does something very strange, Python and Fortran are isolated worlds with respect to CRT calls. I have used gfortran together with Python for my own code on Windows and never seen any of these stability issues. Calling ACML from gfortran will segfault though. Perhaps that is what he means? (Not sure why, but we are not foing to do that.) I need perhaps to better understand what the problem is... Could anyone enlighten me? If we could use gfortran instead of g77, it would be unproblematic to use Fortran 90/95 or even a subset of Fortran 2003/2008. In that case it would just be a matter of shaping up the Fortran 90 code. Sturla