Solved

Install GCC(4.6.3) on Centos6

Posted on 2013-11-09
12
875 Views
Last Modified: 2013-11-12
Dear Experts,

I need to install the version of GCC(4.6.4) and following the exact command in
the following
https://github.com/jackywei/HOW-TO-BUILD-HHVM-WiKi/wiki/Build-&-Install-GCC4.6.3-in-CentOS-(5.2-&-6.3)

And all steps of installation is successfuly
but when I check the version of gcc that is still old version of 4.4.0
not 4.6.2. Why ?

How can I check what is wrong from my
installation directory at  /home/dev/gcc-4.6.3 in which I installed the
package of new version GCc(4.6.3)

And I used gcc -v for version check

Please advise
Duncan
0
Comment
Question by:duncanb7
  • 6
  • 4
  • 2
12 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 39635918
Try 'which gcc' to find out which binary is invoked. Chances are that if you also have 4.4.0 installed, the 'gcc' you call when checking with '-v' is just a link to gcc-4.4.0. You could also try

find / -name "gcc*" -print -exec ls -l {} \;

Open in new window

0
 
LVL 13

Author Comment

by:duncanb7
ID: 39635922
When I type

which gcc //it shows

/usr/local/bin/gcc


And  I try
find / -name "gcc*" -print -exec ls -l {} \;

What is command for  find / -name "gcc*" -print -exec ls -l {} \; ?

And then after find command, I check gcc -v

it still show 4.8.0 not  4.6.3

So what I should do next  ?

Duncan
0
 
LVL 86

Expert Comment

by:jkr
ID: 39635932
Try

ls -l /usr/local/bin/gcc

Open in new window


I am pretty sure it will tell you that it is a link to 'gcc-4.4.0/bin/gcc'.

And the 'find' command will do that for all files starting with 'gcc' on your machine.
0
 
LVL 86

Accepted Solution

by:
jkr earned 333 total points
ID: 39636023
BTW, if you can confirm that, you can then set the link to the new version like

ln -f /usr/[path]/gcc-4.6.3/bin/gcc /usr/local/bin/gcc

Open in new window


'-f' forces overwriting the old link, if you want to be cautious, use '-' instead.
0
 
LVL 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 167 total points
ID: 39636090
Do you have more than one gcc? Try to find it like this:

find / 2>/dev/null | grep -i gcc

For each line you find, get its version info, for example:

/usr/local/bin/gcc --version

What versions do you get and how many?
0
 
LVL 86

Expert Comment

by:jkr
ID: 39636095
>> Do you have more than one gcc?

Um, that's what all comments before yours were about. Please take the time to read the question history before commenting...
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 39636128
@jkr - I always read the history, I did not see an answer to how many gcc's are present or not that is why I ask this explicitly. The procedure the asker is referring to has instructions to move gcc files to _old etc. I'm referring tho this part:

And  I try
find / -name "gcc*" -print -exec ls -l {} \;

What is command for  find / -name "gcc*" -print -exec ls -l {} \; ?

Do you know for sure how many and what versions of gcc are installed at the asker's system?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39636536
root@vps [~]# /usr/local/bin/gcc --version
gcc (GCC) 4.4.0
Copyright (C) 2013 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.

it is still the old version
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39636551
Since I have ben installing a lot of version that I don't know how many.

so How can I un-install all gcc version ?

and then I will try to install the new version again that I think it is final fix
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 333 total points
ID: 39636802
You don't have to uninstall the previous version if you follow the steps above, but if you want to, use the packet management of your OS for that purpose.
0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 39641198
Thanks for your reply and  GCC vsersion is reported correctly today
0
 
LVL 86

Expert Comment

by:jkr
ID: 39643559
Then why a 'B'? Sorry, I wonder what I've been missing...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Fine Tune your automatic Updates for Ubuntu / Debian
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now