操作系统:ubuntu 16.04
CUDA:7.5
库德恩:5
我正在关注this https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-OpenCV-3.1-Installation-Guide使用 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.txtset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")
到它。另外,我检查了更改的建议/usr/include/string.h
假如here https://groups.google.com/forum/#!msg/caffe-users/Tm3OsZBwN9Q/XKGRKNdmBAAJ。但我已经有了该文件的更新版本。
我无法构建 opencv 3.1,因此也无法构建 Caffe。
尝试使用 CUDA 8。它对我在 Ubuntu 16.04 上使用 GeForce GTX 960M 有效
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)