| Hello, I've been putting a lot of time and googling into trying to get f2py to work. I do large matrix operations in python using scipy and numpy. There's a few small functions I need to speed up and want to use fortran or c to do this. Right now I write code that needs days to run. I'm hoping that I can really speed this up. I've also bought books to help but to no avail yet. I've found python to be incredibly good for what I do, but have had a lot of trouble extending it. Eventually I thought I would ask for help. On my new computer running snow leopard I was able to install the fortran 95 compiler. I installed the gcc compilers from the xcode developer tools. Going into bash and typing f2p gives returns a long message ending in.. Version: 2 numpy Version:
1.3.0 Requires: Python 2.3 or higher. License: NumPy license (see LICENSE.txt in the NumPy source code) Copyright 1999 - 2005 Pearu Peterson all rights reserved. If I run f2py -c --help-fcompiler I get a lot of output, one line of which says that the GNU Fortran 95 compiler is there. So I proceeded to make hello.f as indicated in the scipy documentation. I saved it in my documents directory. Going back to bash, I cd into the documents directory and run f2py -c -m hello hello.f This gives me a long output that ends with the error: building extension "hello" sources f2py options: [] f2py:>
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpWX5ghA/src.macosx-10.3-fat-2.5/hellomodule.c creating /var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpWX5ghA creating /var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpWX5ghA/src.macosx-10.3-fat-2.5 Reading fortran codes... Reading file 'hello.f' (format:fix,strict) Post-processing... Post-processing (stage 2)... Building modules... error: f2py target file '/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpWX5ghA/src.macosx-10.3-fat-2.5/hellomodule.c' not generated I've been stuck trying to get up and running with extending python for months now and I'm really hoping someone can help me along. Once I can get this working, I'll start trying to send in numpy arrays and get numpy arrays back. I really
appreciate your kind assistance. Cheers! joe |
|
|
Hi,
I'm not sure what your actual problem is, but perhaps it will help if
I point out the steps I followed to get it working.
Also note the f2py is part of numpy, so the numpy list (or f2py list)
might be more appropriate.
You don't specify which fortran compiler you are using. For the mac it
is generally recommended to use the gfortran build from here:
http://r.research.att.com/tools/
You will also need to install Xcode (to get c compilers).
If you are on OS X 10.6 with Python build from python.org you may need to do:
#export CC=/usr/bin/gcc-4.0
before calling f2py. This is because apple changed the default
compiler version to 4.2, but the Python binaries are built with the
older one (this is true for 2.5, I havent tried a python.org 2.6
build).
With those steps, the following hello.f95 file compiles for me:
subroutine foo (a)
integer a
print*, "Hello from Fortran!"
print*, "a=",a
end
with
f2py -c -m hello hello.f95
Cheers
Robin
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
2.5/hellomodule.c:246: error: called object ‘*(struct PyMethodDef
*)&<erroneous-expression>’ is not a function
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmp61G3Ch/src.macosx-10.3-fat-2.5/hellomodule.c:247:
warning: comparison of distinct pointer types lacks a cast
lipo: can't figure out the architecture type of:
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-//ccpxvBfj.out
error: Command "gcc -arch ppc -arch i386 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
-I/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmp61G3Ch/src.macosx-10.3-fat-2.5
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmp61G3Ch/src.macosx-10.3-fat-2.5/hellomodule.c
-o
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmp61G3Ch/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmp61G3Ch/src.macosx-10.3-fat-2.5/hellomodule.o"
failed with exit status 1
I found the f2py users group and will seek help there. I do really
appreciate it.
joe
--
View this message in context: http://old.nabble.com/f2py-fortran95-won%27t-compile-tp26737506p26753350.html
Sent from the Scipy-User mailing list archive at Nabble.com.
Could you post all the output? It is usually the first errors rather
than the last that are most revealing.
Robin
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
building extension "hello.f95" sources
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
But no .os file and nothing works from python.
OK here is that big error message:
*****
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
building extension "hello" sources
f2py options: []
f2py:>
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/hellomodule.c
creating /var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5
Reading fortran codes...
Reading file 'hello.f' (format:fix,strict)
Post-processing...
Block: hello
Block: foo
Post-processing (stage 2)...
Building modules...
Building module "hello"...
Constructing wrapper function "foo"...
foo(a)
Wrote C/API module "hello" to file
"/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/hellomodule.c"
adding
'/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c'
to sources.
adding
'/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5'
to include_dirs.
copying
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.c
->
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5
copying
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/f2py/src/fortranobject.h
->
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize NAGFCompiler
Could not locate executable f95
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=powerpc-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/distutils/fcompiler/gnu.py:119:
UserWarning: Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3
warnings.warn(s)
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=powerpc-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
customize Gnu95FCompiler
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=powerpc-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=powerpc-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local
--mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--build=i686-apple-darwin8 --host=i686-apple-darwin8
--target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
customize Gnu95FCompiler using build_ext
building 'hello' extension
compiling C sources
C compiler: gcc -arch ppc -arch i386 -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
creating /var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders/1I
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T
creating
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5
compile options:
'-I/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c'
gcc:
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c
In file included from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:18:20:
error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:21:2:
error: #error "Something's broken. UCHAR_MAX should be defined in
limits.h."
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:25:2:
error: #error "Python's source code assumes C's unsigned char is an 8-bit
type."
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:32:19:
error: stdio.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:34:5:
error: #error "Python.h requires that stdio.h define NULL."
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:37:20:
error: string.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:39:19:
error: errno.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:41:20:
error: stdlib.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:43:20:
error: unistd.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:55:20:
error: assert.h: No such file or directory
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:93:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Py_ssize_t’
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:200:76:
error: math.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:207:22:
error: sys/time.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:208:18:
error: time.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:226:24:
error: sys/select.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:265:22:
error: sys/stat.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:515:21:
error: termios.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:516:
warning: ‘struct winsize’ declared inside parameter list
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:516:
warning: its scope is only this definition or declaration, which is probably
not what you want
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:516:
warning: ‘struct termios’ declared inside parameter list
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:517:
warning: ‘struct winsize’ declared inside parameter list
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:517:
warning: ‘struct termios’ declared inside parameter list
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:76,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pymem.h:50:
warning: parameter names (without types) in function declaration
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pymem.h:51:
error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:78,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:104:
error: expected specifier-qualifier-list before ‘Py_ssize_t’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:108:
error: expected specifier-qualifier-list before ‘Py_ssize_t’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:131:
error: expected declaration specifiers or ‘...’ before ‘*’ token
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:131:
error: ‘Py_ssize_t’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:149:
error: ‘readbufferproc’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:150:
error: ‘writebufferproc’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:151:
error: ‘segcountproc’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:152:
error: ‘charbufferproc’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:215:
error: expected specifier-qualifier-list before ‘lenfunc’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:229:
error: expected specifier-qualifier-list before ‘lenfunc’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:244:
error: expected declaration specifiers or ‘...’ before ‘FILE’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:258:
warning: ‘struct _typeobject’ declared inside parameter list
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:259:
warning: ‘struct _typeobject’ declared inside parameter list
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:262:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:262:
error: field ‘ob_size’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:264:
error: field ‘tp_basicsize’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:264:
error: field ‘tp_itemsize’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:309:
error: field ‘tp_weaklistoffset’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:324:
error: field ‘tp_dictoffset’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/object.h:389:
error: expected declaration specifiers or ‘...’ before ‘FILE’
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:79,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/objimpl.h:97:
warning: parameter names (without types) in function declaration
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/objimpl.h:98:
error: expected declaration specifiers or ‘...’ before ‘size_t’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/objimpl.h:228:
error: ‘PyGC_Collect’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/objimpl.h:249:
error: field ‘gc_refs’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/objimpl.h:288:
warning: parameter names (without types) in function declaration
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:83,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:55:19:
error: ctype.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:118:21:
error: wchar.h: No such file or directory
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:83,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:384:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:385:
error: field ‘length’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:447:
error: ‘PyUnicodeUCS2_GetSize’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:521:
error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:539:
error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:1102:
error: ‘PyUnicodeUCS2_Tailmatch’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:1114:
error: ‘PyUnicodeUCS2_Find’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:1123:
error: ‘PyUnicodeUCS2_Count’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:84,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/intobject.h:24:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/intobject.h:38:
warning: parameter names (without types) in function declaration
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/intobject.h:41:
error: ‘PyInt_AsSsize_t’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:86,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/longobject.h:25:
error: ‘_PyLong_AsSsize_t’ declared as function returning a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/longobject.h:26:
warning: parameter names (without types) in function declaration
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/longobject.h:69:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘_PyLong_NumBits’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/longobject.h:85:
error: expected declaration specifiers or ‘...’ before ‘size_t’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/longobject.h:108:
error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:87,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/floatobject.h:15:
error: field ‘ob_refcnt’ declared as a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:89,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/complexobject.h:39:
error: field ‘ob_refcnt’ declared as a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:92,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/stringobject.h:10:20:
error: stdarg.h: No such file or directory
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:92,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/stringobject.h:36:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/stringobject.h:36:
error: field ‘ob_size’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/stringobject.h:63:
error: expected declaration specifiers or ‘...’ before ‘va_list’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/stringobject.h:67:
error: ‘PyString_Size’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:94,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/tupleobject.h:25:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/tupleobject.h:25:
error: field ‘ob_size’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/tupleobject.h:40:
error: ‘PyTuple_Size’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:95,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/listobject.h:23:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/listobject.h:23:
error: field ‘ob_size’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/listobject.h:38:
error: field ‘allocated’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/listobject.h:47:
error: ‘PyList_Size’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:96,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:55:
error: field ‘me_hash’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:71:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:72:
error: field ‘ma_fill’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:73:
error: field ‘ma_used’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:79:
error: field ‘ma_mask’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/dictobject.h:106:
error: ‘PyDict_Size’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:98,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/setobject.h:36:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/setobject.h:38:
error: field ‘fill’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/setobject.h:39:
error: field ‘used’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/setobject.h:45:
error: field ‘mask’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/setobject.h:79:
error: ‘PySet_Size’ declared as function returning a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:99,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/methodobject.h:82:
error: field ‘ob_refcnt’ declared as a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:101,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/funcobject.h:22:
error: field ‘ob_refcnt’ declared as a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:102,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/classobject.h:13:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/classobject.h:24:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/classobject.h:31:
error: field ‘ob_refcnt’ declared as a function
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:103,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:11:
error: field ‘ob_refcnt’ declared as a function
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:12:
error: expected specifier-qualifier-list before ‘FILE’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:38:
error: expected ‘)’ before ‘*’ token
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:40:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:57:
error: expected declaration specifiers or ‘...’ before ‘FILE’
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/fileobject.h:58:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘Py_UniversalNewlineFread’
In file included from
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:105,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.h:7,
from
/var/folders/1I/1IOFcx8xHPWOBxtsQ1BZgE+++TI/-Tmp-/tmpVxrq1T/src.macosx-10.3-fat-2.5/fortranobject.c:2:
Thanks so much for your time. Cheers!
joe
--
View this message in context: http://old.nabble.com/f2py-fortran95-won%27t-compile-tp26737506p26788278.html
Sent from the Scipy-User mailing list archive at Nabble.com.
_______________________________________________
On Tue, Dec 15, 2009 at 2:47 AM, theWonder <joeba...@yahoo.ca> wrote:
>
> It's an enormous error message. I have posted the first big chunk of it. If
> you really think the whole thing would be better then that's ok.
> Importantly, if I just go into the documents directory with hello.f and type
> "f2py -c -m hello.f" I don't get an error message. I get this
Hi,
No definite answers but a couple of things to look at.
It looks like you are using Python 2.5. As I said in an earlier
message, if you are using the build from python.org you will need to
use the older gcc (4.0) rather than 4.2 (the default from 10.6 and
what you are using here).
So before running f2py enter the following 2 commands:
export CC=/usr/bin/gcc-4.0
export CXX=/usr/bin/g++-4.0
Second, sorry to contradict the other guy, but the -m option should be
used to give the name of the module, so you really want 'hello' in
there as you had originally
f2py -c -m hello hello.f
If you do f2py with no arguments it will give usage instructions.
Third, try to call your file .f95 - I think it might determine
filetype by extension (but looks like you have problems before that).
The first error is about missing header files - limits.h stdio.h etc.
These should be installed by xcode. I'm not sure why it's not finding
them but I would try reinstalling xcode with all extra options (build
for 10.4 etc.)
On my computer there are deveral copies in
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/
/Developer/SDKs/MacOSX10.5.sdk/usr/include/limits.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/limits.h
/Developer/usr/lib/gcc/i686-apple-darwin10/4.0.1/include/limits.h
/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include/limits.h
etc
Another thing to try might be to set OSX_DEPLOYMENT_TARGET
I think it should be 10.4 to match the Python build:
export OSX_DEPLOYMENT_TARGET=10.4
but it might be something else to try (other values)
So sorry theres still nothing concrete but I can tell you the problem
is something wrong with your build chain that is stopping creation of
python extensions (not specifically f2py).
Cheers
Robin