LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   yum install gcc doesn't set the lastest gcc ver 4.3.x (http://www.linuxquestions.org/questions/linux-newbie-8/yum-install-gcc-doesnt-set-the-lastest-gcc-ver-4-3-x-692341/)

kim,jw 12-22-2008 06:47 PM

yum install gcc doesn't set the lastest gcc ver 4.3.x
 
I'm using CentOS release 4.5 (Final), from /etc/redhat-release.

I need gcc 4.3.x, so firstly I downloaded it and did ./configure
but there were errors.
Quote:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp--//gcc-gnu-org/pub/gcc/infrastructure/.
See also http--//gcc-gnu-org/install/prerequisites-html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
Then, I just alternativly tried to 'yum install gcc', and that went well.
However, the result was not gcc 4.3.x but 3.4.6.
Quote:

]# gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)
yum update gcc also did not work now, looks like that my current version
is consigered as the lastest.
What should I do?

lazlow 12-22-2008 08:23 PM

Ok, with most major packages RHEL/Centos will not do an upgrade across a major revision. So they will not upgrade from gcc 3.4 to gcc 4.x or phpX to phpX+1. With Gcc there is an additional problem (vs other packages) in that the entire system is built using a specific version of GCC. If you replace Gcc 3.4 with GCC 4.X you will break your entire install. You can however add(vs replacing) an additional GCC version to the system, but anything you compile with that new version of GCC to run on that machine will have to be compiled completely statically, because if you do not you will run into unresolvable dependency issues. I believe(not sure) even RHEL/Centos5 is still running 4.1. Why do you specifically need 4.3?

kim,jw 12-22-2008 10:29 PM

Thanks a lot indeed.
The reason that I want to set up gcc 4.3.x is to apply a tool in my system,
of a new version which requires gcc 4.3.x, but if by that background using
the recent version at CentOS is not recommandable, then I would just use
the tool of old version.
Actually I do not what 'statical compile' means, but I feel like that if the
tool is not a MUST-USE item, it is reasonable not to use that, and I should be
just going to go with the old version.

Then, however, if I would meet the situation where I unavoidably need gcc 4.3.x or higher,
then I should use 'statical compile'. At least unless the policy or condition regarding
CentOS were changed.

In addition, is it possible to upgrade from CentOS 4.5 to higher version freely?
Otherwise I should purchase a package and install it entirely again onto the system?

lazlow 12-22-2008 11:51 PM

Centos is always free to download/update. The jump from 4.x to 4.x+1 occurs when you do a full yum update. When you do a full X.Y to X+1.Y they still advise doing a clean install. Having cleaned up a number of people's messes that tried to jump major revision (4.7to 5.0) via yum, I would strongly suggest doing a clean install. In the long run a clean install will save you time. To be clear, I am fairly certain that even the most current RHEL/Centos(5.3 should be out in early January) is still only using gcc 4.1. Here is the site to find a mirror to download Centos 5.X:



All times are GMT -5. The time now is 05:03 AM.