{{tag>gcc guide compile}} {{howhard>4}}
====== GCC 5.4.0 ======
This guide assumes you are switched to su - . Please note that during the make step you may run into issues check the missing aclocal-1.15 section , this guide assumes you are using the eSG provided installation image.
===== Goal =====
Build GCC 5.4.0
===== Steps =====
==== Building Pre requisites ====
cd ~
mkdir buildgcc
cd ~/buildgcc
==== Library Prerequisites ====
yum groupinstall "Development tools"
yum install glibc-devel.i686 glibc.i686 texinfo
==== EXPORTS used to set versions ====
You can change the values here to change the compiled version.
MPC_VERSION=1.1.0
MPFR_VERSION=4.0.0
GMP_VERSION=6.1.2
ISL_VERSION=0.18
CLOOG_VERSION=0.18.1
GCC_VERSION=5.4.0
==== Fetch MPC ====
wget ftp://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
tar zxfv mpc-${MPC_VERSION}.tar.gz
==== Fetch MPFR ====
wget http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VERSION}.tar.bz2
tar jxfv mpfr-${MPFR_VERSION}.tar.bz2
==== Fetch GMP ====
wget https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.bz2
tar jxfv gmp-${GMP_VERSION}.tar.bz2
==== Fetch ISL ====
wget ftp://ftp.ntua.gr/pub/gnu/gcc/infrastructure/isl-${ISL_VERSION}.tar.bz2
tar jxfv isl-${ISL_VERSION}.tar.bz2
==== Fetch CLOOG ====
wget ftp://ftp.ntua.gr/pub/gnu/gcc/infrastructure/cloog-${CLOOG_VERSION}.tar.gz
tar zxfv cloog-${CLOOG_VERSION}.tar.gz
==== Fetch GCC ====
wget ftp://ftp.ntua.gr/pub/gnu/gcc/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2
tar jxfv gcc-${GCC_VERSION}.tar.bz2
==== Copy downloaded libraries in GCC directory ====
cd gcc-${GCC_VERSION}
cp -R ../mpc-${MPC_VERSION} mpc
cp -R ../mpfr-${MPFR_VERSION} mpfr
cp -R ../gmp-${GMP_VERSION} gmp
cp -R ../isl-${ISL_VERSION} isl
cp -R ../cloog-${CLOOG_VERSION} cloog
==== Hardcoded autoconf ====
Since autoconf is hardcoded you need to update to your own version
Find your version using:
rpm -qa | grep autoconf
example: autoconf-2.69-11.el7.noarch, thus you have version 2.69 .
Find the following line in config/override.m4
m4_ifndef([_GCC_AUTOCONF_VERSION],
[m4_define([_GCC_AUTOCONF_VERSION], [2.69])])
and change the version to your own
==== missing aclocal-1.15 ====
Since your version of aclocal may be different you should autoreconf using:
autoreconf -ivf
autoreconf -ivf mpfr/
autoreconf -ivf isl/
autoreconf -ivf cloog/
==== Configure GCC ====
./configure --prefix=/opt/gcc-${GCC_VERSION} --enable-multilib --with-system-zlib
==== Make GCC ====
Warning: This process will take quite a few hours, make sure the build is started in a multiplexer (eg tmux)
make
==== Install GCC ====
make install
This will install GCC in the path you set in configure with --prefix=