I'm trying to run a cuda program in Clion. Whenever I load the CmakeList.txt, I get the following error in the terminal:
Failed to find nvcc. Compiler requires the CUDA toolkit. Please set the CUDAToolkit_ROOT variable.
I installed Cuda as described by system76's instructions and I can run nvcc in the terminal fine. Executing `which nvcc` in the terminal reveals the path of nvcc to be /usr/lib/cuda/bin/nvcc .
I set an enviroment variable called CUDAToolkit_ROOT to /usr/lib/cuda and /usr/lib/cuda-11.2 and then I get the the error for both environment variable configs: Could not find nvcc executable in path specified by environment variable CUDAToolkit_ROOT=/usr/lib/cuda
Any ideas on what I'm doing wrong?