1

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?

1

2 Answers 2

4
  1. Install a helpful tool checkinstall

    sudo apt-get install checkinstall
    
  2. 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
    
  3. Extract the archive

    tar xf gcc-5.2.0.tar.bz2
    
  4. Install some development packages

    sudo apt-get install libgmp-dev 
    sudo apt-get install libmpfr-dev
    sudo apt-get install libmpc-dev
    
  5. Go into the source folder

    cd gcc-5.2.0
    
  6. Configure, in my example a 64-bit-only compiler (--disable-multilib), for 32-bit and 64-bit support use --enable-multilib

    ./configure --disable-multilib
    
  7. Start the compiler and drink a coffee or two ;) This step takes some time.

    make
    
  8. Install

    sudo checkinstall
    

    You could also use sudo make install, but with checkinstall you will have an installed deb package.

2
  • 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.
    – user2413
    Oct 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
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .