[Matrix-SIG] Writing code to interface NumPy with Python.

Travis Oliphant Oliphant.Travis@altavista.net
Thu, 15 Jul 1999 18:03:40 -0500


Probably the best suggestion I could give you is to get the f2py.py program
discussed a couple of days ago on this list.

This will generate C-code that interfaces with your Fortran code.  It is
already pretty useable and is complete with error checking on array arguments
(unless you don't want them).  The only thing left to implement is callback
functions and that's maybe a week or two away.  If you don't have a C-compiler
download gcc.  Robert Kern has a site which he has posted to this list that
explains using gcc under Windows.   That gives you all the compiler power you
need.

Compile the Fortran code into a library or object.  Compile the auto-generated
interface module (with a C compiler) into an object file  Use the Fortran
compiler to make a shared library from the fortran object code and the
interface code. 

It is so easy to do with gcc that I'm thinking I might do some more coding in
Fortran again....

Best,

Travis