1, view the current version of gcc: gcc --version
2, gcc obtain the installation package, such as gcc-7.1.0.tar.gz, download links: http://ftp.gnu.org/gnu/gcc/gcc-7.1.0/ .
3, extract the installation package gcc-7.1.0.tar.gz: tar -zvxf gcc-6.1.0.tar.gz --directory = / usr / local /
4, enter the gcc extract the directory: cd /usr/local/gcc-7.1.0
5, see the required installation package: vi ./contrib/download_prerequisites
Remarks:
gmp Download Link: http://ftp.gnu.org/pub/gnu/gmp/
mpfr Download Link: http://mirror.hust.edu.cn/gnu/mpfr/
mpc Download Link: http://ftp.gnu.org/gnu/mpc/
isl Download Link: http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/
6. After the download is complete, gmp, mpfr, mpc, isl put under cd /usr/local/gcc-7.1.0 installation directory and extract:
tar -xf gmp-6.1.0.tar.bz2
-xf mpfr cross-3.1.4.tar.bz2
tar -xf mpc-1.0.3.tar.gz
-xf of ISL 0.16.1.tar.bz2
7, establish a soft link:
ln -sf gmp-6.1.0 gmp
ln -sf mpfr-3.1.4 mpfr
ln -sf mpc-1.0.3 mpc
ln -sf isl-0.16.1 isl
8, update gcc, wait for the installation to complete, wait for a long time:
(1) mkdir build && cd build
(2) ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
(3) make && make install
Reference Links: https://www.cnblogs.com/chihm/p/6007356.html