#error“SSE2指令集未被使能”当包括< emmintrin.h> [英] #error "SSE2 instruction set not enabled" when including <emmintrin.h>
问题描述
< emmintrin.h>
并得到以下make错误: #error未启用SSE2指令集
我有一个带有Linux(Mint)系统(Kernel 3.5)的Intel Celeron双核处理器。
根据维基百科,Celeron Dual Core能够执行SSE2指令,并且sse2标志根据 / proc / cpuinfo
。但是,此问题的作者提到了有限的SSE支持英特尔赛扬。
我已经尝试在 CMakeLists.txt
中使用SSE编译器选项:
set(CMAKE_C_FLAGS $ {CMAKE_C_FLAGS}-msse -msse2 -msse3)
..但没有改变。 cmake。
工作正常,但 make
给出上面的错误消息。
我必须更改CMakeLists.txt中的设置,或者Celeron Dual Core是否(完全)不支持SSE2?
您需要致电
set(CMAKE_C_FLAGS $ {CMAKE_C_FLAGS}-msse -msse2 -msse3 msse3)
CMAKE_C_FLAGS
应用于C文件,从你的帖子的C ++标签,我想你正在编译C ++文件,因此需要改变 CMAKE_CXX_FLAGS
。
关于引号的定位;在您的原始版本中,您设置 CMAKE_C_FLAGS
以包含2个单独的条目,第一个是 CMAKE_C_FLAGS
第二个是字符串 - msse -msse2 -msse3
。
冒号分隔的条目。在 CMAKE_< lang> _FLAGS
的情况下,它们总是由包含所有必需标志的字符串组成的单个值。
I´m trying to compile some C++ code with cmake and make that uses the include <emmintrin.h>
and get the following make error:
#error "SSE2 instruction set not enabled"
I have an Intel Celeron Dual Core processor with a Linux (Mint) system (Kernel 3.5).
According to Wikipedia the Celeron Dual Core is capable to execute SSE2 instructions and the sse2 flag is set according to /proc/cpuinfo
. But the author of this question mentions a limited SSE support of the Intel Celeron.
I've already tried to use the SSE compiler options in my CMakeLists.txt
:
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
..but nothing changed. cmake .
works fine but make
gives the error message above.
Do I have to change the settings in CMakeLists.txt or does the Celeron Dual Core simply not (fully) support SSE2?
You need to call
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3")
The CMAKE_C_FLAGS
are applied to C files, and from your post's C++ tag, I guess you're compiling C++ files, hence the need to change CMAKE_CXX_FLAGS
instead.
As for the positioning of the quotation marks; in your original version, you were setting CMAKE_C_FLAGS
to contain 2 separate entries, the first being the starting value of CMAKE_C_FLAGS
and the second being the string "-msse -msse2 -msse3"
.
CMake holds lists like this as semi-colon separated entries. In the case of CMAKE_<lang>_FLAGS
, invariably they are a single value comprised of a string containing all the required flags.
这篇关于#error“SSE2指令集未被使能”当包括< emmintrin.h>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!