LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-02-2006, 12:17 PM   #1
mlaich
LQ Newbie
 
Registered: Nov 2005
Location: Missoula, MT
Distribution: RH 9, Xandros
Posts: 26

Rep: Reputation: 15
upgrading the gcc to v3.4.5 on red hat 9


Hi All,
i have installed RH 9.0 on my machine, but my problem is the version of gcc(v3.2.2) it is built with. I was trying to install the new version (3.4.5). I copied the gcc-3.4.5.tar.gz from mirror. ran the following commands in order:
---
$ gzip -d gcc-3.4.5.tar.gz
$ tar xvf gcc-3.4.5.tar
$ cd gcc-3.4.5
$ ./configure --prefix=/usr/lib/gcc-3.4.5
$ make
$ make install
---
upto here everything went fine (except the fact that "make" took some 4-5 hours which might be OK???, on the other hand "make install" took 15-20 minutes only !!). Now i tried to compile a small file as "gcc -V 3.4.5 test.c"
but got the following errors:
---
gcc: installation problem, cannot exec `cc1': No such file or directory
---
but on the other hand "gcc test.c" works fine and "gcc -v test.c" shows that it is working with gcc v3.2.2 (exactly: "gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)").

I tried to look onto gnu website and was overwhlemed by the terms they have used . On the configuration part, they have asked to use "objdir" and "srcdir", and "installation on top level directory" but I could not understand what exactly they meant by them (afterall, i AM a newbie, right).

So guys, please help. All I want is a workable version of gcc-3.4.5.

Thanks --mlaich
 
Old 01-02-2006, 02:32 PM   #2
mlaich
LQ Newbie
 
Registered: Nov 2005
Location: Missoula, MT
Distribution: RH 9, Xandros
Posts: 26

Original Poster
Rep: Reputation: 15
kind of successfull....

Hi guys...
I tried again to install the gcc compiler, but as posted before, not by:
$ ./configure --prefix=/usr/lib/gcc-3.4.5
but this time as
$ ./configure --prefix=/usr/local

it seemingly kind of worked... as "gcc -v test.c" says:
"Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/specs
Configured with: ./configure --prefix=/usr/lib/gcc-3.4.5 : (reconfigured) ./configure --prefix=/usr/local
Thread model: posix
gcc version 3.4.5
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.5/cc1 -quiet -v t.c -quiet -dumpbase t.c -mtune=pentiumpro -auxbase t -version -o /tmp/cc0cRz2E.s
ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/include
/usr/include
End of search list.
GNU C version 3.4.5 (i686-pc-linux-gnu)
compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31908
as -V -Qy -o /tmp/ccGqAQHi.o /tmp/cc0cRz2E.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 2.13.90.0.18 20030206
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.5/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/crtbegin.o -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5 -L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/../../.. /tmp/ccGqAQHi.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.5/crtend.o /usr/lib/crtn.o"

my confusion is if it is reading with the 3.4.5 specs then why does it says:
"GNU C version 3.4.5 (i686-pc-linux-gnu)
compiled by GNU C version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)."

by the way, command "gcc -V 3.4.5 t.c" is successfull...

could you guys through some light on how can I change the compiler version to new one.

thanks --mlaich

Last edited by mlaich; 01-02-2006 at 02:38 PM.
 
Old 01-02-2006, 03:50 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
It says it was compiled with gcc version 3.2.2 because that's what you compiled it with. The Red Hat 9 gcc is version 3.2.2 and that's what you used to build the new gcc.

To use the new gcc instead of the old one, have /usr/local/bin before /usr/bin in your path or set the CC environment variable to point to the new gcc (you can set it in your bash stratup files so it gets set every time you login).
 
Old 01-02-2006, 04:15 PM   #4
mlaich
LQ Newbie
 
Registered: Nov 2005
Location: Missoula, MT
Distribution: RH 9, Xandros
Posts: 26

Original Poster
Rep: Reputation: 15
hi,
i tried to look into /root/.bashrc, but all it containes is:
---
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
---
could you tell me where or how exactly I have to change my path? I could not find any file name .bashrc at /bin dir.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install new gcc v3.4.5 over gcc v3.2.2 on red hat 9 mlaich Linux - Newbie 2 01-01-2006 08:52 PM
Upgrading QT on Red Hat 9 Adam Reyher Linux - Software 1 10-17-2004 02:19 PM
Upgrading Red hat thebutler4 Red Hat 3 05-28-2004 11:27 PM
Upgrading Red Hat 9 to Red Hat Enterprise Server 3 AS louisb Linux - Software 7 02-23-2004 10:25 PM
What to do after upgrading to Red Hat 7.1 Racso Linux - Newbie 4 01-21-2002 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration