[Distutils] Compiler options

Thomas Heller thomas.heller@ion-tof.com
Mon Apr 2 14:49:02 2001


> Konrad Hinsen wrote:
> > 
> > Judging from a quick glance at the relevant modules, there seems to be
> > no provision in Distutils to change the compiler options (specifically
> > optimization and debug options) from the values used during Python
> > installation. Is this true and if so, is this a temporary
> > implementation restriction or an intentional design decision?
I vaguely remember some code which is intended to pickup a CFLAGS
environment var.

Marc-Andre:
> 
> Funny, I stumbled into the same problem just a few days ago when
> I wrapped the 2.0.1 release of mxODBC. I found that the MS VC
> default options did not turn on optimization and that some
> important flags were missing.
[...]
> 
>     apply(old_MSVCCompiler__init__, (self,) + args, kws)
>     self.compile_options.extend(['/O2','/Gf','/GB','/GD'])
> 
Optimization is definitely turned on (distutils uses /Ox /MD /W3 /GX):

/Ox - This option combines optimizing options to produce the fastest
possible program. 

/GD is marked as 'for future use'.
/GB favors the Pentium Processor (imo this makes sense).
/Gf eliminates duplicate strings (imo also makes sense).


Thomas