I'm running debian wheezy and wanted to upgrade from GCC 4.7.2 to GCC 4.9.0.
As per these instructions I installed libgmp-dev
, libmpfr-dev
and libmpc-dev
(my package manager gave me versions 2:5.0.5+dfsg-2, 3.1.0-5 and 0.9-4 respectively) and ran the following to compile gcc (note that in my case it was 4.9.0 instead of 4.6.2):
tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2
make
make install
I now have a objdir
directory full of stuff, but where is g++, and where should I put this directory?
I'm guessing I should move it to usr/local
and add something to my PATH
variable, but I don't know what exactly, and how to make sure it is searched before my old gcc install.
gcc-4.9.0
directory with the binaries showed up in your home directory?$PWD
but it works fine. Can I somehow make sure that when I typeg++
it points to my new install instead of the gcc that came with debian?export PATH=/<your home>/gcc-<your gcc version>/bin:$PATH
. Now you start a new shell and typegcc --version
. This should be the new one.libgmp-dev
,libmpfr-dev
andlibmpc-dev
packages or run thecontrib/download_prerequisites
script. I thought the GCC wiki page made that clear: "Alternatively, after extracting the GCC source archive, simply run the./contrib/download_prerequisites
script in the GCC source directory."