在ubuntu 16.04中安装Caffe时遇到困难

时间:2016-09-07 08:25:01

标签: c++ opencv ubuntu caffe

操作系统:ubuntu 16.04 CUDA:7.5 Cudnn:5

我正在关注使用gpu安装caffe的this教程。 在这里,我想要安装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

我尝试通过向其添加行set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")来更改opencv 3.1的CMakeLists.txt。另外,我查看了更改/usr/include/string.h提供的here的建议。但我已经有了该文件的更新版本。 我无法构建opencv 3.1,因此,Caffe。

1 个答案:

答案 0 :(得分:0)

尝试使用CUDA 8.在Ubuntu 16.04上使用GeForce GTX 960M对我有用