Operating system: Centos6.564-bit Source GCC version: 4.4.7; objective: to upgrade GCC to 4.8.2 to support C ++ 11. 1. get the GCC4.8.2 package: wgethttp: // container Operating system: Centos 6.5 64-bit original GCC version: 4.4.7; objective: to upgrade GCC to 4.8.2 to support C ++ 11. 1. get the GCC 4.8.2 package:
Wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.2/gcc-4.8.2.tar.bz2
2. decompress:
Tar-jvxf gcc-4.8.2.tar.bz2
3. downloading, configuring, and installing dependency libraries can save a lot of time and effort.
Enter the directory gcc-4.8.2 and run:
./Contrib/download_prerequisites
4. create an output directory and add it to the directory:
Mkdir gcc-build-4.8.2; cd gcc-build-4.8.2
5. Pre-compile
../Configure -- enable-checking = release -- enable-extensions ages = c, c ++ -- disable-multilib
-- Enable-extensions ages indicates the languages that your gcc must support. -- disable-multilib does not generate a cross compiler that compiles executable code on other platforms. -- The compiler generated by disable-checking does not perform additional checks during the compilation process. you can also use -- enable-checking = xxx to add some checks;
If-disable-multilib is not added, the yum install glibc-devel.i686 glibc-devel is required
6. Compile:
Make-j4
7. installation:
Make install
8. verification:
Gcc-v or g ++-v