2015-10-18 41 views
3

無效操作數我想一個CentOS 6.5服務器上安裝通過pip install annoyannoy,但得到了下面的錯誤。任何想法?我發現VBROADCASTSShere,但仍然不知道如何解決這些錯誤。錯誤:後綴或`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 

回答

3

我用gcc -march=native -Q --help=target來比較幾臺Linux機器上的gcc設置。 我發現的主要區別是,-march線路故障機器上爲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。 在煩擾的setup.py中,管線extra_compile_args=['-O3', '-march=native', '-ffast-math']-march=native裝置GCC將嘗試檢測所述處理器和自動設定適當的標記它。 所以我改變這個標誌-march=corei7-avxsetup.py和錯誤了。

有關詳細信息,請參閱here-march如果你有興趣。

更新

與服務器管理員確認後,這個錯誤是由於CentOS的加載軟件比新的Haswell的CPU在服務器老。安裝binutils軟件包的最新版本也可以解決問題。

+3

AVX引入'VBROADCASTSS YMM,[M32]',但AVX2引入'VBROADCASTSS YMM,xmm'廣播源向量的低元件。大概用'-march = haswell',(avx2),代碼生成了一些asm,舊的binutils無法組裝。 (由於vbroadcast的這個怪癖,你得到了「無效的操作數」而不是「無法識別的指令」。) –