Linux gcc version upgrade

Linux gcc version upgrade

  Operating environment RHEL7 , during kernel compilation compiler version, need to upgrade gcc compiler, select gcc-8.3.0.

  http://ftp.gnu.org/gnu/gcc which provides all gcc version available for download.

Easy Installation

  For installation and unzip

[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
[root@localhost src]# tar xvf gcc-8.3.0.tar.xz

  Dependencies download compiled for the needs of this amazing script file ./contrib/download_prerequisites will help us to download, configure, install dependencies, we can save a lot of time and effort.

[root@localhost src]# cd gcc-8.3.0/
[root@localhost gcc-8.3.0]# ./contrib/download_prerequisites

  The establishment of a directory for file storage compile the

[root@localhost gcc-8.3.0]# mkdir gcc-build-8.3.0
[root@localhost gcc-8.3.0]# cd gcc-build-8.3.0/

  Generate Makefile

[root@localhost gcc-build-8.3.0]# ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib

  Compile (Note: This step is very time-consuming). -j4 option is to make optimized for multi-core processors.

[root@localhost gcc-build-8.3.0]# make -j4

  installation

[root@localhost gcc-build-8.3.0]# sudo make install

  Verifying the Installation

  Restart, then view the gcc version

[root@localhost gcc-build-8.3.0]# gcc -v

 

Guess you like

Origin www.cnblogs.com/dinghailong128/p/12153330.html