LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 04-06-2012, 02:22 AM   #1
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Rep: Reputation: 0
install gcc-4.3.1


I am installing amber12 in Centos 5.7 in AMD 64bit. The installation stops and enquiring gcc-4.3.1 for other related software to be complied and by default Centos 5.7 shipped with gcc-4.1.2.

I tried to google how to uninstall gcc-4.1.2 and install gcc-4.3.1 but I could not find any direct way.

I tried to install using yum install gcc44, but after installation I tried to use gcc -v and it says gcc-4.1.2 still.

So I need help here to install complete package of gcc-4.3.1.

Regards
 
Old 04-06-2012, 02:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you have gcc44 installed then you can make it the default using update-alternatives.

here's someone talking about it... https://gist.github.com/966932
 
Old 04-06-2012, 03:06 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Agreed .... gcc44 will do for any application.
And : You should never remove the system compiler :
You can have as many versions of gcc / g++ as you want,
installed at the same time.

To get the complete "gcc44" : # yum install gcc44-c++

Using : export CC=gcc44 CXX=g++44 && <other-command>


.

Last edited by knudfl; 04-06-2012 at 03:08 AM.
 
Old 04-06-2012, 04:03 AM   #4
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Dear knudfl,

Thanks for the reply. You wrote " export CC=gcc44 CXX=g++44 && <other-command> ". Shall I export the line including the phrase 'other-command' in < > or else I need to provide any command? Because I am not Linux expert and I just trying to fix the problem by some help by experts in this forum.

Thank you.
 
Old 04-06-2012, 04:09 AM   #5
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Hi,

I have done as prescribed in the website provided by acid_kewpie and followed as kudfl and get this message


Quote:
Searching for python2... Found python2.4: /usr/bin/python2.4

Obtaining the gnu suite version:
gcc -v
The version is 4.1.2
ERROR: RISM and PBSA FFT solver require version 4.3 or higher of the GNU compiler.
Please re-run configure with the '-nofftw3' flag to use this compiler:
./configure -nofftw3 gnu
Configure failed due to the errors above!
How to make the gcc44 as default compiler?

Thank you
 
Old 04-06-2012, 04:36 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The /etc/alternatives/ mechanism can be used , ref. post #2.

Please try the following ...

1) su
2) /usr/sbin/alternatives --install /usr/bin/gcc gcc /usr/bin/gcc44 2000

3) /usr/sbin/alternatives --config gcc
.... and then select gcc44.

.
 
Old 04-13-2012, 05:02 AM   #7
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Dear knudfl,

I have tried as your advice. I tried to type gcc -v once execute the command you proposed and I still get the same out put. That is gcc version 4.1.2.

I think the gcc doesnt link to gcc44.

I think this link may be important as AMBER look for gcc during compilation rather then gcc44.

Could you shade some light on this?

Thanks in advance.
 
Old 04-13-2012, 06:18 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
OK, there wasn't any entry for gcc in /etc/alternatives/, sorry.

Suggestion 1) export CC=gcc44 CXX=g++44 && ./configure
( If the is a configure in the unknown amber.)

Suggestion 2)
A little more inconvenient, but a link will do :
cd /usr/bin/ ; su ; mv gcc gcc-4.1.2-back ; ln -s gcc44 gcc

... Then you can any time delete the link, if you want to use gcc 4.1.2.
And rename gcc-4.1.2-back to gcc again.


P.S. : There is more than one application by name AMBER, I think.
Which are you using ?

.

Last edited by knudfl; 04-13-2012 at 06:36 AM.
 
Old 04-15-2012, 10:25 AM   #9
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Thanks for the suggestion.
I will try according to your suggestion.

For your information, I am using AMBER version 12 for GPU.


Regards
 
Old 04-15-2012, 10:38 AM   #10
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Hi I tried both the ways you suggested but no avail.
The results are as below.

[root@gpucc amber12]# ./configure gnu
Checking for updates...
AmberTools12 is up to date
Amber12 is up to date

Searching for python2... Found python2.4: /usr/bin/python2.4

Obtaining the gnu suite version:
gcc -v
The version is 4.1.2
ERROR: RISM and PBSA FFT solver require version 4.3 or higher of the GNU compiler.
Please re-run configure with the '-nofftw3' flag to use this compiler:
./configure -nofftw3 gnu
Configure failed due to the errors above!



note:
Is that possible for completely uninstall gcc-4.1.2 and install gcc44?
 
Old 04-15-2012, 12:49 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Did you do these commands ? ?

cd /usr/bin/
su <password>
mv gcc gcc-4.1.2-back
ln -s gcc44 gcc

Then 'gcc -v' should reply : 4.4.4

And yes, I guess, you can do : yum remove gcc
and : yum reinstall gcc44
... But you will still have to make the symlink in /usr/bin : gcc → gcc44

.
 
1 members found this post helpful.
Old 04-15-2012, 05:01 PM   #12
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Hi,

For you view I put there all the commands I used as per your kind advice.


[root@gpucc bin]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
[root@gpucc bin]# mv gcc gcc-4.1.2-back
[root@gpucc bin]# ln -s gcc44 gcc
[root@gpucc bin]# gcc
gcc gcc34 gcc-4.1.2-back gcc-4.1.2-backup gcc44 gccmakedep
[root@gpucc bin]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
[root@gpucc bin]# yum install gcc44
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.ipserverone.com
* epel: mirror.nus.edu.sg
* extras: centos.ipserverone.com
* rpmforge: ftp-stud.fht-esslingen.de
* updates: centos.ipserverone.com
Setting up Install Process
Package gcc44-4.4.6-3.el5.1.x86_64 already installed and latest version
Nothing to do
[root@gpucc bin]#



Is there any other way to do this?

Regards
Vijay.
 
Old 04-16-2012, 01:44 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Well, I get : 'gcc -v' → → gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)

May be use 'ls -l' to show if the link is valid :
Code:
cd /usr/bin/ && ls -s gcc*
lrwxrwxrwx 1 root root      5 16 apr 08:38 gcc -> gcc44
-rwxr-xr-x 2 root root  92988 30 jan  2011 gcc34
-rwxr-xr-x 2 root root 202408 22 feb 11:36 gcc412-back
-rwxr-xr-x 2 root root 235940 22 feb 07:37 gcc44
.

Last edited by knudfl; 04-16-2012 at 01:48 AM.
 
Old 04-16-2012, 02:07 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
is that possible you have an old gcc in your path before gcc44?
 
Old 04-16-2012, 08:17 AM   #15
vjramana
Member
 
Registered: Sep 2009
Posts: 89

Original Poster
Rep: Reputation: 0
Hi,

I just wanted to update on this issue. I used 'yum remove gcc' to remove all gcc including gfortran.
Then I installed gcc44 and gfortran4.4 separately using yum. After that I created symbolic link to gcc => gcc44 and gfortran => gfortran4.4. Finally I installed g++ and used the same type of link. Finally I tried to compile and it went through smoothly.

Thanks to all for helping me here.

Regards
 
  


Reply

Tags
gcc



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 when a current gcc is installed but not responding Nadishka Linux - Newbie 6 10-15-2009 03:33 PM
yum install gcc doesn't set the lastest gcc ver 4.3.x kim,jw Linux - Newbie 3 12-22-2008 11:51 PM
pkg-get install gcc ERROR: gcc unrecognized Raidmax Solaris / OpenSolaris 10 08-30-2007 12:51 PM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 02:13 PM

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

All times are GMT -5. The time now is 06:15 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
Open Source Consulting | Domain Registration