I'm compiling a CUDA program - a simple and innocuous one. Regardless of how far I simplify it or remove some of the code or the include files, nvcc tells me:
In file included from /usr/local/cuda/bin/..//include/crt/common_functions.h:271:0,
from /usr/local/cuda/bin/..//include/common_functions.h:50,
from /usr/local/cuda/bin/..//include/cuda_runtime.h:115,
from <command-line>:0:
/usr/local/cuda/bin/..//include/crt/math_functions.h:8891:5: error: "_GLIBCXX_MATH_H" is not defined [-Werror=undef]
I'm using CUDA 9.0 or 9.1 on Linux, and CUDA is using GCC (either 5 or 6). Why is this happening and how can I fix it?