5

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?

  • I have a similar problem on OS X 10.8, with a binary install of Python 2.5 using a different version of GCC than the native install; my question is posted here:http://stackoverflow.com/questions/15816425/understanding-python-path-variables-module-installation-import-and-version-mana – Jonline Apr 04 '13 at 16:36

1 Answers1

0

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.

Community
  • 1
  • 1
vpit3833
  • 7,817
  • 2
  • 25
  • 25
  • 1
    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 Jul 12 '10 at 00:26
  • -1 OP wants gcc; bcpp is **Borland** C++ ... see http://docs.python.org/install/#borland-codegear-c – John Machin Jul 12 '10 at 03:07
  • @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 Jul 12 '10 at 03:54
  • @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 Jul 12 '10 at 03:55
  • I have, no luck. The option is multiple choice, if you look at the linked docs – Harkonnen Jama Jul 12 '10 at 05:33