how to install gcc & compiler on CentOS6.2!?

General support questions
Post Reply
jasonpu
Posts: 1
Joined: 2012/01/23 09:23:04

how to install gcc & compiler on CentOS6.2!?

Post by jasonpu » 2012/01/23 09:55:31

I'm method below,but Can not be installed gcc!? there are problems??
kernel:2.6.32-220.el6.i686
gcc version:->>>
----------------------------------
Using built-in specs.
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
-----------------------------------------------------------------------
1.GNU Download http://www.gnu.org/software/gcc/ GCC 4.6.2 (changes)

2.tar -xzvf gcc-4.6.2.tar.gz

3.mkdir gcc-4.6.2Compiler

4.../gcc-4.6.2/configure --prefix=/home/ray/C/gcc-4.6.2Compiler --enable-threads=posix --disable-checking --enable--long-long
--host=i686-RedHat-linux --with-system-zlib --enable-languages=c,c++,java
->>>>>
-----------------------------------------------------
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i686-RedHat-linux-gnu
checking target system type... i686-RedHat-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 a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for i686-RedHat-linux-gcc... no
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 ISO C89... none needed
checking for i686-RedHat-linux-g++... no
checking for i686-RedHat-linux-c++... no
checking for i686-RedHat-linux-gpp... no
checking for i686-RedHat-linux-aCC... no
checking for i686-RedHat-linux-CC... no
checking for i686-RedHat-linux-cxx... no
checking for i686-RedHat-linux-cc++... no
checking for i686-RedHat-linux-cl.exe... no
checking for i686-RedHat-linux-FCC... no
checking for i686-RedHat-linux-KCC... no
checking for i686-RedHat-linux-RCC... no
checking for i686-RedHat-linux-xlC_r... no
checking for i686-RedHat-linux-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for i686-RedHat-linux-gnatbind... no
checking for gnatbind... no
checking for i686-RedHat-linux-gnatmake... 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 objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries 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, MPFR and/or MPC 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.
:-o :-o
-------------------------
5.make
->>
------------
make: *** No targets specified and no makefile found. Stop.

--------------------------------

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

how to install gcc & compiler on CentOS6.2!?

Post by pschaff » 2012/01/24 19:01:22

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Please read about [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14408&forum=47]Installing Software[/url] and [url=http://wiki.centos.org/AdditionalResources/Repositories]Repositories[/url], and note the warnings and advice about installing and configuring the [url=http://wiki.centos.org/PackageManagement/Yum/Priorities]yum priorities plugin[/url]. Non-core repos should have a higher numeric value, which is a lower priority. Lower is "better" as in golf scores.

Please pay particular attention to the evils of [url=http://wiki.centos.org/PackageManagement/SourceInstalls]Source Installs[/url]. Source installs as root are particularly dangerous.

See also [url=http://wiki.centos.org/FAQ/General#head-472ce8446ebcfc82ca1800f775ba0e629ac835c7]FAQ#20. Where can I get the latest version of XyZ.rpm for CentOS? I cannot find it anywhere.[/url]

If you need later packages for such fundamental things as gcc then either use Fedora, possibly via [url=http://wiki.centos.org/HowTos#head-fb1ff7e71fb5f2f511cda8c68cb6ba5f6e8decae]virtualization[/url], live with what is available, find an earlier version that does work, or fix the software for compatibility with EL6. If you need help building something then please post details of that in a new topic.

I do note that Fedora 14 has [url=http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Everything/source/SRPMS/gcc-4.5.1-4.fc14.src.rpm]gcc-4.5.1-4.fc14.src.rpm[/url]. One could attempt to [url=http://wiki.centos.org/HowTos/RebuildSRPM]rebuild the Source RPM[/url], but I can't say that is really recommended, and would certainly recommend [b]not[/b] going too far down that road if replacing other core packages/libraries is required to make it work.

Why do you need a later GCC?

Post Reply