Ubuntu 16.04下使用GCC5,CUDA 7.5编译Caffe时候报告错误'error: identifier "__builtin_ia32_mwaitx" is undefined'

Ubuntu 16.04下使用GCC5,CUDA 7.5编译Caffe时候报告如下错误:

/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined

目前比较好的解决方法是在编译的时候增加_MWAITXINTRIN_H_INCLUDED宏。

如果使用cmake来编译代码,则只需要在CMakeLists.txt中增加如下语句即可

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_MWAITXINTRIN_H_INCLUDED")

参考链接


Trying to get CUDA 7.5 to work with GCC 5.x

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注