Upgrading GCC
Upgrade the GCC version to 5.3 or later. The following describes how to upgrade GCC to 7.3.
- Download GCC 7.3.0.
URL: https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.gz
- Upload the software package to the /home directory and decompress it.
1 2
cd /home tar -xvf gcc-7.3.0.tar.gz

- Install GCC.Go to the GCC directory decompressed.
1cd /home/gcc-7.3.0
- Perform configuration.
1./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap

- ---prefix=path: specifies the installation directory of the GCC software. The default directory is /usr.
- --mandir=path: specifies the GCC software document directory. The default directory is /usr/share/man.
- --infodir=path: specifies the directory in which the GCC log information is stored. The default directory is /usr/share/info.
- --enable-bootstrap: enables bootstrap installation.
If error "configure: error: no acceptable C compiler found in $PATH" is reported during the configuration, run the yum -y reinstall gcc gcc-c++ command.
- Compile the GCC source code.
1make -j96
In the command, -j96 can make full use of the multi-core feature of the CPUs to accelerate the compilation. The number following -j indicates the number of CPU cores. You can run the cat /proc/cpuinfo | grep processor | wc -l command to query the number of CPU cores. The value specified must be less than or equal to the actual number of CPU cores.

- Start the installation.
1make -j96 install

- Perform configuration.
- Check whether the GCC version is 7.3.0.
1gcc -v
Parent topic: Configuring the Compilation Environment