[f2py] problems under windows

pearu at cens.ioc.ee pearu at cens.ioc.ee
Tue Jul 12 13:04:33 EEST 2005


On Sun, 10 Jul 2005, Jens Brandenburg wrote:

> hi together,
> 
> The f2py itself runs quiet good but if i try the following:
> 
> ~\my-fortran>f2py -c hello.f -m hello
> 
> I get:
> 
> numpy_info:
>   FOUND:
>     define_macros = [('NUMERIC_VERSION', '"\\"23.8\\""')]
>     include_dirs = ['C:\\Programme\\Python23\\include']
> 
> running build
> running config_fc
> running build_src
> building extension "hello" sources
> f2py:> c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src\hellomodule.c
> creating c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu
> creating c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src
> Reading fortran codes...
>         Reading file 'hello.f'
> 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:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src/hellomodule.c"
>   adding 'c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src\fortranobject.c' to sources.
>   adding 'c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src' to include_dirs.
> copying C:\Programme\Python23\lib\site-packages\f2py2e\src\fortranobject.c -> c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src
> copying C:\Programme\Python23\lib\site-packages\f2py2e\src\fortranobject.h -> c:\dokume~1\jensb\lokale~1\temp\tmpmwtdiu\src
> running build_ext
> No module named msvccompiler in scipy_distutils, trying from distutils..
> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed.
> 
> ...and now my questions:
> 
> 1. Are these compiler modules in scipy_distutils real fortran
> compilers or do i need a real executable?

You'll need version 6 of Visual Studio installed. Or install mingw
compiler instead and then use

  f2py --compiler=mingw32 ...

to compile your code.

> 2. Is there an msvccompiler module available?

msvccompiler is part of standard distutils.

Pearu




More information about the f2py-users mailing list