Ubuntu – How to build g++ 4.5.2 on Ubuntu 10.04

gccUbuntu

My gcc compiler is a bit outdated – gcc 4.3, so I want to build a new gcc from source since I ran apt-get update, but there were no pre-built version available yet.
Has anyone experienced this process before?

Thanks,
Chan

Best Answer

Install new version of GMP, MPFR, MPC from sources:

curl -O http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.gz
tar zxf gmp-5.0.1.tar.gz
cd gmp-5.0.1/
./configure --prefix=/usr
sudo make install
cd ..

curl -O http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.gz
tar zxf mpfr-3.0.0.tar.gz
cd mpfr-3.0.0/
./configure --prefix=/usr
sudo make install
cd ..

curl -O http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz
tar zxf mpc-0.8.2.tar.gz 
cd mpc-0.8.2/
./configure --prefix=/usr
sudo make install
Related Question