<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1272" rel="nofollow">http://projects.scipy.org/numpy/ticket/1272</a> on 2009-10-23 by trac user brian, assigned to unknown.</em></p>
<p dir="auto">Hi,</p>
<p dir="auto">I'm unable to build numpy-1.3.0 as a 4-way binary on a 10.5 Mac i386 using gcc-4.0.1.  I receive the following error message when "-arch ppc64" is included as a compiler flag.</p>
<p dir="auto">numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness</p>
<p dir="auto">I'm able to build successfully after editing</p>
<p dir="auto">npy_endian.h</p>
<p dir="auto">Including "defined(NPY_CPU_PPC64)" to line 28 seems to do the trick.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1111" rel="nofollow">http://projects.scipy.org/numpy/ticket/1111</a> on 2009-05-20 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dwf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dwf">@dwf</a>, assigned to unknown.</em></p>
<p dir="auto">Trying to build either a fat64 or a 4-way binary of NumPy on Mac OS X is failing in svn r7002 an endianness detection error. This came up on the mailing list ([http://mail.scipy.org/pipermail/scipy-user/2009-May/021066.html thread]) and I encountered it myself. Some #warnings show PPC64 builds are the problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ gcc -arch ppc64 -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O3 -Wall -DNDEBUG -g -fwrapv -Wstrict-prototypes -arch x86_64 -arch ppc64 -Inumpy/core/include -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/Library/Frameworks/Python64.framework/Versions/2.6/include/python2.6 -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/src/multiarray -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/src/umath -c  build/src.macosx-10.5-fat64-2.6/numpy/core/src/_sortmodule.c
In file included from numpy/core/include/numpy/npy_endian.h:22,
                 from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_cpu.h:39:6: warning: #warning &quot;PPC64! Hooray!&quot;
In file included from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
In file included from numpy/core/include/numpy/npy_endian.h:22,
                 from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_cpu.h:30:6: warning: #warning &quot;AMD64! Hooray!&quot;
lipo: can't figure out the architecture type of: /var/folders/jz/jzMQLnV-GOWCP55tPgPBl++++Tc/-Tmp-//ccjBE91A.out"><pre class="notranslate"><code class="notranslate">$ gcc -arch ppc64 -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O3 -Wall -DNDEBUG -g -fwrapv -Wstrict-prototypes -arch x86_64 -arch ppc64 -Inumpy/core/include -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/Library/Frameworks/Python64.framework/Versions/2.6/include/python2.6 -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/src/multiarray -Ibuild/src.macosx-10.5-fat64-2.6/numpy/core/src/umath -c  build/src.macosx-10.5-fat64-2.6/numpy/core/src/_sortmodule.c
In file included from numpy/core/include/numpy/npy_endian.h:22,
                 from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_cpu.h:39:6: warning: #warning "PPC64! Hooray!"
In file included from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
In file included from numpy/core/include/numpy/npy_endian.h:22,
                 from numpy/core/include/numpy/ndarrayobject.h:33,
                 from numpy/core/include/numpy/noprefix.h:7,
                 from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_cpu.h:30:6: warning: #warning "AMD64! Hooray!"
lipo: can't figure out the architecture type of: /var/folders/jz/jzMQLnV-GOWCP55tPgPBl++++Tc/-Tmp-//ccjBE91A.out
</code></pre></div>
<p dir="auto">I've attached a tiny patch that fixes this, adds PPC64 as one of the architectures detected as big-endian.</p>