[Distutils] Specifying a compiler

Phillip J. Eby pje at telecommunity.com
Thu Nov 30 05:28:37 CET 2006


At 05:28 PM 11/29/2006 -0700, Robert McFadzean wrote:
>The documentation indicates that one can specify a compiler as in build 
>--compiler=vc98.

Actually, you have to use one of these:

$ python setup.py build --help-compiler
List of available compilers:
   --compiler=bcpp     Borland C++ Compiler
   --compiler=cygwin   Cygwin port of GNU C Compiler for Win32
   --compiler=emx      EMX port of GNU C Compiler for OS/2
   --compiler=mingw32  Mingw32 port of GNU C Compiler for Win32
   --compiler=msvc     Microsoft Visual C++
   --compiler=mwerks   MetroWerks CodeWarrior
   --compiler=unix     standard UNIX-style compiler


>I have Visual Studio VC98 C++ 6.0    vc98 doesn't work to specify the 
>compiler.  Does anyone know how I would specify it so setup will use what 
>I have, rather than looking for VC7.0 that was used to compile python?

I suspect the answer is that you can't, and have it still work.  You 
probably have to download one of the "free" MS compilers.  There may also 
be some sort of environment variable and/or registry hacking that can be 
done to force Python to use your older compiler, but it's not clear that 
the resulting extensions will actually work with your Python.

Alternately, you can use the free MinGW compiler.  See:

http://www.mingw.org/MinGWiki/index.php/Python%20extensions

for one possible source of instructions.



More information about the Distutils-SIG mailing list