Compile and install gcc-4.8.0 under CentOS 6.4
1. First download the source code
wget http:
//ftp.gnu.org/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2
2. Extract
tar -jxvf gcc-4.8.0.tar.bz2
3. Download the dependencies required for compilation.
cd gcc-4.8.0
./contrib/download_prerequisites
cd ..
4. Create a compilation output directory
mkdir gcc-build-4.8.0
5. Go to the directory and run the following command to generate the makefile file.
cd gcc-build-4.8.0
../gcc-4.8.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
6. Execute the following command to compile
make -j4
So far, the compilation process has been completed. Wait until the compilation is completed ....
During compilation, the CPU runs at full capacity. About 40 minutes.
7. Install
sudo make install
8. Check the gcc version.
gcc --version
[arlen@Arlen-CentOS gcc-build-4.8.0]$ gcc --version
gcc (GCC) 4.8.0
Copyright © 2013 Free Software Foundation, Inc.
This program is free software. Please refer to the source code copyright statement. This software has no guarantee;
Includes non-marketable and applicable warranties for a specific purpose.
[arlen@Arlen-CentOS gcc-build-4.8.0]$