scipy.weave on windows vista compiling error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

scipy.weave on windows vista compiling error

Tobias-56
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




_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scipy.weave on windows vista compiling error

Jerome Kieffer

Hi Tobias,

> 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

I thought weave never worked under windows ??? maybe with mingw it is better (but no under 64bits windows :(
This is the main reason why most people (like me) moved from weave to cython.

Cheers,

--
Jérôme Kieffer
Data analysis unit - ESRF
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scipy.weave on windows vista compiling error

Christoph Gohlke
In reply to this post by Tobias-56


On 5/21/2012 4:36 AM, Tobias wrote:

> 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
>
>

Try `weave.inline("""printf("Hello World!");""", [], compiler='mingw32')`

Worked for me with gcc 4.5.2 on win32-py2.7. The msvc9 compiler also
works for 64 bit Python.

Christoph
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scipy.weave on windows vista compiling error

federico vaggi-2
In reply to this post by Tobias-56

Message: 2
Date: Mon, 21 May 2012 11:36:13 +0000 (UTC)
From: Tobias <[hidden email]>
Subject: [SciPy-User] scipy.weave on windows vista compiling error
To: [hidden email]
Message-ID: <[hidden email]>
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

 

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scipy.weave on windows vista compiling error

Till Stensitzki
In reply to this post by Tobias-56
Have a look at the solution of:

http://stackoverflow.com/questions/10231572/f2py-returns-valueerror-invalid-version-number-4

It is a bug in distutils version comparison.


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: scipy.weave on windows vista compiling error

Tobias-56
Till Stensitzki <mail.till <at> gmx.de> writes:

>
> Have a look at the solution of:
>
> http://stackoverflow.com/questions/10231572/f2py-returns-valueerror-invalid-
version-number-4
>
> It is a bug in distutils version comparison.
>

Hey Till,

this really solved my problem!
Thank you very much

Tobi



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user