gcc compile dpdk error: no such instruction vextracti128

gcc compile dpdk error: no such instruction vextracti128

在Centos 6.2中,我使用gcc 4.8.0编译DPDK代码(dpdk-stable-17.05.2),遇到编译错误。 编译命令: make install T=x86_64-native-linuxapp-gcc

输出:

== Build lib/librte_eal/linuxapp/eal    
  CC eal.o    
  CC eal_hugepage_info.o    
  CC eal_memory.o   
/tmp/ccZMmoL5.s: Assembler messages:    
/tmp/ccZMmoL5.s:1189: Error: no such instruction: `vextracti128 [=10=]x1,%ymm0,internal_config+192(%rip)'   
/tmp/ccZMmoL5.s:1192: Error: no such instruction: `vextracti128 [=10=]x1,%ymm0,internal_config+248(%rip)'    
/tmp/ccZMmoL5.s:1196: Error: no such instruction: `vextracti128 [=10=]x1,%ymm0,internal_config+304(%rip)'  

也尝试了gcc 4.9.0和dpdk-17.11,同样的编译错误。 有没有人遇到同样的错误,或者有解决办法?

添加了带有详细输出的编译命令:
使T=x86_64-native-linuxapp-gccV=1

输出:

== Build lib/librte_eal/linuxapp/eal
gcc -Wp,-MD,./.eal_memory.o.d.tmp  -m64 -pthread  -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_AVX2  -I/root/dpdk/dpdk-stable-17.05.2/build/include -include /root/dpdk/dpdk-stable-17.05.2/build/include/rte_config.h -I/root/dpdk/dpdk-stable-17.05.2/lib/librte_eal/linuxapp/eal/include -I/root/dpdk/dpdk-stable-17.05.2/lib/librte_eal/common -I/root/dpdk/dpdk-stable-17.05.2/lib/librte_eal/common/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -O3    -o eal_memory.o -c /root/dpdk/dpdk-stable-17.05.2/lib/librte_eal/linuxapp/eal/eal_memory.c 
/tmp/ccUFBnoh.s: Assembler messages:
/tmp/ccUFBnoh.s:1188: Error: no such instruction: `vextracti128 [=11=]x1,%ymm0,internal_config+192(%rip)'
/tmp/ccUFBnoh.s:1191: Error: no such instruction: `vextracti128 [=11=]x1,%ymm0,internal_config+248(%rip)'
/tmp/ccUFBnoh.s:1195: Error: no such instruction: `vextracti128 [=11=]x1,%ymm0,internal_config+304(%rip)'
make[5]: *** [eal_memory.o] Error 1

这是一个 gcc 4.8.0 错误(参见 https://github.com/nouiz/Theano/commit/04cb385df37c669b2f449d34d34d9835085cbce9),用于在另一个软件中发现的类似问题。

您可以通过几种不同的方式解决这个问题。

1) 使用 gcc -mno-avx2 强制使用 no-avx2。 vextracti128 是 avx2 功能,因此编译器不会使用此优化。

2) 将你的 gcc 升级到 4.8.5