[f2py] Hello; f2py on Mac OS X with gfortran
andreas.voellmy at gmail.com
Fri Jul 22 21:02:51 EEST 2005
Thanks for the tip.
I installed the g77 version into /usr/local/bin. Running
/usr/local/bin/gyy --version gives:
GNU Fortran (GCC) 3.4.4
Then I ran gcc_select 3.3. Now when I run gcc_select it shows:
Current default compiler:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1809)
Then I ran f2py like this:
f2py -f77exec=/usr/local/bin/g77 -c -m hello hello.f
It has an error on linking saying:
g77: installation problem, cannot exec 'c++filt': No such file or directory.
It creates the hello.so file anyway. I started python and imported
hello, then got this error:
Fatal Python error: Interpreter not initialized (version mismatch?)
What am I doing wrong? It looks like the versions are still a problem.
Is my machine still not using the correct compiler?
On 7/22/05, John Gleeson <jdgleeson at mac.com> wrote:
> On Jul 21, 2005, at 3:34 PM, Andreas Voellmy wrote:
> > I compiled (manually) without the -lcc_dynamic option. So I
> > compiled this:
> > /usr/local/bin/gfortran -Wl,-framework -Wl,Python -bundle
> > /tmp/tmpZaDVS4/tmp/tmpZaDVS4/src/hellomodule.o
> > /tmp/tmpZaDVS4/tmp/tmpZaDVS4/src/fortranobject.o
> > /tmp/tmpZaDVS4/hello.o
> > -L/usr/local/lib/gcc/powerpc-apple-darwin9.1.0/4.1.0 -lg2c -o
> > ./hello.so
> > The command was successful and it built my hello.so file.
> > However, when I start up python and type "import hello", I get this
> > error:
> > Fatal Python error: Interpreter not initialzed (version mismatch?)
> > Abort trap
> > I am using Python 2.3.5.
> > Does anybody know how I can fix this?
> > Thanks, Andreas
> The problem is that python was compiled with gcc 3.3:
> $ /usr/bin/python
> Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Switch from gcc 4.0 to 3.3 using the command 'gcc_select 3.3'.
> You can get a compatible g77 binary (v. 3.4) at HPC for OS X <http://
More information about the f2py-users