Easy gcc compile using download_prerequisites in contrib and compiling gcc on CentOS 6 x86_64

For the longest time, I never noticed that there was a contrib directory in gcc’s source archive. Not only that, but the download_prerequisites script does an amazingly simple job that saves me minutes off a single gcc compile.

What does it do? download_prerequisites actually downloads the exact version of gmp, mpc, and mpfr that gcc needs to build. The extra boot is that it sets up the symbolic links and so when you do the configure and make for gcc, it will very much build the dependicies without fail almost every time. Here’s an example CentOS 6 x86_64 that I’ve done the other day

tar -jxvpf gcc-4.7.1.tar.bz2
cd gcc-4.7.1
mkdir objdir
cd contrib
cd ../objdir
./configure --build=x86_64-pc-linux-gnu  --prefix=/home/ryan/software/gcc/4.7.1 --disable-multilib
make install
This entry was posted in software and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *