using distutils / setuptools on Windows (MinGW)
Hi all! In our working group, we're starting to use python for some machine learning tasks. Performance needs force us to deliver some of our code as optimized C code. To make a long story short: I was the one to discover howto deploy native python extensions on windows. The online documentation on various sites about that topic is quite old and sometimes faulty. I think the setuptools are a big step forward for professional deployment of python applicatoions. Keep up the good work guys! Maybe I can contribute to the project by giving you a more recent documentation on compiling and deploying python code and python C extensions on windows using -MinGW -setuptools / distutils -SWIG. Cheers, Daniel
At 04:59 PM 12/19/2005 +0100, Daniel Glöckner wrote:
Maybe I can contribute to the project by giving you a more recent documentation on compiling and deploying python code and python C extensions on windows using -MinGW
FYI, the shortest path to using MinGW with distutils or setuptools is to run this script and follow its directions: http://mail.python.org/pipermail/python-dev/2004-January/041676.html Once you've done that, the version of Python you ran it with will use the MinGW compiler automatically for all building, with no '-cmingw32' required. The script should probably be added to Python's "tools" directory, particularly for Windows. I've just never gotten around to going through the necessary ceremony to get it in. Martin v Loewis has also offered to change Python's Windows distribution a bit so that the script would be unnecessary, except for setting the [build] options in distutils.cfg, but I'm not sure if that's happened yet either, even for Python 2.5. But the script will work for Python 2.3 and up, maybe even 2.2.
On 12/19/05, Phillip J. Eby
At 04:59 PM 12/19/2005 +0100, Daniel Glöckner wrote: FYI, the shortest path to using MinGW with distutils or setuptools is to run this script and follow its directions:
http://mail.python.org/pipermail/python-dev/2004-January/041676.html
Once you've done that, the version of Python you ran it with will use the MinGW compiler automatically for all building, with no '-cmingw32' required.
Actually, the referenced script just prints instructions on modifying distutils.cfg, it doesn't do it automatically.
The script should probably be added to Python's "tools" directory, particularly for Windows. I've just never gotten around to going through the necessary ceremony to get it in.
Probably not any more - see below.
Martin v Loewis has also offered to change Python's Windows distribution a bit so that the script would be unnecessary, except for setting the [build] options in distutils.cfg, but I'm not sure if that's happened yet either, even for Python 2.5. But the script will work for Python 2.3 and up, maybe even 2.2.
As of Python 2.4, this is no longer needed - libpython24.a is shipped with the standard Python Windows installer (and yes, I mean all versions of Python 2.4 - memo to self, must upgrade home PC...) The distutils.cfg change is still needed if you want to make mingw the default - personally, I just use the command line flag --compiler=mingw32. Paul.
participants (3)
-
Daniel Glöckner
-
Paul Moore
-
Phillip J. Eby