Message: 2
Date: Mon, 21 May 2012 11:36:13 +0000 (UTC)
From: Tobias <tobias@ebockwurst.de>
Subject: [SciPy-User] scipy.weave on windows vista compiling error
To: scipy-user@scipy.org
Message-ID: <loom.20120521T131903-9@post.gmane.org>
Content-Type: text/plain; charset=us-ascii

Hello!

I'm trying to bring scipy.weave to work on Windows Vista with MinGw.
I use Python 2.7.1, Scipy 0.10.1 and MinGw 4.6.2
My code looks like the following:

 from scipy import weave
 weave.inline("""print('Hello World!');""", [], compiler = 'mingw32-gcc')

I get the following error message:

 DistutilsPlatformError: don't know how to compile C/C++ code on platform 'nt'
 with 'mingw32-gcc' compiler

With MinGw come a lot of different compiler. If I choose not 'mingw32-gcc' but
for example 'gcc' weave complains

 ValueError: invalid version number '4.'

So I also downloaded the olf MinGW 2.9.5 Version. Then I also get the Error
"don't know how to compile C/C++ code on platform 'nt'"

The PATH-Variables are set and I also made shure, that there is write access to
the MinGw and Python folders. Searching for this error message gave no
progress, but maybe you could help me. Would be great!

All the best
Tobi


Your C++ compiler has to match the C++ compiler used to compile Python - which, I think, by default, on Vista is Visual Studio 2008.

However, the weave module is not actively maintained, and there are much better options right now for interfacing with C/C++.  I would highly suggest that if you have some performance-critical part of your code, you either use Cython, or, if it is a simple numerical expression, use the amazing numexpr package. 

I warn you though - while pure Python code is very portable across platforms, interfacing Python with other libraries (mostly, C and C++) is a huge pain on Windows.  If you really want to continue, I strongly advise you take advantage of Christoph Gohlke's work:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

who has done all the hard work has made binary installers for most of the hard-to-compile Python libraries with C and C++ dependencies.

Federico