操作系统:Ubuntu 16.04 CUDA版本:7.5 Cudnn版本:5
我正在按照此教程安装带GPU的Caffe。
在这里,我想要安装OpenCV 3.1。但是,在系统中已经安装了CUDA时,编译OpenCV会出现错误。
尝试使用make
编译OpenCV 3.1时,我遇到的错误是:
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:266 (message):
Error generating file
/home/cortana/Downloads/opencv-3.1.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:1505: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
我尝试通过添加以下代码到opencv 3.1的CMakeLists.txt文件中:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")
。此外,我查看了更改/usr/include/string.h
的建议,这里提供了链接。但是,我已经拥有该文件的更新版本。
我无法构建opencv 3.1和Caffe。