[英]Error compiling Boost.Log
I am trying to compile the boost log library and I keep getting this error from the dump_avx2.cpp
file 我正在尝试编译Boost日志库,并且不断从
dump_avx2.cpp
文件中获取此错误。
error: always_inline function '_mm256_set1_epi32' requires target feature 'sse4.2', but would be inlined into function 'dump_data_avx2' that is compiled without support for 'sse4.2'
boost/boost/libs/log/src/dump_avx2.cpp:71:31: note: expanded from macro 'BOOST_LOG_AUX_MM_CONSTANTS'
const __m256i mm_char_0 = _mm256_set1_epi32(0x30303030);\
^
I get a lot of errors that are very similar to the one above, all of them have the same error message but different locations in the file where they occur, for reference I am on the commit hash 68701167a1020b0b4c47b76e31d3a3da9e2faf3f
for the Boost.Log submodule as fetched from the github repo ( https://github.com/boostorg/boost ) 我收到很多错误,这些错误与上面的错误非常相似,所有错误消息均相同,但是它们在文件中的位置不同,以供参考。我在Boost.Log子模块的提交哈希值
68701167a1020b0b4c47b76e31d3a3da9e2faf3f
来自github回购( https://github.com/boostorg/boost )
Does anyone know how I can go about resolving this issue? 有谁知道我该如何解决这个问题? I am building with a C++14 compiler and this is what I get when I type
g++ --version
我正在使用C ++ 14编译器进行构建,这是我输入
g++ --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Thanks! 谢谢!
Note I should clarify that in this context it is required that I compile this library separately. 注意,我应该澄清一下,在这种情况下,需要单独编译该库。
Note There seem to be two related source files dump_ssse3.cpp
and the mentioned dump_avx2.cpp
file, do I have to compile only one of them? 注意:似乎有两个相关的源文件
dump_ssse3.cpp
和提到的dump_avx2.cpp
文件,我是否只需要编译其中一个? I cannot make out what to do from the Jamfile in the build
folder :( 我无法从
build
文件夹的Jamfile中找出要做什么:(
That looks like a bug in clang (LLVM). 看起来像是clang(LLVM)中的错误。 First, the intrinsic belongs to AVX2, not SSE4.2.
首先,内在函数属于AVX2,而不是SSE4.2。 Second, the whole
dump_avx2.cpp
file is compiled with -mavx2, so the required extensions are enabled. 其次,使用
dump_avx2.cpp
编译整个dump_avx2.cpp
文件,因此启用了所需的扩展名。 You can see the compiler switches in the error message from b2. 您可以在b2的错误消息中看到编译器开关。 And no, both
dump_ssse3.cpp
and dump_avx2.cpp
should be compiled. 不,
dump_ssse3.cpp
和dump_avx2.cpp
都应该编译。 The library does runtime detection of the available instructions in the CPU and selects the proper implementation. 该库对CPU中的可用指令进行运行时检测,然后选择适当的实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.