LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   DOWNgrade gcc. How? (https://www.linuxquestions.org/questions/linux-software-2/downgrade-gcc-how-184552/)

KDel 05-22-2004 01:31 PM

DOWNgrade gcc. How?
 
I need to downgrade my gcc from 3.2(i think) to a 2.9xx version. Is 2.95-3 a good one?
How shall i do this?
I'm new to linux and i dont even know how to build gcc.
So some detailed instructions will be highly appreciated :)

drigz 05-22-2004 01:45 PM

why?

i would try just installing the new version over the old one, but when i had tried to upgrade gcc it didnt work.

to follow the standard install procedure, download the source to say /usr/src, then type:
Code:

cd /usr/src
tar -zxf gccsourcename.tar.gz
OR
tar -jxf gccsourcename.tar.bz2
cd gccsourcefoldername
./configure --prefix=/usr/local
make bootstrap
make install


KDel 05-22-2004 03:41 PM

thanx.
a more detailed answer someone?

Lleb_KCir 05-22-2004 03:53 PM

Quote:

Originally posted by drigz
why?

i would try just installing the new version over the old one, but when i had tried to upgrade gcc it didnt work.

to follow the standard install procedure, download the source to say /usr/src, then type:
Code:

cd /usr/src
tar -zxf gccsourcename.tar.gz
OR
tar -jxf gccsourcename.tar.bz2
cd gccsourcefoldername
./configure --prefix=/usr/local
make bootstrap
make install


drigz please provide some more deatil to this. i am tring to install gcc from source on a RH9 system. yes i can put in the CD, but id like to learn how to install from source as RH is no longer supporting RH9, and i dont want to move to Fedora.

what is the /usr/src dir? is that the user source? also please see this thread for what i have done, and were i am on the install of the gcc most recient source code install.

how do i know what to name the srcdir and where do i put the objdir, and could you explain a bit more in detail as to what those are, how best to name them, etc...

thank you for all the help. this should also help the original poster with his questions.

or please e-mail answere directions to xindal@yahoo.com

drigz 05-22-2004 04:09 PM

im sorry, thats all i know about it. i would have given more detail if i could.

Lleb_KCir 05-22-2004 04:12 PM

Quote:

Originally posted by drigz
im sorry, thats all i know about it. i would have given more detail if i could.
tis ok, if we could get one of the linux masters around here to point us in the right direction, that would be a godsend for me at least, and im guessing for the OP too.

KDel 05-22-2004 04:18 PM

hm ok,lets redifine my problem. I need to compile gcc 2.95. I have gcc 3.2 i think installed from the cd.
How do i compile the gcc? I've read some posts here and the instructions at the gcc site,but i dont understand anything!
If someone could give me some simple instructions or a site that has some,it would be really cool
thanx :)

Lleb_KCir 05-22-2004 04:21 PM

mind if i ask why you are dropping down to 2.95 from the 3.2 line? i have not installed yet, but if there are issues with the 3.2 line id like to know.

Andrew Benton 05-22-2004 04:30 PM

I would advise you not to put gcc-2.95 in /usr/local as /usr/local/bin is probably in your $PATH so you will have two versions of gcc in your $PATH, one in /usr/bin and one in /usr/local/bin. This may cause problems. I would suggest that you install it somewhere out of the way, such as /opt/gcc-2.95. That way there is less chance of confusion. When you need to use it you can temporarily set the variable
export CC=/opt/gcc-2.95/bin/gcc
Install gcc-2.95 in /opt by doing
Code:

tar xzf gcc-2.95.3.tar.gz &&
mkdir gcc-build &&
cd gcc-build &&
../gcc-2.95.3/configure --prefix=/opt/gcc-2.95 --enable-languages=c,c++ &&
make bootstrap &&
make install


KDel 05-22-2004 04:43 PM

yes the code is the similar to drigz's. I used his and looks like it's installed ok. I've installed it in a different dir than usr/local. The problem is that there is no bin dir in the dir i've installed gcc!!!However it looks like its installed ok...


I suppose i have to do the variable thing everytime that i have to use the 2.95 compiler. And thats ok because i only want to compile a program or two with that version.And thats the answer to Lleb's question. My problem is compatibility with an old program.
If i had problems with 3.2 i would try to upgrade,not downgrade :)

Lleb_KCir 05-22-2004 06:22 PM

Quote:

Originally posted by Andrew Benton
I would advise you not to put gcc-2.95 in /usr/local as /usr/local/bin is probably in your $PATH so you will have two versions of gcc in your $PATH, one in /usr/bin and one in /usr/local/bin. This may cause problems. I would suggest that you install it somewhere out of the way, such as /opt/gcc-2.95. That way there is less chance of confusion. When you need to use it you can temporarily set the variable
export CC=/opt/gcc-2.95/bin/gcc
Install gcc-2.95 in /opt by doing
Code:

tar xzf gcc-2.95.3.tar.gz &&
mkdir gcc-build &&
cd gcc-build &&
../gcc-2.95.3/configure --prefix=/opt/gcc-2.95 --enable-languages=c,c++ &&
make bootstrap &&
make install


what is the && and what does it do?

had a great responce on my thread about installing from source, and i still dont get it 100% yet, but getting closer.

you guys are great. thanks so much for all the help.

drigz 05-23-2004 06:53 AM

first command && second command

will execute the first comand and then the second. it saves time so you can just go and do something else, and when the first command (say make) is complete, second command (say make install) will start.

grcunningham 05-23-2004 07:33 AM

as far as learning how to install from source, i would
reccommend that rather than a compiler or kernel
install, you might want to download some small games or
something to practice on. after you untar and unzip them
the files INSTALL and README in the source directory
will tell you what to do

Linux.tar.gz 05-23-2004 07:36 AM

Put your distro in your profile, please.

ayie 05-25-2004 03:54 AM

Code:

Configuring for a i686-pc-linux-gnuoldld host.
*** This configuration is not supported in the following subdirectories:
    target-libf2c target-libffi target-boehm-gc target-zlib target-libjava zlib fastjar target-libobjc
    (Any other directories should still work fine.)
Created "Makefile" in /root/gcc-build using "mt-frag"
../gcc-3.3.3/configure: line 8: cc: command not found
*** The command 'cc -o conftest -g  conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

i got FEDORA, i try to install gcc through ssh..... but cannot .... pls help me.


All times are GMT -5. The time now is 06:05 AM.