Source compiler requires at least one of the available gcc compiler.
Yum can be used automatically or manually download the rpm package installation.
By yum can see at least the following packages, it is possible to search many sites rpm package download the appropriate rpm package, but wants to release, this version is yum search out for 4.4.7. So what version of gcc versions correspond to what to look for dependencies. rpm site will now explain what this package depends on the package, which is dependent on the package, very convenient, but it is quite time-consuming to find.
CentOS 6.6 to compile and install GCC4.8.2
Download Source Package gcc4.8.2
1 curl -O ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz;
First, you need to download gcc installed depends mpc, mpfr, gmp package, compiled with gcc comes with a script to download and help us to establish good links gcc compiler, you can go to download dependencies themselves.
1 tar zxf gcc-4.8.2.tar.gz
2 cd gcc-4.8.2
Download_prerequisites open above you can see, it is first downloaded the three packages, so when the script was found stuck in a place to download the reason may be inaccessible, and this is the need to find a new download address, the method is very simple, google documents you can find a lot of names.
Start compiling gcc
../configure -enable-checking = release -enable-languages = c, c ++ -disable-multilib
After the installation is complete, if you find gcc -v version does not change, you then perform the following startup script.
1 source / etc / profile
2 source ~ / .bash_profile
Problems after installing
Although knock gcc g ++ c ++, etc. are updated to the 4.8.2 version, but there are actually inside the computer after the installation of at least two versions of gcc
whereis or where you can see there are multiple gcc files, which you can see the command gcc command corresponds usr / local / bin / gcc, gcc and the original executable file in / usr / bin / gcc, execute / usr / bin / gcc -v can see the version of gcc or 4.4, although this is not a problem, but some shell scripts or write directly to the Makefile gcc absolute path, it is likely to use the old version of gcc to compile, resulting in failure . We still need the original gcc overwritten. Best approach is to start to think, usr / bin / gcc soft link to usr / local / bin / gcc, for g ++, c ++, also made a similar deal with
This approach seems to solve the problem, but the overall feel not fly until recently compiled apache thrift found still not right. So consider when installing gcc can indicate whether the installation path.
1 ./configure --help
We can see that there is indeed such options
So only you need to bring in when configure --prefix = / usr gcc compiler can be installed under usr
In CentOS 6.4 to compile install GCC 4.8.1 + GDB 7.6.1 + Eclipse installed in CentOS 6.4 to compile GCC 4.8.1 + GDB 7.6.1 + Eclipse