f2py release 5 coming soon (was Re: [f2py] Wrapping simple Fortran
routine on Windows using VisualStudio)
Fri, 4 Jan 2002 16:14:16 +0200 (EET)
On Fri, 4 Jan 2002, Herb Schilling wrote:
> Your release notes for the Release 4 mention that a couple of folks
> helped with making f2py work on Windows. Do you have any complete
> examples of how that works? I am looking for Makefiles, wrapper code,
> signature files,.... I am definitely thinking of trying cygwin again.
I am working on the next f2py release 5 that uses scipy_distutils for
building extension modules, not Makefiles any more. I have made the
corresponding snapshot available to f2py home page.
Eric Jones wrote a small HOWTO for win32, see
It is a bit out of date and incomplete, but should be useful for getting
When you install the latest f2py, see test-site/a/runme.py.
It is currently the only test that uses the latest features and I would
expect also that it is the only test that would pass on Windows. Try it.
Usage of the latest f2py should be really easy. In fact, f2py acts also
like a compiler with the -c switch.
Here is a small but a complete example:
Fortran file foo.f:
cf2py intent(in) a
cf2py intent(out) b
b = a + 2
Compile a wrapper for foo():
$ f2py -c -m example foo.f
And here you go in Python:
Python 2.1.1 (#1, Nov 11 2001, 18:19:24)
[GCC 2.95.4 20011006 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import example
Currently f2py should work with the following compilers:
without problems, I just have tested them.
Note that f2py.bat that will be generated in Python21/Scripts under
Windows is not tested. Please, if you can fix it, send it me too.