I want to install GCC and G++ 6.3 version. As MATLAB only support this compiler. On launchpad it is not available.
I could not find any link which could describe way to install. I could install 6.5 from PPA. Can someone explain how to install from source ?
GCC 6.3 is available in Jonathon F's Launchpad repository:
https://launchpad.net/~jonathonf/+archive/ubuntu/gcc-6.3
This PPA could be used for installing GCC 6.3 from package, rather than from source, which should usually be the last resort (do note, it is not an official Ubuntu PPA).
For installing GCC 6.3 on Ubuntu 16.04, follow this procedure:
Remove any previous gcc-6 version installed:
sudo apt-get remove --purge gcc-6 g++-6 gcc-6-multilib
sudo apt autoremove
Add the gcc-6.3 PPA:
sudo add-apt-repository ppa:jonathonf/gcc-6.3
sudo apt-get update
Install the specific gcc-6.3 version,
6.3.0-21ubuntu1~16.04.york0
in our case:VER=6.3.0-21ubuntu1~16.04.york0 && sudo apt-get install gcc-6-base=$VER gcc-6=$VER g++-6=$VER cpp-6=$VER libgcc-6-dev=$VER libstdc++-6-dev=$VER libasan3=$VER
Check the version of the just installed gcc with
gcc-6 -v
. Expected:gcc version 6.3.0 20170628 (Ubuntu 6.3.0-21ubuntu1~16.04.york0)
I see that the repository is no longer available! For me making a copy of "gcc-7"/"g++-7" with the name "gcc"/"g++" at the source folder solved the problem!