Ubuntu – GCC 5.2 on Ubuntu 15.04

gcc

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?

Best Answer

  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.

Related Question