c – SSE指令集未使能

前端之家收集整理的这篇文章主要介绍了c – SSE指令集未使能前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我遇到这个错误的麻烦:“SSE指令集未启用”.我怎么能弄清楚呢?

我有ACER i7,Ubuntu 11.10,请任何人可以帮我吗?

任何帮助将不胜感激!

还运行:

sudo cat /proc/cpuinfo | grep flags

得到:

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clfl
ush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfm
on pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl
vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm 
ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid

其实我是试图安装gazebo-1.0.0-RC2-x86_64,并得到这个错误.

/usr/lib/gcc/i686-linux-gnu/4.6.1/include/emmintrin.h:32:3: error: #error "SSE2 
instruction set not enabled"
In file included from /home/bkhelifa/Downloads/software/gazebo-1.0.0-RC2-x86_64/
deps/opende/src/quickstep.cpp:39:0:
/usr/lib/gcc/i686-linux-gnu/4.6.1/include/xmmintrin.h:32:3: error: #error "SSE i
nstruction set not enabled"
/home/bkhelifa/Downloads/software/gazebo-1.0.0-RC2-x86_64/deps/opende/src/quicks
tep.cpp: In function ‘dReal dot6(dRealPtr,dRealPtr)’:
/home/bkhelifa/Downloads/software/gazebo-1.0.0-RC2-x86_64/deps/opende/src/quicks
tep.cpp:537:3: error: ‘__m128d’ was not declared in this scope
...

我的cmakefile中已经有这个选项

if (SSE3_FOUND)
  set (CMAKE_C_FLAGS_ALL "${CMAKE_C_FLAGS_ALL} -msse3")
endif()
if (SSSE3_FOUND)
  set (CMAKE_C_FLAGS_ALL "${CMAKE_C_FLAGS_ALL} -mssse3")
endif()
if (SSE4_1_FOUND)
  set (CMAKE_C_FLAGS_ALL "${CMAKE_C_FLAGS_ALL} -msse4.1")
endif()
if (SSE4_2_FOUND)
  set (CMAKE_C_FLAGS_ALL "${CMAKE_C_FLAGS_ALL} -msse4.2")
endif()

解决方法

您的头文件之一检查以确保启用SSE.看来你的if语句不起作用

如果添加-march = native,则应根据处理器选择最佳的cpu arch和flags进行编译,或者您可以明确使用-march = corei7 -mavx -mpclmul,这对于distcc很有用.另外,-mfpmath = sse / -mfpmath = 387会告诉编译器为浮点数学生成SSE / x87指令.根据您的处理器,可能会更快,但我认为英特尔处理器通常在上交所更好.

如果要检查gcc是否启用使用本机标志运行gcc -march = native -Q –help = target -v.

猜你在找的C&C++相关文章