LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 09-24-2015, 04:49 AM   #1
pnehra
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Rep: Reputation: Disabled
Install gcc 4.8.4 on RedHat Linux 4


Hi All,

I need to install gcc version 4.8.4 on my "Red Hat Enterprise Linux ES release 4 (Nahant Update 8)". I have uninstalled existing gcc version 3.4.6 because our client is using gcc4.8.4. I am using 3rd party libraries and Apis which are also compiled with gcc4.8.4.
So, I need to install gcc version 4.8.4.

I can not use yum repository due to some dependencies.

So, I tried to install by downloading a tar file but could not success as showing below mentioned error.

configure: error: in `/home/parmod/gcc':
configure: error: no acceptable C compiler found in $PATH

So, I searched more on internet and most of the people are suggesting to install using rpm package, but I could not find any gcc4.8.4 version package for redhat 4.

Please give me path of rpm package for gcc version 4.8.4 if possible.
 
Old 09-24-2015, 05:01 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,622

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
RHEL4? Really?

What you needed to do is KEEP your installed gcc compiler (you will have to re-install it now) to compile the prerequisits for the new GCC, then compile the version 4 gcc from sources. To be very correct, you will then have to start with the clean sources and recompile gcc4 using gcc4.

The interesting question to me is: why are you stuck on an unsupported version of RHEL? Version 7 is the current release, I would expect anyone on 4 to have completed an upgrade project to RHEL 6 or 7 not later than 6 months ago.

Get to a more recent OS, and the more recent GCC comes along for the ride quite naturally, and all of those prerequistis take care of themselves. (or actually, are taken care of by yum/rpm and the current RHN for RHEL6/7)

Last edited by wpeckham; 09-24-2015 at 05:02 AM.
 
Old 09-24-2015, 05:31 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@pnehra : Welcome to LQ.

Required : # yum install gcc-c++
... Which will reinstall the default gcc / g++.

There is no compiler available for ES (EL) 4.8 that can compile gcc-4.8.x.
All other prerequisites for gcc-4.8.x : None are available as EL4 packages.
! And : I guess that the ES 4.x glibc is too old for gcc-4.8.x .
Conclusion : Give it up. Sorry.


RHEL 5 and RHEL 6 : http://linux.web.cern.ch/linux/devtoolset/
>>> http://linuxsoft.cern.ch/cern/devtoolset/
>> # yum install devtoolset-2-gcc-c++
..... and you have gcc / g++ version 4.8.2 .

Note : You can have as many versions of gcc as you want, installed at the same time.
Example : /usr/bin/{ gcc34, gcc44, gcc48, g++34, g++44, g++48 }.


-

Last edited by knudfl; 09-24-2015 at 05:41 AM.
 
Old 12-01-2015, 11:45 PM   #4
pnehra
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi All,

Now, I have installed a new gcc compiler 4.8.4 using below mentioned commands.
Quote:
tar -xzvf gcc-4.8.4.tar.gz
cd gcc-4.8.4
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.4/configure --prefix=$HOME/gcc-4.8.4 --enable-languages=c,c++
make
make install
Now, Please help me that How to set gcc 4.8.4 as default gcc compiler? The extracted gcc folder path is "/home/parmod/gcc-4.8.4".
The "objdir" path is "/home/parmod/objdir"

Last edited by pnehra; 12-01-2015 at 11:59 PM.
 
Old 12-01-2015, 11:56 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
run the yum command
Code:
 yum install gcc-c++
-- that is IF yum is installed
-- your system might still be using "up2date"

BUT seeing as RHEL 4.8 is NOT!!!! supported by redhat any longer this should error

basically on the UNSUPPORTED RHEL 4.8 you do not install gcc 4.8
gcc4 is WAY TOO NEW for the antique rhel4




Did "make " really build it without any errors on rhel4 ???????

did you run any "hello world " tests on gcc48 ?
i am betting they will fail , that is if it did build .

i dislike using "alternatives" so i use a shell script to set the sim links gcc33,gcc41,gcc48 on my system

Code:
#!/bin/bash

rm /usr/bin/cpp
ln -s /usr/bin/cpp-3.3 /usr/bin/cpp
echo ln -s cpp-3.3 cpp

rm /usr/bin/cc
ln -s /usr/bin/gcc-3.3 /usr/bin/cc
echo ln -s gcc-3.3 cc

rm /usr/bin/gcc
ln -s /usr/bin/gcc-3.3 /usr/bin/gcc
echo ln -s gcc-3.3 gcc

rm /usr/bin/c++
ln -s /usr/bin/g++-3.3 /usr/bin/c++
echo ln -s g++-3.3 c++

rm /usr/bin/g++
ln -s /usr/bin/g++-3.3 /usr/bin/g++
echo ln -s g++-3.3 g++

rm /usr/bin/gcov
ln -s /usr/bin/gcov-3.3 /usr/bin/gcov
echo ln -s g++-3.3 g++
Warning:
that is MY!!! script so you will have to edit it for YOUR set up
your settings will be a bit different

Last edited by John VV; 12-02-2015 at 12:19 AM.
 
1 members found this post helpful.
Old 12-02-2015, 01:57 AM   #6
pnehra
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi John VV,

I run the "hello world" as shown in below mentioned screenshot. It seems that it has run. Please let me know if any thing is wrong.

Quote:
[parmod@localhost ~]$ /home/parmod/gcc-4.8.4/bin/gcc /home/parmod/hello.c
[parmod@localhost ~]$ ./a.out
Hello, world!
[parmod@localhost ~]$
If above shown result is OK then May you update (few things) your script as per my environment for sample? As I am not able to understand that where is gcc4.8.4 is installed. Please help me.
 
  


Reply

Tags
gcc-4.8



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
How to install gcc 4.2 on Ubuntu 12.04 or RedHat 5 galfly Linux - Software 9 03-13-2013 05:15 AM
Installing GCC over existing gcc in Redhat linux prakasha.lunux Linux - Newbie 10 01-19-2011 08:34 PM
Redhat install gcc miamagoo Linux - Newbie 1 07-06-2010 12:56 PM
install gcc and c compiler into RedHat Linux spykid Linux - Newbie 4 10-25-2006 05:35 AM
redhat installation did not install gcc centr0 Linux - General 11 02-28-2003 08:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:00 PM.

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
Open Source Consulting | Domain Registration