Re: [f2py] Can't get Enthought python to work with f2py

Kevin Mitchell <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
I don't think that your PATH is coming into it as it looks like
gfortran is using the absolute path /sw/bin/gfortran. You can define a
different compiler by giving its absolute path to the --fcompiler=
flag. I'm not exactly sure why you shouldn't be using ipython to
compile gfortran either, but I have never really called f2py from
inside python. I usually just do it on the bash command line. If it's
not straightforward how you would include the  --fcompiler= compiler
flag from within python, it will work on the command line with

$ f2py -c --fcompiler=/usr/bin/gfortran-4.3 source.f

(or whatever gfortran you want to use)

Kevin

On Tue, Jun 30, 2009 at 12:40 PM, charlie strauss<[email protected]> wrote:
>
> On Jun 30, 2009, at 12:35 PM, Robert Kern wrote:
>
> On 2009-06-30 12:58, charlie strauss wrote:
>
> I just installed the latest enthought python distro and now my f2py
>
> won't compile.
>
> I think the problem is that the enthought f2py is trying to use the fink
>
> or macports gfortran. But I don't know how to tell it not to.
>
> if I run ipython from fink then the programs do compile.
>
> You almost certainly shouldn't be running f2py from ipython.
>
>
> uh why not?
>
> the specific error that occurs from the enthought f2py is that it does
>
> not like the --arch command line flag that f2py places on the compile
>
> command. So another way to try solving this is to somehow adjust the
>
> default command line args in enthought's f2py so the fink gfortran is
>
> happy.
>
> Note that it's not "Enthought's f2py". It's the standard f2py from numpy. I
> suspect that Fink is patching numpy to work with its standard gfortran
> configuration out-of-box.
>
> I have also tries using g95 as the -fcompiler=g95 or --fcompliler=gnu95
>
> and this also produced different but I think fundamentally simmilar errors.
>
> So my first question is how do I get enthought's f2py to stop using the
>
> fink or macports f2py???
>
> Make sure that the gfortran that is first on your $PATH is the one you want
> to use. I recommend the one here:
>
> well the enthought python framework is first on the path (as I showed in the
> original post).  when I invoke ipython or python it is what launches not the
> one in fink which is later on the path.
> So I repeat my original question, how do I tell the enthought numpy.f2py
> that it needs to use whatever fortran compiler is used by enthought rather
> than finks.
> perhaps the mistake I'm making here is that I'm assuming enthough's distro
> has a fortran compiler lurking in it for numpy.f2py to use.
> So if I'm going to install a different one, then how do I "patch"  f2py's
> default arguments so it works with that compiler.  Clearly the gfortran, g9g
> and gnu95 that come with fink and macports do not work unpatched with
> enthought's numpy.f2py.
> you are suggesting I install yet another fortran compiler to solve this
> problem when I already have at least four installed including two versions
> of gfortran.  This seems kind of a brute force suggestion.
> surely there is some way to tweak the default argument list  (the one you
> get when you execute f2py --help-compilers  ) in numpy.f2py so that you can
> get an existing version of numpy.f2py to run.
>
>
>
>
>  http://r.research.att.com/tools/
>
> --
> 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
>
>
> _______________________________________________
> f2py-users mailing list
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> http://cens.ioc.ee/mailman/listinfo/f2py-users
>
> Charlie Strauss
> Bioscience Division
> [email protected]
> 505 665 4838
> Quidquid latine dictum sit, altum sonatur.
>
> _______________________________________________
> f2py-users mailing list
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> http://cens.ioc.ee/mailman/listinfo/f2py-users
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.