I was having difficulty running install.packages("forecast")
after a new install of CUDA 9.1 on Ubuntu 17.10, with the error
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
I fixed this problem by first following instructions here running from command line
sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
I then got the error
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
This is due to GCC 6 not having a G++ to go with it. Simply install G++6 with:
sudo apt-get install g++-6