[f2py] problem getting started on new install

Ryan Krauss ryanlists at gmail.com
Thu Nov 2 16:43:29 EET 2006


I am trying to use f2py on a new windows install to compile code that
I have used on other windows and linux machines before.  I think I
have set up mingw exactly as I did on my other windows installs, but I
am having problems.  So I tried to run the hello.f test from the f2py
webpage, the output is below.  It seems like lots of library header
files aren't being found (io.h, string.h, ...).  Should those be
provided by mingw or some Python package?  The only io.h on my
computer is in a matlab folder.

Thanks,

Ryan

E:\> python C:\Python24\Scripts\f2py.py --compiler=mingw32 -c -m hello hello.f
running build
running config_fc
running build_src
building extension "hello" sources
f2py options: []
f2py:> c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\hellomodule.c
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4
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 "c:\docume~1\ryan\locals~1\temp\tmpwj
gics\src.win32-2.4/hellomodule.c"
  adding 'c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c
' to sources.
  adding 'c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4' to include_dir
s.
copying C:\Python24\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\docum
e~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4
copying C:\Python24\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\docum
e~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4
running build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
0
1
Could not locate executable f77
Could not locate executable gfortran
Could not locate executable f95
customize GnuFCompiler
customize GnuFCompiler
customize GnuFCompiler using build_ext
building 'hello' extension
compiling C sources
C compiler: gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes

creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1\ryan
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1\ryan\locals~1

creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1\ryan\locals~1
\temp
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1\ryan\locals~1
\temp\tmpwjgics
creating c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\docume~1\ryan\locals~1
\temp\tmpwjgics\src.win32-2.4
compile options: '-Ic:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4 -IC:\
Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Python2
4\PC -c'
gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ic:\docume~1\ryan\locals~1\temp\t
mpwjgics\src.win32-2.4 -IC:\Python24\lib\site-packages\numpy\core\include -IC:\P
ython24\include -IC:\Python24\PC -c c:\docume~1\ryan\locals~1\temp\tmpwjgics\src
.win32-2.4\fortranobject.c -o c:\docume~1\ryan\locals~1\temp\tmpwjgics\Release\d
ocume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.o
In file included from C:/Python24/include/Python.h:8,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/pyconfig.h:30:16: io.h: No such file or directory
C:/Python24/include/pyconfig.h:196:20: stdio.h: No such file or directory
In file included from C:/GNU/mingw/bin/../lib/gcc/mingw32/3.4.2/include/syslimit
s.h:7,
                 from C:/GNU/mingw/bin/../lib/gcc/mingw32/3.4.2/include/limits.h
:11,
                 from C:/Python24/include/Python.h:18,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/GNU/mingw/bin/../lib/gcc/mingw32/3.4.2/include/limits.h:122:61: no include pa
th in which to search for limits.h
In file included from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/Python.h:34:5: #error "Python.h requires that stdio.h define
 NULL."
C:/Python24/include/Python.h:37:20: string.h: No such file or directory
C:/Python24/include/Python.h:38:19: errno.h: No such file or directory
C:/Python24/include/Python.h:39:20: stdlib.h: No such file or directory
C:/Python24/include/Python.h:53:20: assert.h: No such file or directory
In file included from C:/Python24/include/Python.h:55,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/pyport.h:94:76: math.h: No such file or directory
C:/Python24/include/pyport.h:107:18: time.h: No such file or directory
C:/Python24/include/pyport.h:159:22: sys/stat.h: No such file or directory
In file included from C:/Python24/include/Python.h:76,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/object.h:227: error: syntax error before "FILE"
C:/Python24/include/object.h:227: warning: function declaration isn't a prototyp
e
C:/Python24/include/object.h:371: error: syntax error before "FILE"
C:/Python24/include/object.h:371: warning: function declaration isn't a prototyp
e
In file included from C:/Python24/include/Python.h:81,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/unicodeobject.h:55:19: ctype.h: No such file or directory
C:/Python24/include/unicodeobject.h:118:21: wchar.h: No such file or directory
In file included from C:/Python24/include/Python.h:101,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/fileobject.h:12: error: syntax error before "FILE"
C:/Python24/include/fileobject.h:12: warning: no semicolon at end of struct or u
nion
C:/Python24/include/fileobject.h:15: error: syntax error before '*' token
C:/Python24/include/fileobject.h:15: warning: function declaration isn't a proto
type
C:/Python24/include/fileobject.h:28: error: syntax error before '}' token
C:/Python24/include/fileobject.h:28: warning: type defaults to `int' in declarat
ion of `PyFileObject'
C:/Python24/include/fileobject.h:28: warning: data definition has no type or sto
rage class
C:/Python24/include/fileobject.h:38: error: syntax error before '*' token
C:/Python24/include/fileobject.h:39: error: syntax error before '*' token
C:/Python24/include/fileobject.h:40: error: syntax error before '*' token
C:/Python24/include/fileobject.h:40: warning: type defaults to `int' in declarat
ion of `PyFile_AsFile'
C:/Python24/include/fileobject.h:40: warning: data definition has no type or sto
rage class
C:/Python24/include/fileobject.h:57: error: syntax error before "FILE"
C:/Python24/include/fileobject.h:57: warning: function declaration isn't a proto
type
C:/Python24/include/fileobject.h:58: error: syntax error before "FILE"
C:/Python24/include/fileobject.h:58: warning: function declaration isn't a proto
type
In file included from C:/Python24/include/Python.h:117,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/pythonrun.h:32: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:32: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:33: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:33: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:35: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:35: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:36: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:36: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:40: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:40: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:41: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:41: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:42: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:42: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:43: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:43: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:44: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:44: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:45: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:45: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:46: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:46: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:49: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:49: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:55: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:56: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:59: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:59: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:60: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:61: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:64: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:65: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:66: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:67: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:82: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:82: warning: function declaration isn't a protot
ype
C:/Python24/include/pythonrun.h:123: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:123: warning: function declaration isn't a proto
type
C:/Python24/include/pythonrun.h:125: error: syntax error before '*' token
C:/Python24/include/pythonrun.h:125: warning: function declaration isn't a proto
type
In file included from C:/Python24/include/Python.h:119,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/sysmodule.h:12: error: syntax error before '*' token
C:/Python24/include/sysmodule.h:12: error: syntax error before "FILE"
C:/Python24/include/sysmodule.h:12: warning: type defaults to `int' in declarati
on of `PySys_GetFile'
C:/Python24/include/sysmodule.h:12: warning: function declaration isn't a protot
ype
C:/Python24/include/sysmodule.h:12: warning: data definition has no type or stor
age class
In file included from C:/Python24/include/Python.h:121,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:7,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/include/import.h:25: error: syntax error before "FILE"
C:/Python24/include/import.h:25: warning: function declaration isn't a prototype

In file included from C:/Python24/lib/site-packages/numpy/core/include/numpy/arr
ayobject.h:14,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\/fo
rtranobject.h:13,
                 from c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\for
tranobject.c:2:
C:/Python24/lib/site-packages/numpy/core/include/numpy/ndarrayobject.h:1021: err
or: syntax error before '*' token
C:/Python24/lib/site-packages/numpy/core/include/numpy/ndarrayobject.h:1021: war
ning: function declaration isn't a prototype
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `F2PyDict_SetItemString':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:19: warni
ng: implicit declaration of function `fprintf'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:19: error
: `stderr' undeclared (first use in this function)
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:19: error
: (Each undeclared identifier is reported only once
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:19: error
: for each function it appears in.)
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `fortran_doc':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:106: warn
ing: implicit declaration of function `strlen'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:107: warn
ing: implicit declaration of function `malloc'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:108: warn
ing: implicit declaration of function `sprintf'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:138: erro
r: `stderr' undeclared (first use in this function)
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:143: warn
ing: implicit declaration of function `free'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `fortran_getattr':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:166: warn
ing: implicit declaration of function `strcmp'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `fortran_setattr':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:237: warn
ing: implicit declaration of function `memcpy'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `array_from_pyobj':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:548: warn
ing: implicit declaration of function `memset'
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c: In funct
ion `check_and_fix_dimensions':
c:\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject.c:691: erro
r: `stderr' undeclared (first use in this function)
error: Command "gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -Ic:\docume~1\ryan
\locals~1\temp\tmpwjgics\src.win32-2.4 -IC:\Python24\lib\site-packages\numpy\cor
e\include -IC:\Python24\include -IC:\Python24\PC -c c:\docume~1\ryan\locals~1\te
mp\tmpwjgics\src.win32-2.4\fortranobject.c -o c:\docume~1\ryan\locals~1\temp\tmp
wjgics\Release\docume~1\ryan\locals~1\temp\tmpwjgics\src.win32-2.4\fortranobject
.o" failed with exit status 1



More information about the f2py-users mailing list