views:

48

answers:

1

I'm on Snow Leopard, and want distutils to use gcc 4.0 and not 4.2, can anyone tell me how to make it do that? I've tried changing the /usr/bin/g* symlinks, and setting the C* environment vars -- but to no avail. Any thoughts?

A: 

Did you try python setup.py build --compiler=gcc? it is described in the docs.

EDIT: Also, this discussion looks very similar the present one. distutils.core appears to have the functions to specify the compiler and platform. distutils.ccompiler.get_compiler(osname, platform) or distutils.ccompiler.new_compiler(platform, compiler, verbose, dry_run, force) should work.

vpit3833
That options is basically broken, it's multiple choice and doesn't let you specify the compiler version or invocation command. Irritatingly, distutils respects the environment variables when given the build command, but not the install command -- and if you try to install something so built, it just throws it out the window and starts over again...
Harkonnen Jama
-1 OP wants gcc; bcpp is **Borland** C++ ... see http://docs.python.org/install/#borland-codegear-c
John Machin
@John Changed bcpp to gcc if that helps any better. I was thinking showing how to use any alternative compiler would help, but as the OP has indicated in the comment, it does not.
vpit3833
@Harkonnen on your Mac have you tried making an alias point to the compiler of your choice and see if it works? What's multiple choice?
vpit3833
@vpit I have, no luck. The option is multiple choice, if you look at the linked docs
Harkonnen Jama