PIP / easy_install的忽略SciPy的安装ARCHFLAGS? [英] Pip/easy_install ignoring ARCHFLAGS in SciPy installation?

查看:612
本文介绍了PIP / easy_install的忽略SciPy的安装ARCHFLAGS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译SciPy的为32位和64位架构,因为一些使用该库的应用程序都只有一个拱或者从其他的,以下建议<一href=\"http://stackoverflow.com/questions/5427157/cannot-install-psycopg2-on-osx-10-6-7-with-x$c$c4\">few SO <一个href=\"http://stackoverflow.com/questions/6988528/why-is-gcc-ignoring-archflags-in-snow-leopard\">questions.这个命令在一个类似的建设为我工作大约两个月前,但现在看来,一些编译共享库都只是针对x86_64的:

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 few SO questions. 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:

须藤ARCHFLAGS = - 拱i386的-arch x86_64的PIP安装SciPy的

我试过几个版本此命令,其中包括前须藤设置环境变量,包括 -m32 -m64 在FFLAGS,使用OSX命令行工具,一个完整的X code安装,使用铿锵而不是随OSX之后的官方SciPy的安装说明,easy_install的,而不是点子,甚至单独./configure'ing等,但我似乎无法得到它的工作。奇怪的是,一些。所以的与这两种体系结构建筑,但有些不是的:

I've tried several versions of this command, including setting the environment variables before sudo, including -m32 -m64 in FFlags, using the OSX Command Line Tools, a full Xcode install, using clang instead of the LLVM that comes with OSX following the official SciPy install instructions, 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:

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

综观化妆日志,它看起来像被成功通过这两个似乎工作的图书馆和那些不这样做的ARGS:

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:

# 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

难道不同的是,我使用gfortran编译器?我用酿造安装gfortran 这是应该根据SciPy的文档是好的。我认为重要的行会在 C编译器:铛行,这似乎是几乎相同的,包括-arch的

Is it possible that the difference is the gfortran compiler I'm using? I used brew install gfortran which is supposed to be good according to the SciPy documentation. I would think the important line would be the C compiler: clang line, which appears to be nearly identical, including both -arch's.

最后一个最详细的版本我试过是:

The last most detailed build I've tried was:

须藤ENV ARCHFLAGS = - 拱i386的-arch x86_64的ARCH =I386 x86_64的CC =铛CXX =铛FFLAGS = - ff2c -m32 -m64PIP安装SciPy的

有没有人对如何进一步诊断这个建议吗?

Does anyone have suggestions about how to further diagnose this?

(OSX 10.7,最近的MacBookPro,从CLI工具,并根据X code用gcc编译)

(OSX 10.7, recent MacBookPro, compiling with gcc from the CLI tools and from Xcode)

推荐答案

从源代码和建筑拉动似乎正确地创建脂肪二进制文件。我不知道这是一个已经被固定的(我没看到SciPy的开发列表上的任何东西)的错误,或者如果它具有画中画做/ easy_install的,但这里是我做得到它的工作:

Pulling from source and building appears to correctly create fat binaries. I'm not sure if this is a bug that's already been fixed (I didn't see anything on the scipy dev list) or if it has to do with pip/easy_install, but here's what I did to get it to work:

git clone https://github.com/scipy/scipy.git; cd scipy
export ARCHFLAGS='-arch i386 -arch x86_64'
python setup.py config
python setup.py build
sudo python setup.py install

没有特殊的CC环境变量,gfortran是从酿造安装gfortran ,和令人惊讶它看起来像GCC是LLVM-GCC。

No special CC environment variables, gfortran was from brew install gfortran, and surprisingly it looks like gcc was llvm-gcc.

这篇关于PIP / easy_install的忽略SciPy的安装ARCHFLAGS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆