Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: distutils compiler flags for extension modules

Thread Tools

Re: distutils compiler flags for extension modules

Floris Bruynooghe
Posts: n/a
On Mar 20, 9:48*am, Christian Meesters <(E-Mail Removed)> wrote:
> as I got no answers with the previous question (subject: disabling
> compiler flags in distutils), I thought I should ask the question in a
> different way: Is there an option to set the compiler flags for a C/C++
> extension in distutils? There is the extra_compile_args-option in the
> Extension class, yet this offers only to give additional flags, but I'd
> like to have 'total' control about the compile args. Any hint?

You can subclass the build_ext class and overwrite .finalize_options()
to do something like:

for ext in self.extensions:
# fiddle with ext.extra_compile_args

And if that isn't enough you can modify the compiler (with some flags)
by overwriting .build_extension() and modify self.compiler using
it's .set_executables() method (file:///usr/share/doc/python2.5/html/
dist/module-distutils.ccompiler.html#l2h-37) before calling

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
Re: Quetion about flags of socket.recv(bufsize, [flags]) Steve Holden Python 0 02-08-2009 04:09 PM
how to add command line flags to distutils setup script? Python 1 12-09-2008 01:08 AM
can distutils windows installer invoke another distutils windows installer Python 1 05-11-2006 10:07 PM