我试图通过pip install annoy
在CentOS 6.5服务器上安装annoy,但出现以下错误。有什么想法吗?我在here中找到了VBROADCASTSS
,但仍然不知道如何修复这些错误。在
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xxx/.pyenv/versions/2.7.10/include/python2.7 -c src/annoymodule.cc -o build/temp.linux-x86_64-2.7/src/annoymodule.o -O3 -march=native -ffast-math
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from /home/xxx/.pyenv/versions/2.7.10/include/python2.7/Python.h:8:0,
from src/annoymodule.cc:16:
/home/xxx/.pyenv/versions/2.7.10/include/python2.7/pyconfig.h:1188:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/stdio.h:28:0,
from src/annoylib.h:18,
from src/annoymodule.cc:15:
/usr/include/features.h:162:0: note: this is the location of the previous definition
# define _POSIX_C_SOURCE 200809L
^
In file included from /home/xxx/.pyenv/versions/2.7.10/include/python2.7/Python.h:8:0,
from src/annoymodule.cc:16:
/home/xxx/.pyenv/versions/2.7.10/include/python2.7/pyconfig.h:1210:0: warning: "_XOPEN_SOURCE" redefined
#define _XOPEN_SOURCE 600
^
In file included from /usr/include/stdio.h:28:0,
from src/annoylib.h:18,
from src/annoymodule.cc:15:
/usr/include/features.h:164:0: note: this is the location of the previous definition
# define _XOPEN_SOURCE 700
^
/tmp/ccfNu0mQ.s: Assembler messages:
/tmp/ccfNu0mQ.s:21160: Error: suffix or operands invalid for `vbroadcastss'
/tmp/ccfNu0mQ.s:21163: Error: suffix or operands invalid for `vbroadcastss'
/tmp/ccfNu0mQ.s:21532: Error: suffix or operands invalid for `vbroadcastss'
/tmp/ccfNu0mQ.s:24347: Error: suffix or operands invalid for `vbroadcastss'
/tmp/ccfNu0mQ.s:24350: Error: suffix or operands invalid for `vbroadcastss'
/tmp/ccfNu0mQ.s:24718: Error: suffix or operands invalid for `vbroadcastss'
error: command 'gcc' failed with exit status 1
我使用
gcc -march=native -Q help=target
来比较几个Linux机器上的gcc设置。 我发现主要的区别是故障机器上的-march
行是haswell
,其他的是haswell
像core...
。以下是来自其他服务器的相应输出:CentOS release 6.5 (Final)
--march=corei7-avx
CentOS Linux 7 (Core)
--march=core-avx-i
Debian GNU/Linux 7 (wheezy)
--march=core-avx2
我猜错误来自gcc使用的不同指令集。 在naugle的
setup.py
中,-march=native
行中的-march=native
意味着gcc将尝试检测处理器并自动为其设置适当的标志。 所以我将这个标志改为-march=corei7-avx
,在setup.py
中,错误消失了。在如果您感兴趣,请参阅here中的
-march
以获取详细信息。在更新
在与服务器管理员确认后,此错误是由于CentOS loader软件比服务器中新的Haswell CPU旧。安装最新版本的
binutils
包也可以解决此问题。在您的binutils版本太旧,无法支持AVX/AVX2指令,在您的处理器上检测到这些指令可用。 您需要binutils 2.22或更新版本来支持AVX。在
相关问题 更多 >
编程相关推荐