It's possible but ill-advised. The free mingw32 compiler can build
Python extensions just fine. I'm using it all the time to build Python
2.5 extensions for Windows.
In the future Python 2.6 and 3.0 are build with my VS 2008 system and
extensions can be build with the free express version, too.
Christian
> Well, IMO, the format of binary files generated by VC2003 and
> VC2005 is compatible in most cases.
Problem arise with the C runtime, not with object file format. In
particular, python uses the C api for file handling, and the standard
C is definitely not ABI compatible within VS versions.
I strongly advise you against using VS 2005 (with the binary python;
if you build python by yourself, then no problem; I don't know if it
is possible to build python with VS 2005). You *will* get crashes in
many cases.
David
Yep. Actually, I am using Cython for optimization on some parts of my code.
It indeed needs a good compiler to build binary from Cython scripts. Currently,
I employ MinGW for this task. Therefore I think, if VC2003-compiled python
runtime library can cooperate with MinGW, why not VC2003<->VC2005?
hehe.
>
> In the future Python 2.6 and 3.0 are build with my VS 2008 system and
> extensions can be build with the free express version, too.
>
> Christian
>
> I strongly advise you against using VS 2005 (with the binary python;
> if you build python by yourself, then no problem; I don't know if it
> is possible to build python with VS 2005). You *will* get crashes in
> many cases.
>
> David
>
---
ShenLei
Thank you for providing this document. Indeed, passing internal
pointers of one CRT lib to another is dangerous. But in most cases,
the python extension only focus on computational-intensive jobs
rather than API-intensive jobs. Therefore it is safe to let VS2003-built
python to call VS2005-built extensions with some attentions.
When you use distutil to trigger compilation, a special *python script*
will check whether the default compiler is VS2003. If there is no
VS2003, this script will pop-up the error for incompatible compilers.
I really really wonder how to *force* distutil to use my specified compile.
eg: (pseudo)
python setup.py build -c VC2005
or
python setup.py build --compiler=C:\VC8\cc --linker=C:\VC8\ld
Regards,
---
ShenLei
(Completely untested suggestions ;-)
Rename VC2005 to VC2003?
Change or add the appropriate registry entry?
You need to make sure that both MSSdk and DISTUTILS_USE_SDK are set, see
http://docs.python.org/dist/module-distutils.msvccompiler.html
Regards,
Martin
My stupid question: if there is something between VS 2003 and VS 2005
incompatible, what
about MINGW for python2.5(VS 2003)? Is it safe, or just as (un)safe
as VS 2005?