CentOS the GCC version is too low and my system is gcc-4.7.7 and needs to be upgraded.
1. Download gcc 4.9.1 source code
URL: http://www.linuxfromscratch.org/blfs/view/svn/general/gcc.html
wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2
2. Extract source code
Tar jxvf gcc-4.9.1.tar.bz2
3. Installation Environment Establishment
GCC has a self-contained script that automatically helps you download the dependent libraries that you need, which is recommended, otherwise you may have a version incompatibility problem with your downloaded library.
CD gcc-4.9.1
./contrib/download_prerequisites
4. Create a compiled file directory
CD..
mkdir Gcc-build
5. Enter gcc-build and generate makefile files
.. /gcc-4.9.1/configure--enable-checking=release--enable-languages=c,c++ --disable-multilib
6. Modifying environment variables
Export Ld_library_path= $LD _library_path:/usr/local/lib
7. Compiling the installation
Make-j4 make
Install
After the compilation is successful, view the GCC version as 4.9.1 with Gcc-v.
Reference Document: http://plutopalace.blog.com/2014/03/28/centos-compile-install-gcc/
Http://www.netroby.com/view.php?id=3621#.U_Wcsx9d48o