Compile fails: "fatal error: error writing to -: Broken pipe" #35

Closed
rays opened this Issue Mar 29, 2011 · 4 comments

Comments

Projects
None yet
4 participants
@rays

rays commented Mar 29, 2011

I'm using xcode4 and trying to compile pylibmc on a new machine running osx 10.6.7 and get the following error

running install
running build
running build_py
running build_ext
building '_pylibmc' extension
creating build/temp.macosx-10.6-universal-2.6
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DUSE_ZLIB -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _pylibmcmodule.c -o build/temp.macosx-10.6-universal-2.6/_pylibmcmodule.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: 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
_pylibmcmodule.c:2028: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/8q/8q7FGaB3FHq8zCFUe4wSVk+++TI/-Tmp-//ccfKEKaS.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
@rays

This comment has been minimized.

Show comment Hide comment
@rays

rays Mar 30, 2011

Turns out PPC libraries are no longer in xcode 4, but ARCHFLAGS is supported and you can tell gcc not to use ppc, whew

export ARCHFLAGS='-arch i386 -arch x86_64'

rays commented Mar 30, 2011

Turns out PPC libraries are no longer in xcode 4, but ARCHFLAGS is supported and you can tell gcc not to use ppc, whew

export ARCHFLAGS='-arch i386 -arch x86_64'

@rays rays closed this Mar 30, 2011

@jbergstroem

This comment has been minimized.

Show comment Hide comment
@jbergstroem

jbergstroem Mar 30, 2011

Contributor

Could/should be in docs, helpful comment

Contributor

jbergstroem commented Mar 30, 2011

Could/should be in docs, helpful comment

@lericson

This comment has been minimized.

Show comment Hide comment
@lericson

lericson Mar 30, 2011

Owner

Major WTF at Apple's QA...

Want to know why this happens? Apple's new Xcode release removes the assembler for PPC, while the core system retains their PPC images in the fat binaries. If you were to run file /usr/bin/python you would most likely find the following:

/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64):  Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386):    Mach-O executable i386
/usr/bin/python (for architecture ppc7400): Mach-O executable ppc

Python compiles C extensions with the same compiler flags that Python itself was compiled with. Hence it follows that nobody at Apple took the time to QA properly and install a Python C extensions on their Xcode 4-enabled systems.

I have confirmed that Apple's upcoming release of OS X (Lion) will not have Python built with PPC.

</rant>

Owner

lericson commented Mar 30, 2011

Major WTF at Apple's QA...

Want to know why this happens? Apple's new Xcode release removes the assembler for PPC, while the core system retains their PPC images in the fat binaries. If you were to run file /usr/bin/python you would most likely find the following:

/usr/bin/python: Mach-O universal binary with 3 architectures
/usr/bin/python (for architecture x86_64):  Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386):    Mach-O executable i386
/usr/bin/python (for architecture ppc7400): Mach-O executable ppc

Python compiles C extensions with the same compiler flags that Python itself was compiled with. Hence it follows that nobody at Apple took the time to QA properly and install a Python C extensions on their Xcode 4-enabled systems.

I have confirmed that Apple's upcoming release of OS X (Lion) will not have Python built with PPC.

</rant>

@jflo

This comment has been minimized.

Show comment Hide comment
@jflo

jflo May 19, 2011

Ran into this same issue when building Thrift, ARCHFLAGS workaround worked. +1

jflo commented May 19, 2011

Ran into this same issue when building Thrift, ARCHFLAGS workaround worked. +1

ketralnis pushed a commit to ketralnis/pylibmc that referenced this issue Oct 4, 2012

Clean up Apple's mess
In short, Python is built with PPC but the PPC assembler is removed. Python tries to build C extensions with PPC, fails. The fix makes it only build i386/x84_64 for darwin where the PPC assembler has been removed.

Fixes #35

@ejhumphrey ejhumphrey referenced this issue in scikit-learn/scikit-learn Dec 26, 2012

Closed

Compile issues with missing PPC assembler #262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment