How to install multiple version of GCC (GCC-3.3) on Ubuntu 16?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with
sudo apt-get install gcc-3.3
it's not installing.
~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
When I tried to list all the available versions of gcc,
sudo apt-cache search gcc
it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?
My current gcc version is:
~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 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.
ubuntu software-installation gcc
add a comment |Â
up vote
1
down vote
favorite
I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with
sudo apt-get install gcc-3.3
it's not installing.
~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
When I tried to list all the available versions of gcc,
sudo apt-cache search gcc
it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?
My current gcc version is:
~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 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.
ubuntu software-installation gcc
gcc3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
â Faheem Mitha
Jun 29 '17 at 10:17
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with
sudo apt-get install gcc-3.3
it's not installing.
~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
When I tried to list all the available versions of gcc,
sudo apt-cache search gcc
it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?
My current gcc version is:
~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 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.
ubuntu software-installation gcc
I am not familiar with Ubuntu and I want to install old version (3.3) of gcc to compile some code. When I tried with
sudo apt-get install gcc-3.3
it's not installing.
~$ sudo apt-get install gcc-3.3
sudo: /etc/sudoers.d is world writable
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-3.3-hppa64' for regex 'gcc-3.3'
The following packages were automatically installed and are no longer required:
gfortran-5 libamd2.4.1 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1
libcholmod3.0.6 libcsparse3.1.4 libcxsparse3.1.4 libgfortran-5-dev
libklu1.3.3 libldl2.2.1 libspqr2.0.2 libumfpack5.7.1 openjdk-9-jdk-headless
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
When I tried to list all the available versions of gcc,
sudo apt-cache search gcc
it's not listing gcc 3.3. How do I install gcc 3.3 on my Ubuntu?
My current gcc version is:
~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 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.
ubuntu software-installation gcc
ubuntu software-installation gcc
edited Jun 29 '17 at 10:54
GAD3R
22.9k164895
22.9k164895
asked Jun 29 '17 at 8:54
Kaushali de silva
62
62
gcc3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
â Faheem Mitha
Jun 29 '17 at 10:17
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44
add a comment |Â
gcc3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?
â Faheem Mitha
Jun 29 '17 at 10:17
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44
gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?â Faheem Mitha
Jun 29 '17 at 10:17
gcc 3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?â Faheem Mitha
Jun 29 '17 at 10:17
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
0
down vote
You can download the debian package from here
http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb
and install with
sudo dpkg -i /path/to/package
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the.debfile. Use the path to the.debpackage. Don't extract it.
â newage_newton
Jun 29 '17 at 9:45
add a comment |Â
up vote
0
down vote
It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.
If you need further elaboration, please comment.
add a comment |Â
up vote
0
down vote
I've added Debian repository to /etc/apt/source.
deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
Then I searched gcc by using
sudo apt-cache search gcc
Then it listed gcc-3.3
then I installed
sudo apt-get install gcc-3.3 g++-3.3
Then I've changed the symbolic link of gcc to select gcc 3.3
Are you able to switch betweengcc-3andgcc-5?
â GAD3R
Jun 30 '17 at 12:37
add a comment |Â
up vote
0
down vote
download, compile, and install GCC from source
i typically get the tar.gz one;
you can get the source from one of the mirror sites listed from gcc.gnu.org
https://gcc.gnu.org/mirrors.html
tar -xf gcc-3.3.6.tar.gz
./configure --prefix=/usr/local/gcc-3.3.6
make
make install
adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin
you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.
when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this
*for bash*
export PATH=/usr/local/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
*for csh or tcsh*
setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
either open a new terminal window or first type rehash
then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.
whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.
during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help
- this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using
--prefix= - adjust
LD_LIBRARY_PATH, andPATH, accordingly to use whichever
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can download the debian package from here
http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb
and install with
sudo dpkg -i /path/to/package
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the.debfile. Use the path to the.debpackage. Don't extract it.
â newage_newton
Jun 29 '17 at 9:45
add a comment |Â
up vote
0
down vote
You can download the debian package from here
http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb
and install with
sudo dpkg -i /path/to/package
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the.debfile. Use the path to the.debpackage. Don't extract it.
â newage_newton
Jun 29 '17 at 9:45
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can download the debian package from here
http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb
and install with
sudo dpkg -i /path/to/package
You can download the debian package from here
http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb
and install with
sudo dpkg -i /path/to/package
answered Jun 29 '17 at 9:16
newage_newton
11
11
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the.debfile. Use the path to the.debpackage. Don't extract it.
â newage_newton
Jun 29 '17 at 9:45
add a comment |Â
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the.debfile. Use the path to the.debpackage. Don't extract it.
â newage_newton
Jun 29 '17 at 9:45
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
There are two folders when I downloaded package from this link, DEBIAN and usr. Which path should I give?
â Kaushali de silva
Jun 29 '17 at 9:34
This link will download the
.deb file. Use the path to the .deb package. Don't extract it.â newage_newton
Jun 29 '17 at 9:45
This link will download the
.deb file. Use the path to the .deb package. Don't extract it.â newage_newton
Jun 29 '17 at 9:45
add a comment |Â
up vote
0
down vote
It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.
If you need further elaboration, please comment.
add a comment |Â
up vote
0
down vote
It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.
If you need further elaboration, please comment.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.
If you need further elaboration, please comment.
It seems that Launchpad has recent builds of gcc 3.3 available. I don't know if this is recent enough to work, but I suppose it's worth a try.
If you need further elaboration, please comment.
answered Jun 29 '17 at 10:25
Faheem Mitha
22.2k1677134
22.2k1677134
add a comment |Â
add a comment |Â
up vote
0
down vote
I've added Debian repository to /etc/apt/source.
deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
Then I searched gcc by using
sudo apt-cache search gcc
Then it listed gcc-3.3
then I installed
sudo apt-get install gcc-3.3 g++-3.3
Then I've changed the symbolic link of gcc to select gcc 3.3
Are you able to switch betweengcc-3andgcc-5?
â GAD3R
Jun 30 '17 at 12:37
add a comment |Â
up vote
0
down vote
I've added Debian repository to /etc/apt/source.
deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
Then I searched gcc by using
sudo apt-cache search gcc
Then it listed gcc-3.3
then I installed
sudo apt-get install gcc-3.3 g++-3.3
Then I've changed the symbolic link of gcc to select gcc 3.3
Are you able to switch betweengcc-3andgcc-5?
â GAD3R
Jun 30 '17 at 12:37
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I've added Debian repository to /etc/apt/source.
deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
Then I searched gcc by using
sudo apt-cache search gcc
Then it listed gcc-3.3
then I installed
sudo apt-get install gcc-3.3 g++-3.3
Then I've changed the symbolic link of gcc to select gcc 3.3
I've added Debian repository to /etc/apt/source.
deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
Then I searched gcc by using
sudo apt-cache search gcc
Then it listed gcc-3.3
then I installed
sudo apt-get install gcc-3.3 g++-3.3
Then I've changed the symbolic link of gcc to select gcc 3.3
answered Jun 30 '17 at 3:54
Kaushali de silva
62
62
Are you able to switch betweengcc-3andgcc-5?
â GAD3R
Jun 30 '17 at 12:37
add a comment |Â
Are you able to switch betweengcc-3andgcc-5?
â GAD3R
Jun 30 '17 at 12:37
Are you able to switch between
gcc-3 and gcc-5?â GAD3R
Jun 30 '17 at 12:37
Are you able to switch between
gcc-3 and gcc-5?â GAD3R
Jun 30 '17 at 12:37
add a comment |Â
up vote
0
down vote
download, compile, and install GCC from source
i typically get the tar.gz one;
you can get the source from one of the mirror sites listed from gcc.gnu.org
https://gcc.gnu.org/mirrors.html
tar -xf gcc-3.3.6.tar.gz
./configure --prefix=/usr/local/gcc-3.3.6
make
make install
adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin
you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.
when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this
*for bash*
export PATH=/usr/local/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
*for csh or tcsh*
setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
either open a new terminal window or first type rehash
then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.
whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.
during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help
- this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using
--prefix= - adjust
LD_LIBRARY_PATH, andPATH, accordingly to use whichever
add a comment |Â
up vote
0
down vote
download, compile, and install GCC from source
i typically get the tar.gz one;
you can get the source from one of the mirror sites listed from gcc.gnu.org
https://gcc.gnu.org/mirrors.html
tar -xf gcc-3.3.6.tar.gz
./configure --prefix=/usr/local/gcc-3.3.6
make
make install
adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin
you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.
when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this
*for bash*
export PATH=/usr/local/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
*for csh or tcsh*
setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
either open a new terminal window or first type rehash
then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.
whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.
during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help
- this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using
--prefix= - adjust
LD_LIBRARY_PATH, andPATH, accordingly to use whichever
add a comment |Â
up vote
0
down vote
up vote
0
down vote
download, compile, and install GCC from source
i typically get the tar.gz one;
you can get the source from one of the mirror sites listed from gcc.gnu.org
https://gcc.gnu.org/mirrors.html
tar -xf gcc-3.3.6.tar.gz
./configure --prefix=/usr/local/gcc-3.3.6
make
make install
adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin
you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.
when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this
*for bash*
export PATH=/usr/local/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
*for csh or tcsh*
setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
either open a new terminal window or first type rehash
then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.
whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.
during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help
- this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using
--prefix= - adjust
LD_LIBRARY_PATH, andPATH, accordingly to use whichever
download, compile, and install GCC from source
i typically get the tar.gz one;
you can get the source from one of the mirror sites listed from gcc.gnu.org
https://gcc.gnu.org/mirrors.html
tar -xf gcc-3.3.6.tar.gz
./configure --prefix=/usr/local/gcc-3.3.6
make
make install
adjust "--prefix=/usr/local/gcc-3.3.6" accordingly; i prefer to be explicit it makes things easier knowing where everything is. I think if not specified it will default to /usr/local/bin
you can do a ./configure --help to get a description of all the options available; prefix= is simply where it will get installed when doing make install and will also tell of the default install location if "prefix=" is not specified.
when using --prefix= you then need to supersede this local installation of whatever you did in your PATH and LD_LIBRARY_PATH environment variables like this
*for bash*
export PATH=/usr/local/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
*for csh or tcsh*
setenv PATH /usr/local/gcc-3.3.6/bin:$PATH
setenv LD_LIBRARY_PATH /usr/local/gcc-3.3.6/lib:$LD_LIBRARY_PATH
either open a new terminal window or first type rehash
then a which gcc will let you know the version of gcc you would be using without manually and explictly having to do /usr/local/gcc-3.3.6/bin/gcc to use it.
whenever running executables later on that have been compiled with a newer/older version of GCC make sure your LD_LIBRARY_PATH is correctly set to that corresponding GCC version.
during the ./configure step that will let you know if you are missing prerequisites so don't be alarmed if this step isn't 100% successful on first try, you will either need to download and install them or disable them by looking it up from the output of ./configure --help
- this way you can have multiple gcc versions to your heart's content, keep each gcc install separate using
--prefix= - adjust
LD_LIBRARY_PATH, andPATH, accordingly to use whichever
edited Aug 28 at 16:38
answered Aug 28 at 15:36
ron
8131614
8131614
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f374118%2fhow-to-install-multiple-version-of-gcc-gcc-3-3-on-ubuntu-16%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
gcc3.3 is ancient. You will probably need to rebuild it from scratch on your system, assuming that's even possible. A binary might install, though probably won't. Are you sure a more recent version of gcc won't work for you?â Faheem Mitha
Jun 29 '17 at 10:17
I got debian repository and added it to /etc/apt/sources.list. It works for me
â Kaushali de silva
Jun 30 '17 at 3:44