[SciPy-user] weave and compiler

Barry Drake bldrake at adaptcs.com
Thu Oct 23 10:21:23 EDT 2003


This is my first time using weave.
OS: Win XP pro
Compilers: MS VS.Net, Enthought MingW32 distro with
gcc 3.2

I haven't found a way to force weave to use mingw32
rather that msvc.  Is there a configuration setting or
command line arg I can use?  I've checked:
platform_info.py
ext_tools.py
build_tools.py

It appears that on Windows if MSVS is installed weave
and distutils always default to the MS compiler.

In the fibonacci.py example code, I change the line:
    mod = ext_tools.ext_module('fibonacci_ext')

to
    mod = ext_tools.ext_module('fibonacci_ext',
'mingw32')

without success.  Here is the output:

Traceback (most recent call last):
  File
"C:\Python23\Lib\site-packages\weave\examples\fibonacci1.py",
line 71, in ?
    build_fibonacci()
  File
"C:\Python23\Lib\site-packages\weave\examples\fibonacci1.py",
line 66, in build_fibonacci
    mod.compile()
  File "..\ext_tools.py", line 340, in compile
    verbose = verbose, **kw)
  File "..\build_tools.py", line 240, in
build_extension
    compiler_dir =
platform_info.get_compiler_dir(compiler_name)
  File "..\platform_info.py", line 110, in
get_compiler_dir
    compiler_obj = create_compiler_instance(dist)
  File "..\platform_info.py", line 50, in
create_compiler_instance
    compiler = new_compiler(compiler=compiler_name)
  File ".\distutils\ccompiler.py", line 1173, in
new_compiler
  File ".\distutils\msvccompiler.py", line 212, in
__init__
distutils.errors.DistutilsPlatformError: 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.

How can I force the use of a different compiler?

Thanks.
Barry



More information about the SciPy-User mailing list