LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (http://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   install gcc-4.3.1 (http://www.linuxquestions.org/questions/linux-distributions-5/install-gcc-4-3-1-a-938424/)

vjramana 04-06-2012 02:22 AM

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

acid_kewpie 04-06-2012 02:31 AM

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

knudfl 04-06-2012 03:06 AM

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>


.

vjramana 04-06-2012 04:03 AM

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.

vjramana 04-06-2012 04:09 AM

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

knudfl 04-06-2012 04:36 AM

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.

.

vjramana 04-13-2012 05:02 AM

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.

knudfl 04-13-2012 06:18 AM

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 ?

.

vjramana 04-15-2012 10:25 AM

Thanks for the suggestion.
I will try according to your suggestion.

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


Regards

vjramana 04-15-2012 10:38 AM

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?

knudfl 04-15-2012 12:49 PM

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

.

vjramana 04-15-2012 05:01 PM

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.

knudfl 04-16-2012 01:44 AM

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

.

pan64 04-16-2012 02:07 AM

is that possible you have an old gcc in your path before gcc44?

vjramana 04-16-2012 08:17 AM

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


All times are GMT -5. The time now is 03:01 PM.