Skip to content

Instantly share code, notes, and snippets.

@rwest
Created February 16, 2010 14:22
Show Gist options
  • Save rwest/305551 to your computer and use it in GitHub Desktop.
Save rwest/305551 to your computer and use it in GitHub Desktop.
put this in setup.py to avoid compiling ppc binaries
# Stop wasting my time compiling PowerPC-compatible C extensions on my intel Mac
import distutils.sysconfig
config = distutils.sysconfig.get_config_vars()
for key,value in config.iteritems():
location = str(value).find('-arch ppc')
if location>=0:
print "removing '-arch ppc' from %s"%(key)
config[key] = value.replace('-arch ppc ','')
# Tip from Lisandro Dalcin:
# FYI, in Py>=2.6 the ARCHFLAGS environ var is honored by distutils, so
# you should be able to
# export ARCHFLAGS='-arch i386' # or '-arch x86_64'
# and get your job done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment