I'm running on a Ubuntu 16.04 where I installed gcc4.9 and NVIDA drivers from official repositories, configured alternatives for gcc, and installed the CUDA toolkit 7.5.18.
When I try to compile a CUDA code, I get a lot of messages like this
/usr/lib/gcc/x86_64-linux-gnu/5/include/avx2intrin.h(247): error: ...
How can I force the system to use gcc-4.9 headers and not gcc-5?
I use cmake and make to compile the source code.