[SciPy-User] f2py on Windows with MSVC9

Klonuo Umom klonuo at gmail.com
Tue May 31 19:02:30 EDT 2011


I tried to make use of fortran code, and made trivial fortran code
example. It runs fine with ifort compiler, FYI

Then I declare CF2PY in and outs and hoping to see it work

=====================================================================
f2py -c -m dummy dummy.f
---------------------------------------------------------------------

which unfortunatelly throws error:
=====================================================================
dummymodule.c(77) : error C2010: '.' : unexpected in macro formal parameter list
---------------------------------------------------------------------

dummymodule.c(77) is this line:
=====================================================================
#define size(var, dim...) f2py_size((PyArrayObject *)(capi_ ## var ## _tmp), ##dim, -1)
---------------------------------------------------------------------


Any ideas what's wrong and if it's possible to do this under:

Windows XP SP3 32 bit
MSVC 2008
Intel Fortran Compiler 11.1
Python 2.6.6
NumPy 1.6


Thanks in advance


Here is full log:


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
build_src
building extension "dummy" sources
f2py options: []
f2py:> c:\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.c
creating c:\temp\tmp\tmpgkb57o
creating c:\temp\tmp\tmpgkb57o\src.win32-2.6
Reading fortran codes...
        Reading file 'dummy.f' (format:fix,strict)
crackline: groupcounter=3 groupname={0: '', 1: 'module', 2: 'interface', 3: 'subroutine'}
crackline: Mismatch of blocks encountered. Trying to fix it by assuming "end" statement.
crackline: groupcounter=2 groupname={0: '', 1: 'module', 2: 'interface', 3: 'subroutine'}
crackline: Mismatch of blocks encountered. Trying to fix it by assuming "end" statement.
crackline: groupcounter=1 groupname={0: '', 1: 'module', 2: 'interface', 3: 'subroutine'}
crackline: Mismatch of blocks encountered. Trying to fix it by assuming "end" statement.
Post-processing...
        Block: dummy
                        Block: fhist
Post-processing (stage 2)...
Building modules...
        Building module "dummy"...
                Constructing wrapper function "fhist"...
                  fhist(wavdata,[l])
        Wrote C/API module "dummy" to file "c:\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.c"
  adding 'c:\temp\tmp\tmpgkb57o\src.win32-2.6\fortranobject.c' to sources.
  adding 'c:\temp\tmp\tmpgkb57o\src.win32-2.6' to include_dirs.
copying C:\Python26\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\temp\tmp\tmpgkb57o\src.win32-2.6
copying C:\Python26\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\temp\tmp\tmpgkb57o\src.win32-2.6
build_src: building npy-pkg config files
running build_ext
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Found executable C:\Program Files\Intel\Compiler\11.1\067\Bin\ia32\ifort.exe
Found executable C:\Program Files\Intel\Compiler\11.1\067\Bin\ia32\ifort.exe
customize IntelVisualFCompiler
customize IntelVisualFCompiler using build_ext
building 'dummy' extension
compiling C sources
creating c:\temp\tmp\tmpgkb57o\Release
creating c:\temp\tmp\tmpgkb57o\Release\temp
creating c:\temp\tmp\tmpgkb57o\Release\temp\tmp
creating c:\temp\tmp\tmpgkb57o\Release\temp\tmp\tmpgkb57o
creating c:\temp\tmp\tmpgkb57o\Release\temp\tmp\tmpgkb57o\src.win32-2.6
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\temp\tmp\tmpgkb57o\src.win32-2.6-IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC /Tcc:\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.c /Foc:\temp\tmp\tmpgkb57o\Release\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.obj
Found executable c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe
dummymodule.c
c:\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.c(77) : error C2010: '.' : unexpected in macro formal parameter list

error: Command "c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\temp\tmp\tmpgkb57o\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC /Tcc:\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.c /Foc:\temp\tmp\tmpgkb57o\Release\temp\tmp\tmpgkb57o\src.win32-2.6\dummymodule.obj" failed with exit status 2



More information about the SciPy-User mailing list