[SciPy-User] f2py on Windows with MSVC9

Klonuo Umom klonuo at gmail.com
Tue May 31 20:17:01 EDT 2011


> 
> solved this case

Well, it's not solved really

I had to make some changes and still can't produce working example

I took even more dummy fortran code from here:
http://www.scipy.org/F2PY_Windows

dummy.f
=====================================================================
      SUBROUTINE HELLO()
      WRITE(*,*)'HELLO FROM FORTRAN90!!!'
      END
---------------------------------------------------------------------


f2py -c -m dummy dummy.f
=====================================================================
dummymodule.obj : error LNK2001: unresolved external symbol _hello_
---------------------------------------------------------------------




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\tmphyln9j\src.win32-2.6\dummymodule.c
creating c:\temp\tmp\tmphyln9j
creating c:\temp\tmp\tmphyln9j\src.win32-2.6
Reading fortran codes...
        Reading file 'dummy.f' (format:fix,strict)
Post-processing...
        Block: dummy
                        Block: hello
Post-processing (stage 2)...
Building modules...
        Building module "dummy"...
                Constructing wrapper function "hello"...
                  hello()
        Wrote C/API module "dummy" to file "c:\temp\tmp\tmphyln9j\src.win32-2.6\dummymodule.c"
  adding 'c:\temp\tmp\tmphyln9j\src.win32-2.6\fortranobject.c' to sources.
  adding 'c:\temp\tmp\tmphyln9j\src.win32-2.6' to include_dirs.
copying C:\Python26\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\temp\tmp\tmphyln9j\src.win32-2.6
copying C:\Python26\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\temp\tmp\tmphyln9j\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\tmphyln9j\Release
creating c:\temp\tmp\tmphyln9j\Release\temp
creating c:\temp\tmp\tmphyln9j\Release\temp\tmp
creating c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j
creating c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\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\tmphyl n9j\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC /Tcc:\te mp\tmp\tmphyln9j\src.win32-2.6\dummymodule.c /Foc:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummy module.obj 
Found executable c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\temp\tmp\tmphyl n9j\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC /Tcc:\te mp\tmp\tmphyln9j\src.win32-2.6\fortranobject.c /Foc:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\fortranobject.obj
compiling Fortran sources
Fortran f77 compiler: C:\Program Files\Intel\Compiler\11.1\067\Bin\ia32\ifort.exe -FI -w90 -w95 /F6000000 /fpe:3 /Qo penmp /w /I:C:\Program Files\VNI\imsl\fnl700\winin111i32\include\dll /nologo /O1 /G7 /QaxW /QaxM 
Fortran f90 compiler: C:\Program Files\Intel\Compiler\11.1\067\Bin\ia32\ifort.exe -FR /F6000000 /fpe:3 /Qopenmp /w / I:C:\Program Files\VNI\imsl\fnl700\winin111i32\include\dll /nologo /F6000000 /fpe:3 /Qopenmp /w /I:C:\Program Files\ VNI\imsl\fnl700\winin111i32\include\dll /nologo /O1 /G7 /QaxW /QaxM 
Fortran fix compiler: C:\Program Files\Intel\Compiler\11.1\067\Bin\ia32\ifort.exe -FI -4L72 -w /F6000000 /fpe:3 /Qop enmp /w /I:C:\Program Files\VNI\imsl\fnl700\winin111i32\include\dll /nologo /F6000000 /fpe:3 /Qopenmp /w /I:C:\Progr am Files\VNI\imsl\fnl700\winin111i32\include\dll /nologo /O1 /G7 /QaxW /QaxM 
compile options: '-Ic:\temp\tmp\tmphyln9j\src.win32-2.6 -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python26\include -IC:\Python26\PC -c'
ifort.exe:f77: dummy.f
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild /EXPORT:initdummy c:\temp\tmp\tm phyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummymodule.obj c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\sr c.win32-2.6\fortranobject.obj c:\temp\tmp\tmphyln9j\Release\dummy.o /OUT:.\dummy.pyd /IMPLIB:c:\temp\tmp\tmphyln9j\R elease\temp\tmp\tmphyln9j\src.win32-2.6\dummy.lib /MANIFESTFILE:c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src .win32-2.6\dummy.pyd.manifest 
Found executable c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe
LIBCMT.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crtheap.obj) : error LNK2005: __malloc_crt already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR90.dll)
 Creating library c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummy.lib and object c:\temp\tmp\ tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummy.exp 
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
dummymodule.obj : error LNK2001: unresolved external symbol _hello_
libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main
.\dummy.pyd : fatal error LNK1120: 2 unresolved externals
error: Command "c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C :\Python26\libs /LIBPATH:C:\Python26\PCbuild /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild /EXPORT:initdumm y c:\temp\tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummymodule.obj c:\temp\tmp\tmphyln9j\Release\temp\ tmp\tmphyln9j\src.win32-2.6\fortranobject.obj c:\temp\tmp\tmphyln9j\Release\dummy.o /OUT:.\dummy.pyd /IMPLIB:c:\temp \tmp\tmphyln9j\Release\temp\tmp\tmphyln9j\src.win32-2.6\dummy.lib /MANIFESTFILE:c:\temp\tmp\tmphyln9j\Release\temp\t mp\tmphyln9j\src.win32-2.6\dummy.pyd.manifest" failed with exit status 1120 





More information about the SciPy-User mailing list