[Numpy-discussion] How to test f2py?

Kurt Smith kwmsmith@gmail....
Fri Feb 26 10:18:52 CST 2010

On Fri, Feb 26, 2010 at 2:44 AM, Dag Sverre Seljebotn
<dagss@student.matnat.uio.no> wrote:
> David Cournapeau wrote:
>> Kurt Smith wrote:
>>> I'm the developer of fwrap.  It is coming along, but will be at least
>>> a month, likely two before the first release.  (The main areas that
>>> need some TLC are the fortran parser and the build system; the build
>>> system will leverage numpy's distutils unless waf is easy to get
>>> working.) The first release will cover a large portion of f2py's
>>> current functionality, but I don't plan on having python callbacks
>>> working then.  Callbacks will be a part of the second release.
>>> An issue that you should be aware of is that fwrap will not work with
>>> f77, and requires gfortran 4.3.3 or greater, since it uses C
>>> interoperability features not available in f77.  (Fwrap will work with
>>> any 'modern' fortran compiler that has the basic C interoperability
>>> features implemented.  Looking around it appears that all of them do
>>> have the basic set necessary, see [1].  So this only excludes f77.)
>> By f77, do you mean g77, i.e. the fortran compiler in the GNU gcc 3.x
>> suite ?
>> If so, that's quite a bummer for scipy. I don't see us removing support
>> for g77 in the short or even mid term (many distributions depend on it,
>> and that's not counting windows where there is still no gcc 4.x official
>> support from MinGW).
>> Do you have a list somewhere of what exactly is required for fwrap from
>> the fortran compiler ?
> I think f77 means Fortran 77 in general, including g77. (Of course, g77
> that might be the only compiler left in daily use which only supports
> Fortran 77 and not also more modern Fortran.)
> Long-term: While Fortran 77 is not something fwrap targets today, I
> think it should be possible to add in some special-casing for f77-only
> support. Basically a command-line flag to fwrap to tell it not to use
> ISO C BINDING and assume Fortran 77 feature-level only. Kurt, what do
> you say? Do you chance on an estimate on how long would it take for
> (somebody else) to do that?

Once fwrap has blazed a trail for all the main features, including
procedure arguments, then it wouldn't be too hard, since 'nice' 77
code is a subset.  I'd prefer not to get into the dark corners of 77
stuff, though, like ENTRY statements and statement functions.  But if
patches come to support these features, who am I to refuse :)

How long would it take?  I'd rather not hazard a guess.  If it is
critical for scipy then it will be bumped up on the priority list,

I don't mean to sound like I assume fwrap will be *the* fortran
wrapper for scipy.  f2py has worked very well as proven by scipy's
success.  There is much overlap between their functionality, but they
take different approaches.  I realize that if fwrap doesn't work well
with numpy/scipy then it really isn't useful.    The intersection
between python users and numerical programmers using fortran ain't
that big.  If at some point fwrap is used as the fortran wrapper for
scipy, then it's fine by me.  But that's up to David, Chuck, Travis,
et alia.

> (I'd think one basically has to make the same blatant assumptions that
> f2py makes about type conversion, name mangling etc., but that is also
> much less dangerous/error-prone for Fortran 77.)
> Dag Sverre
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list