Note that there are some explanatory texts on larger screens.

plurals
  1. POPip/easy_install ignoring ARCHFLAGS in SciPy installation?
    primarykey
    data
    text
    <p>I'm trying to compile SciPy for both 32-bit and 64-bit architectures, since some of the applications that use the library are only one arch or the other, following advice from a <a href="https://stackoverflow.com/questions/5427157/cannot-install-psycopg2-on-osx-10-6-7-with-xcode4">few</a> <a href="https://stackoverflow.com/q/5366882/218118">SO</a> <a href="https://stackoverflow.com/questions/6988528/why-is-gcc-ignoring-archflags-in-snow-leopard">questions</a>. This command has worked for me in a similar build about two months ago, but now it seems that some of the compiled shared libraries are only targeting x86_64:</p> <p><code>sudo ARCHFLAGS="-arch i386 -arch x86_64" pip install scipy</code></p> <p>I've tried several versions of this command, including setting the environment variables before <code>sudo</code>, including <code>-m32 -m64</code> in FFlags, using the OSX Command Line Tools, a full Xcode install, using clang instead of the LLVM that comes with OSX following the <a href="http://www.scipy.org/Installing_SciPy/Mac_OS_X#head-9ec15aabd402675e5139a8c9c727e6a23513d56a" rel="nofollow noreferrer">official SciPy install instructions</a>, easy_install instead of pip and even ./configure'ing separately, etc., but I can't seem to get it to work. Oddly, some of the .so's are building with both architectures, but some are not:</p> <pre><code>dhcp-10-249-71-202:~ kastman$ file /Library/Python/2.7/site-packages/scipy/optimize/*.so /Library/Python/2.7/site-packages/scipy/optimize/_cobyla.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/_lbfgsb.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/_minpack.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/_nnls.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/_slsqp.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/_zeros.so: Mach-O universal binary with 2 architectures /Library/Python/2.7/site-packages/scipy/optimize/_zeros.so (for architecture i386): Mach-O bundle i386 /Library/Python/2.7/site-packages/scipy/optimize/_zeros.so (for architecture x86_64): Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/minpack2.so: Mach-O 64-bit bundle x86_64 /Library/Python/2.7/site-packages/scipy/optimize/moduleTNC.so: Mach-O universal binary with 2 architectures /Library/Python/2.7/site-packages/scipy/optimize/moduleTNC.so (for architecture i386): Mach-O bundle i386 /Library/Python/2.7/site-packages/scipy/optimize/moduleTNC.so (for architecture x86_64): Mach-O 64-bit bundle x86_64 </code></pre> <p>Looking at the make log, it looks like the args are being passed successfully for both the libraries that seem to work and those that don't:</p> <pre><code># Minpack doesn't build fat binaries /usr/local/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle build/temp.macosx-10.7-intel-2.7/build/src.macosx-10.7-intel-2.7/scipy/optimize/minpack2/minpack2module.o build/temp.macosx-10.7-intel-2.7/build/src.macosx-10.7-intel-2.7/fortranobject.o build/temp.macosx-10.7-intel-2.7/scipy/optimize/minpack2/dcsrch.o build/temp.macosx-10.7-intel-2.7/scipy/optimize/minpack2/dcstep.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin11/4.6.2 -Lbuild/temp.macosx-10.7-intel-2.7 -lgfortran -o build/lib.macosx-10.7-intel-2.7/scipy/optimize/minpack2.so building 'scipy.optimize._slsqp' extension compiling C sources C compiler: clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe #... but moduleTNC does. llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/scipy/optimize/tnc/moduleTNC.o build/temp.macosx-10.7-intel-2.7/scipy/optimize/tnc/tnc.o -Lbuild/temp.macosx-10.7-intel-2.7 -o build/lib.macosx-10.7-intel-2.7/scipy/optimize/moduleTNC.so building 'scipy.optimize._cobyla' extension compiling C sources C compiler: clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe </code></pre> <p>Is it possible that the difference is the gfortran compiler I'm using? I used <code>brew install gfortran</code> which is supposed to be good according to the SciPy documentation. I would think the important line would be the <strong>C compiler: clang</strong> line, which appears to be nearly identical, including both -arch's.</p> <p>The last most detailed build I've tried was:</p> <p><code>sudo env ARCHFLAGS="-arch i386 -arch x86_64" ARCH="i386 x86_64" CC="clang" CXX="clang" FFLAGS="-ff2c -m32 -m64" pip install scipy</code></p> <p>Does anyone have suggestions about how to further diagnose this?</p> <p>(OSX 10.7, recent MacBookPro, compiling with gcc from the CLI tools and from Xcode)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload