installing gcc-4.3 in ubuntu 10.10

Asked by Manas Ranjan Biswal

Hello

Please suggest me to install gcc-4.3 in ubuntu 10.10
though ubuntu 10.10 comes with gcc-4.5 .
if down grade possible then what is the way. otherwise I have downloaded
gcc-4.3 in tar format. Can anyone suggest how to install it on ubuntu.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gcc-4.3 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You could find a deb with the older version but I suggest you do NOT do this as it may break things. If you want to use your tarball, you can compile the 4.3 version if you wish. I recommend you make a deb of the result so you can integrate it into Ubuntu's package system in the normal way.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#2

Executive summary: Install the package called gcc-4.3, and then invoke it with the command "gcc-4.3" instead of the command "gcc".

Detailed answer:

You do not need to manually install a .deb file to do this (and as actionparsnip says, this is not a particularly good idea). gcc-4.3 has been packaged separately for Ubuntu 10.10, and is available through the normal repositories. Just install the package called gcc-4.3. Then you will have both "gcc" (which provides GCC 4.5) and "gcc-4.3" (which provides GCC 4.3). You will have to invoke it with the name "gcc-4.3" as "gcc" will still run gcc 4.5.

To illustrate this behavior, this is from my Ubuntu 10.10 system, which has both installed:

ek@Apok:~$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ek@Apok:~$ gcc-4.3 --version
gcc-4.3 (Ubuntu 4.3.5-3ubuntu1) 4.3.5
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you need to use gcc-4.3 to build a program or library from source, and you would ordinarily run

./configure

as the first build step, then you will instead run

./configure CC=gcc-4.3

which will make it invoke the gcc-4.3 binary instead of the gcc binary when it calls the C compiler.

This is by far the best way for GCC 4.5 and GCC 4.3 to coexist on the same Ubuntu 10.10 system. There is rarely any advantage to building GCC 4.3 manually, plus, when you build GCC 4.3 from source, uninstallation is not supported! (Though you can specify --prefix=/usr/local/src/gcc-4.3 -- after creating that directory -- and then just clobber the whole directory to get rid of gcc-4.3. If you install it that way, there are several other issues you have to deal with to make it work.)

Can you help with this problem?

Provide an answer of your own, or ask Manas Ranjan Biswal for more information if necessary.

To post a message you must log in.