[f2py] ubuntu 9.10 and python 2.6.4 problem

Lazlo lazlo at free.fr
Tue Apr 27 00:27:48 EEST 2010


Hi,

I ran f2py successfully under Redhat and Snow Leopard under python 2.5.4, but I
am not able too run it correctly under Ubuntu 9.10 and python 2.6.4.
Sorry if it is an obvious error but I am new at this. It seems to use the right
fortran compiler (I tried --fcompiler=gnu95 and obtained the same errors).
Thanks for any help.

Lazlo

Here is the partial output for the ZADD test case:

f2py -c -m add add.f add.pyf
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 "add" sources
creating /tmp/tmpCCYAMf
creating /tmp/tmpCCYAMf/src.linux-i686-2.6
f2py options: []
f2py: add.pyf
Reading fortran codes...
	Reading file 'add.pyf' (format:free)
Post-processing...
	Block: add
			Block: zadd
Post-processing (stage 2)...
Building modules...
	Building module "add"...
		Constructing wrapper function "zadd"...
		  c = zadd(a,b)
	Wrote C/API module "add" to file
"/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c"
 adding '/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.c' to sources.
 adding '/tmp/tmpCCYAMf/src.linux-i686-2.6' to include_dirs.
copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.c ->
/tmp/tmpCCYAMf/src.linux-i686-2.6
copying /usr/lib/python2.6/dist-packages/numpy/f2py/src/fortranobject.h ->
/tmp/tmpCCYAMf/src.linux-i686-2.6
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize LaheyFCompiler
Could not locate executable lf95
customize PGroupFCompiler
Could not locate executable pgf90
Could not locate executable pgf77
customize AbsoftFCompiler
Could not locate executable f90
customize NAGFCompiler
Found executable /usr/bin/f95
customize VastFCompiler
customize GnuFCompiler
customize CompaqFCompiler
Could not locate executable fort
customize IntelItaniumFCompiler
Could not locate executable efort
Could not locate executable efc
customize IntelEM64TFCompiler
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'add' extension
compiling C sources
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC

creating /tmp/tmpCCYAMf/tmp
creating /tmp/tmpCCYAMf/tmp/tmpCCYAMf
creating /tmp/tmpCCYAMf/tmp/tmpCCYAMf/src.linux-i686-2.6
compile options: '-I/tmp/tmpCCYAMf/src.linux-i686-2.6
-I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/python2.6
-c'
gcc: /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:16:20: error: Python.h: Aucun
fichier ou dossier de ce type
In file included from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:61,
                from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/npy_common.h:71:2:
error: #error Must use Python with unicode enabled.
In file included from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:181:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_intp’
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:182:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_uintp’
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:284:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:285:
error: expected ‘)’ before ‘*’ token
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287:
error: expected declaration specifiers or ‘...’ before ‘npy_intp’
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:287:
error: expected declaration specifiers or ‘...’ before ‘npy_intp’

...etc...

                from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h: In
function ‘_import_array’:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971:
error: ‘PyObject’ undeclared (first use in this function)
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971:
error: (Each undeclared identifier is reported only once

... etc...

In file included from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h: At top level:
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:61: error: expected
declaration specifiers or ‘...’ before ‘npy_intp’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:63: error: expected
declaration specifiers or ‘...’ before ‘npy_intp’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:73: error: expected
specifier-qualifier-list before ‘npy_intp’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:85: error: expected
specifier-qualifier-list before ‘PyObject_HEAD’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:94: error: expected ‘=’, ‘,’,
‘;’, ‘asm’ or ‘__attribute__’ before ‘PyFortran_Type’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:95: error: expected ‘)’ before
‘*’ token

...etc...

/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:16:20: error: Python.h: Aucun
fichier ou dossier de ce type
In file included from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:61,
                from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/npy_common.h:71:2:
error: #error Must use Python with unicode enabled.
In file included from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:181:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_intp’
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:182:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘npy_uintp’

...etc...

In file included from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/ndarrayobject.h:1099,
                from
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/arrayobject.h:14,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:13,
                from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h: In
function ‘_import_array’:
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971:
error: ‘PyObject’ undeclared (first use in this function)
/usr/lib/python2.6/dist-packages/numpy/core/include/numpy/__multiarray_api.h:971:
error: (Each undeclared identifier is reported only once

...etc...

In file included from /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:17:
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h: At top level:
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:61: error: expected
declaration specifiers or ‘...’ before ‘npy_intp’
/tmp/tmpCCYAMf/src.linux-i686-2.6/fortranobject.h:63: error: expected
declaration specifiers or ‘...’ before ‘npy_intp’

...etc...

/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:21: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘*’ token
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:22: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘*’ token
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:128: error: expected ‘=’, ‘,’,
‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:257: error: extra brace group at
end of initializer
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:257: error: (near initialization
for ‘f2py_routine_defs[0].dims’)
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:257: warning: excess elements in
struct initializer
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:257: warning: (near initialization
for ‘f2py_routine_defs[0].dims’)
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:257: error: ‘f2py_rout_add_zadd’
undeclared here (not in a function)
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:260: error: ‘NULL’ undeclared here
(not in a function)
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:263: error: expected ‘=’, ‘,’,
‘;’, ‘asm’ or ‘__attribute__’ before ‘f2py_module_methods’
/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c:268: error: expected ‘=’, ‘,’,
‘;’, ‘asm’ or ‘__attribute__’ before ‘initadd’
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -I/tmp/tmpCCYAMf/src.linux-i686-2.6
-I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/include/python2.6
-c /tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.c -o
/tmp/tmpCCYAMf/tmp/tmpCCYAMf/src.linux-i686-2.6/addmodule.o" failed with exit
status 1




More information about the f2py-users mailing list