Can someone walk me through getting the latest version of gcc on Ubuntu 15.04? I have tried finding testchains but those only go up to 5.1, I believe. Is this something I need wily for?
2 Answers
Install a helpful tool
checkinstall
sudo apt-get install checkinstall
Download the source package here, e.g.
cd wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2
Extract the archive
tar xf gcc-5.2.0.tar.bz2
Install some development packages
sudo apt-get install libgmp-dev sudo apt-get install libmpfr-dev sudo apt-get install libmpc-dev
Go into the source folder
cd gcc-5.2.0
Configure, in my example a 64-bit-only compiler (
--disable-multilib
), for 32-bit and 64-bit support use--enable-multilib
./configure --disable-multilib
Start the compiler and drink a coffee or two ;) This step takes some time.
make
Install
sudo checkinstall
You could also use
sudo make install
, but withcheckinstall
you will have an installed deb package.
-
When running these script, with
--enable-multilib
I got `/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory compilation terminated.' I think one needs to install something like libx32gcc-4.8-dev but for GCC 5.2. I was wondering whether you had any info on this (the ones I find are for older versions of GCC so I don't know if they are still current or if the package names have changed). Thanks in advance.– user2413Oct 11, 2015 at 15:50 -
@user2413 The packages of missing files can always found here packages.ubuntu.com/… I would say, its
libc6-dev
– A.B.Oct 11, 2015 at 16:18
Download the script on this page.
Extract the script from the ZIP package and make it executable by entering chmod +x howto-gcc-5.2-ubuntu15.04.sh
into the terminal.
Run it with sudo ./howto-gcc-5.2-ubuntu15.04
.
And you will now have GCC 5.2 installed on your system.