How to install gcc 6.3 on 17.10 64bit Desktop and replace original gcc with a link?( for cuda 9.1 of nvidia)

sudo apt-get install gcc-6 g++-6
export HOST_COMPILER=gcc-6

This allows you to keep gcc-7 but you can still build cuda and tensorflow with gcc-6.

  • This is how I got everything compiled when using cuda version 9.1 and libcudnn version 7.1.2 and recent tensorflow master branch. Apr 2 '18 at 19:52
sudo apt-get remove gcc g++
gcc –version

sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-snapshot -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
  • That doesnt install gcc 6.3.0, it install the latest gcc in the repository
    – gumlym
    Mar 15 '18 at 11:57
  • The first command indeed tries to gcc, but it also removes cuda and nvidia-390 (or whatever is your driver) because they depend on it, which is against the original goal. Apr 2 '18 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.