[Pyrex] Pyrex.distutils and fortran

Robert Kern robert.kern at gmail.com
Tue Mar 20 20:34:45 UTC 2007


Pierre GM wrote:
> All,
> As the code I've been bugging you with seems to work but for a couple of 
> details, I'm now trying to have it automatically compiled w/ distutils.
> 
> The pb I'm having right now is that Pyrex.Distutils chokes on the fortran 
> files I need to compile along. How could I solve that ? Is there an option to 
> specify the compiler to use ? 
> 
> As a bonus question: on top of the fortran files, I need access to lapack. The 
> setup.py I tried so far were: 
> - one inspired from numpy/doc/pyrex 
> - one inspired from numpy/random. This one tries to use f2py to process my 
> fortran files, which of course doesn't work.

You will need to use numpy.distutils in order to built extension modules with
FORTRAN. You should be able to simply list the .f files in the sources list. You
can look at most of the scipy setup.py files; most of them have FORTRAN sources
in there somewhere. If you have more trouble, bring the code that you tried to
numpy-discussion, and we'll take a look at it.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Pyrex mailing list