环境
Ubuntu 14.04 + Cmake3.2.2
今天用Cmake编译MxNet,报错/usr/bin/ccache: invalid option -- 'E'
,全部日志如下:
[ 0%] Building NVCC (Device) object CMakeFiles/cuda_compile.dir/src/operator/cuda_compile_generated_pad.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 countrs
(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_pad.cu.o.cmake:206 (message):
Error generating
/home/research/mxnet/build/CMakeFiles/cuda_compile.dir/src/operator/./cuda_compile_generated_pad.cu.o
make[2]: *** [CMakeFiles/cuda_compile.dir/src/operator/cuda_compile_generated_pad.cu.o] Error 1
make[1]: *** [CMakeFiles/mxnet_static.dir/all] Error 2
make: *** [all] Error 2
解决
解决该问题需要尝试建立与 CUDA OpenCV 支持。CMake,CUDA 与 ccache 不明白一些奇怪的相互作用,它试图调用 ccache 包含无效的参数。我们可以通过指定您的系统编译器采用 cuda 技术而绕过这个问题︰
cmake -DCUDA_HOST_COMPILER=/usr/bin/g++ ..
或者也可以指定自己安装的其他编译器。