[SciPy-dev] genetic algorithm, number theory, filterdesign,zerofinding

pearu at scipy.org pearu at scipy.org
Thu Apr 11 14:19:06 CDT 2002

On Thu, 11 Apr 2002, Chuck Harris wrote:

> > How to you feel about Fortran? Actually C is also fine for me.
> I don't mind Fortran, and for some things I think it is superior to C,
> but I find that C compilers are easier to come by on all platforms; I
> don't much enjoy cygwin. Also, at this point in time C is more
> familiar to me. For the root finding, it shouldn't be too hard to keep
> track of reference counting.

I don't think that SciPy can be freed from Fortran stuff. There is
integrate module that uses odepack, and ATLAS hardly covers all the LAPACK
at this moment. Etc. So I find Fortran contributions acceptable.
But it is true that C codes are easier to re-use in other projects.

> > My point is that we should use f2py to generate the 
> > interfaces to these C
> > (or Fortran, if you have positive feelings about it) routines.
> > It has an advantage that you don't need to struggle with the
> > details of Python C/API (reference counting, argument checks, etc.)
> > All this is supported in f2py generated interfaces. Using 
> > f2py saves time
> > and bugs. And the f2py generated extension modules are really easy to
> > maintain.
> > 

> I pretty much agree with this. Perhaps it would be nice to have a c2py
> interface also.

Yes, but it is a project for the future. And f2py pretty much covers also

> > If you are not familiar with f2py then we can cooperate. You give me
> > a native C function and I'll give you an interface for calling this C
> > function from Python in no time.
> > 
> Hmm... f2py handles this?

Yes, it does (cblas,clapack are wrapped with f2py, for example). The
signature files may look Fortran but there is actually only little
difference in wrapping Fortran or C functions. And there are some  
additional hooks available for the signature files that ease overcoming
these small differences (intent(c), fortranname, callstatement,
callprotoargument etc. statements).
Of course, I am assuming that C functions do not use complicated struct's,
except the complex one.


More information about the Scipy-dev mailing list