Monday, November 14, 2011

Compiling C libraries for use in python modules on OS X: specify a target architecture

My pycurl installation was failing with these errors:

$pip install pycurl


assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed

Installed assemblers are:

/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64

/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
The solution was to specify an architecture like this:
env ARCHFLAGS="-arch x86_64" pip install pycurl

No comments: