3

Trying to build OpenCV 3.3.1 with CUDA support, using ccache:

  • Ubuntu 16.04 LTS
  • OpenCV 3.3.1
  • CUDA 8.0
  • CCACHE 3.2.4

pic

Make fails for .cu files, giving error:

/usr/bin/ccache: invalid option -- 'E'

Usage:

ccache [options] ...

I've added the /usr/lib/ccache to PATH, which cc and which c++ outputs /usr/lib/ccache/cc and /usr/lib/ccache/c++ respectively. Manually added a symlink for nvcc in /usr/lib/ccache directory, but now OpenCV CMakeLists.txt cannot find CUDA.

pic

But interestingly I can build this sample CUDA code, with this CMake file without any issue.

I've searched the net and read most posts on SO and other forums, but had no success. I've had this issue for previous versions of OpenCV as well, but always disabled ccache as a solution.

Can someone please explain the reason behind this error?

Community
  • 1
  • 1
zindarod
  • 6,328
  • 3
  • 30
  • 58

1 Answers1

0

Trying to set -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda seems to solve this problem for me.

  • I'm seeing the same issue and already have set what you suggest. So this does not solve the issue. – crass Feb 01 '22 at 01:20