Linux under GCC installation
1. Preparation work
Linux can typically install GCC directly from a package, for example, but not usually the latest version, such as the need to support c++11
And so on, you will need to install the latest version of GCC.
View the existing GCC versions first
If the system does not have any GCC installed, you will need to install the default low version of GCC from the development pack first
CentOS can also be installed with GCC development tools: Yum Groupinstall "Development Tools"
The following error may occur if you do not install the previous version first:
[CPP] view plain copy//======================================= configure:error:no acceptable C compiler fou nd in $PATH//=======================================
2, download
GCC Download Address
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc
GCC is in the releases folder below, currently the latest version is 4.8.2
The following error may occur if you install directly:
[CPP] view plain copy//============================= error ===================================== 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. //==========================================================================
Because of the lack of GCC dependent GMP, MPFR, MPC three software, so need to download and install them, they're on top of the
Infrastructure folder can be found inside. At the same time, GMP and MPFR and MPC are also interdependent relationship, so
To install in the following order, and with the options behind the Configure, follow the path of the dependent software
Download all the files and unzip them as follows:
3, installation and error resolution
[CPP] View Plain Copy//1, decompression gcc $tar -jxvf gcc-4.8.2.tar.bz2 $cd gcc-4.8.2 //2, decompression installation gmp $tar -jxvf gmp-4.3.2.tar.bz2 $CD gmp-4.3.2 $./CONFIGURE --PREFIX=/USR/LOCAL/GMP-4.3.2 //GMP Installation path $make $make check $sudo make install //3, decompression and installation mpfr $tar -jxvf mpfr-2.4.2.tar.bz2 $CD mpfr-2.4.2 // Congfigure is followed by MPFR installation path and dependent GMP path $configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/ local/gmp-4.3.2 $make $make check $sudo make install //4, decompression and installation mpc $tar -zxvf mpc-0.8.1.tar.gz $CD mpc-0.8.1 //congfigure is followed by the MPC installation path and dependent GMP and MPFR path $configure --prefix=/usr/local/mpc-0.8.1 --WITH-GMP=/USR/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 $make $make check $sudo make install without the following configuration, there will be the following MPC library errors and other library errors, etc., So a series of configurations is required