This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Installation problem
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: Marc-André Breton <marc dot andre dot breton at lagrit dot etsmtl dot ca>
- Cc: "GCC - Mailing List" <gcc-help at gcc dot gnu dot org>
- Date: 06 Mar 2003 21:38:41 -0800
- Subject: Re: Installation problem
- References: <200303031605.33093.marc.andre.breton@lagrit.etsmtl.ca>
Marc-André Breton <marc dot andre dot breton at lagrit dot etsmtl dot ca> writes:
> Hi all,
>
> I had an old version of gcc (gcc-2.96) and I tried to install the last release
> (gcc-3.2.2). I work on a Linux platform, so I did the following steps to
> install it:
> 1) download gcc-3.2.2.tar.gz from one of mirror sites
> 2) uncompressed this file in /home (Now I have /home/gcc-3.2.2)
> 3) cd /home/gcc-3.2.2
> 4) [root at lagrit12 gcc-3.2.2]# ./configure
First of all you should build gcc in a seperate directory from the
source dir:
3) mkdir /home/gcc-3.2.2.objdir
4) cd /home/gcc-3.2.2.objdir
5) [root at lagrit12 gcc-3.2.2.objdir]# ../gcc-3.2.2/configure --prefix=/usr/local/gcc-3.2.2
Second, the default prefix is /usr/local, but the only sure way to be
able to uninstall gcc is to put it in its own directory - I
usually use /usr/local/<gcc-version> . Furtheremore, it isn't safe
to install two versions of gcc with the same prefix. (Note: your
linux distro will typically use prefix=/usr for the compiler that
comes with the distro.)
Please read http://gcc.gnu.org/install/configure.html
for details.
6) [root at lagrit12 gcc-3.2.2.objdir]# make
7) [root at lagrit12 gcc-3.2.2.objdir]# make install
> 5) [root at lagrit12 gcc-3.2.2]# make
> 6) [root at lagrit12 gcc-3.2.2]# make install
>
> All seem work well but when I type in my console "gcc -v", I see that it's the
> old version who is working again.
> {Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
> gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96110)}
[snip]
Your new version of gcc will have its executables in <prefix>/bin . By
default, prefix is /usr/local . So "/usr/local/bin/gcc -v" should
fetch out 3.2.2 . If you wish this to be the default, put
/usr/local/bin at the front of your path.
Additionaly, you may need to add <prefix>/lib to your LD_LIBRARY_PATH,
or tell ldconfig to add <prefix>/lib to the list of dirs it stuffs
in the link cache, so that programs compiled with gcc 3.2.2 can
find their shared libs.