gpt4 book ai didi

python - 错误 : suffix or operands invalid for `vbroadcastss'

转载 作者:太空狗 更新时间:2023-10-30 01:07:08 26 4
gpt4 key购买 nike

我正在尝试安装 annoy在 CentOS 6.5 服务器上通过 pip install 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,其他是类似于 core...。这是其他服务器的相应输出:

CentOS 6.5 版(最终版) - -march=corei7-avx

CentOS Linux 7(核心) - -march=core-avx-i

Debian GNU/Linux 7(喘息) - -march=core-avx2

我猜错误来自 gcc 使用的不同指令集。在 annoy 的 setup.py 中, -march=nativeextra_compile_args=['-O3', '-march=native', '-ffast-math '] 表示 gcc 将尝试检测处理器并自动为其设置适当的标志。所以我在 setup.py 中将此标志更改为 -march=corei7-avx 并且错误消失了。

参见 here 中的 -march如果您有兴趣了解详情。

更新

在与服务器管理员确认后,这个错误是由于 CentOS 加载器软件比服务器中新的 Haswell CPU 旧。安装最新版本的 binutils 包也可以解决问题。

关于python - 错误 : suffix or operands invalid for `vbroadcastss' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33193970/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com