"...can't figure out the architecture type of..." problem when compiling Python C-extension with gcc
Asked Answered
V

3

11

I just upgraded from Snow Leopard to Lion, and an old python c-extension that I had to update didn't want to compile properly. I don't really know what to do here. Anyone who could help me out so it compiles ok? It compiled just fine back in Snow Leopard.

Home:folder Me$ python setup.py build
running build
running build_ext
building 'ccookies' extension
gcc -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ccookies.c -o build/temp.macosx-10.3-fat-2.7/ccookies.o
llvm-gcc-4.2: error trying to exec '/Developer/usr/bin//../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
In file included from /usr/include/architecture/i386/math.h:630,
                 from /usr/include/math.h:28,
                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:312,
                 from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:58,
                 from ccookies.c:5:
/usr/include/AvailabilityMacros.h:109:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
lipo: can't figure out the architecture type of: /var/folders/_t/yg4wppss5fv6dkmh89_6ykm40000gn/T//cc3Cgr3v.out
error: command 'gcc' failed with exit status 255
Vanden answered 27/7, 2011 at 5:26 Comment(0)
I
9

You appear to be using a 32-bit Python 2.7, possibly installed from python.org. Because of changes in Xcode 4 (dropping of support for the 10.4u SDK and gcc-4.0) it is not practical to build C extension modules with that Python on 10.7 Lion. Either use the Apple-supplied Python 2.7 (/usr/bin/python2.7) or install the python.org 64-bit/32-bit installer for 2.7.2 instead of the 32-bit-only one.

Incumbency answered 27/7, 2011 at 5:37 Comment(3)
Yup, installing the 32/64 bit 2.7.2 version solved it. Thanks much!Vanden
Great. BTW, if you plan to use Tkinter or IDLE, you should also install the latest ActiveState Tcl/Tk 8.5, if you can. The Apple-supplied version in 10.7 still has a few old bugs.Incumbency
My problem is slightly different but I have tried many of the suggested gcc related pil/pillow installation fixes. Following the advice here, I installed python 64/32 (2.7.5) as recommended, but I'm not sure if I actually have it running or if the old one is still on (interpreter gives Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45. However, I think this is the 32/64 python and I still get a gcc problem. Full problem description is: https://mcmap.net/q/1019464/-pillow-virtualenv-install-fails-quot-command-39-gcc-4-2-39-failed-quot-duplicate/770513 I am on OS X 10.6.8. Any thoughts?Archidiaconal
T
0

I was trying to install pynauty on my Mac OS X 10.7 and I got this problem. For some reasons, Ned Deily's answer didn't help me. I just want to provide one more way to solve this problem in case someone come to this page and is in the same situation as I am. The way I solved this prolem is:

Before running "python setup.py build", run: export ARCHFLAGS="-arch x86_64"

Toilworn answered 17/6, 2013 at 7:37 Comment(0)
J
0

On travis, I was getting this error. I've been using osx_image: osx10.11 since forever, but it suddenly stopped working, with this error, in last ~few weeks. Changing to osx_image: xcode7.3 fixed the error for me.

Jura answered 24/7, 2016 at 5:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.