https://blog.csdn.net/u013270341/article/details/79647237
编译包含CUDA的OpenCV 时遇到问题
[ 1%] Built target proto
[ 1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_split_layer.cu.o
/usr/bin/ccache: invalid option -- 'E'
Usage:
ccache [options]
ccache compiler [compiler options]
compiler [compiler options] (via symbolic link)
Options:
-c, --cleanup delete old files and recalculate size counters
(normally not needed as this is done automatically)
-C, --clear clear the cache completely
-F, --max-files=N set maximum number of files in cache to N (use 0 for
no limit)
-M, --max-size=SIZE set maximum size of cache to SIZE (use 0 for no
limit; available suffixes: G, M and K; default
suffix: G)
-s, --show-stats show statistics summary
-z, --zero-stats zero statistics counters
-h, --help print this help text
-V, --version print version and copyright information
See also <http://ccache.samba.org>.
CMake Error at cuda_compile_generated_split_layer.cu.o.cmake:206 (message):
Error generating
/home/gpuusr/lpq/caffe-332/build/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_split_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_split_layer.cu.o] Error 1
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2
解决方法:
主要是opencv编译调用了ccache中错误的变量’E’, 可以通过指定特定的系统编译器来编译
cmake -DCUDA_HOST_COMPILER=/usr/bin/g++ ..
有的人还说要提高Cmake的版本,这个方法无法解决的人可以尝试一下,大概的安装方法贴这了:
sudo apt-get remove cmake
chmod +x ./cmake-***.sh
sudo ./cmake-***.sh
sudo ln -sf /opt/cmake-***/bin/* /usr/local/bin