User Tools

Site Tools


gcc4.7_on_debsqueeze

GCC 4.7 on Debian6/Squeeze

Debian6 still only ships GCC 4.4, so no joy playing with C11 & C++11 yet. Wheezy does have 4.7 GCC packages but it's generally not a good idea (nor for the faint of heart) to mix and match apt-get packages between major Debian releases (at least I chicken out on that).

Next option is to build and install GCC from source:

Prereq

If this is a minimal or new/clean install, make sure you have enough dev tools on-board:

sudo apt-get install build-essential manpages-dev autoconf2.64 automake1.9 autogen m4 git git-doc zip unzip

Getting source packages

wget http://bugseng.com/products/ppl/download/ftp/releases/1.0/ppl-1.0.tar.bz2
wget http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.17.0.tar.gz
wget http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
wget ftp://ftp.gmplib.org/pub/gmp-5.0.5/gmp-5.0.5.tar.bz2
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.1.tar.bz2
wget http://www.netgull.com/gcc/releases/gcc-4.7.2/gcc-4.7.2.tar.bz2

see also GCC prerequisites.

Unpack packages
for file in *.tar.gz; do tar xzvf $file; done
for file in *.tar.bz2; do tar xjvf $file; done

You should now find the 6 source directories, ready to build.

Building libraries

And now: the compiler

Create a .deb package

Don't install into /usr or /usr/local; instead create a .deb package and install via package managment

HowTo Build a Package from Source the Smart Way

References

gcc4.7_on_debsqueeze.txt · Last modified: 2014/11/01 14:13 (external edit)