Compile and install GCC 5.1.0 in Linux
Compiling C/C ++ programs in Linux naturally lacks an excellent compiler, and GCC is a common tool in Linux. In late April 2015, GCC also came out of version 5.1.0, providing better support for C ++ 11/14. Since I recently studied OpenMP, Gcc-5.1.0 supports the latest OpenMP4.0 version. So today we will talk about GCC compilation and installation. The installed version is the latest version 5.1.0. Next let's go to the topic (we suggest using the root user throughout the process ):
1. Download the GCC source code:
Wget ftp://mirrors.kernel.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.gz2.decompress:
Tar-zxvf gcc-5.1.0.tar.gz3. Download dependencies required for compilation:
Cd gcc-5.1.0 // enter the gcc folder after unpacking
./Contrib/download_prerequisites // download Dependencies
Cd .. // return to the upper directory 4. Create the compilation output directory:
Mkdir gcc-build-5.1.05. Enter the output directory, execute the following command and generate the makefile file:
Cd gcc-build-5.1.0
../Gcc-5.1.0/configure -- enable-checking = release -- enable-packages ages = c, c ++ -- disable-multilib
6. Compile:
Make-j4: Wait for about 40 minutes. PS: it is best not to do anything in the compilation process. The CPU is fully loaded throughout the process. If it is inexplicably terminated, there will be a lot of troubles in the future.
7. installation:
After compilation, we can execute the installation:
Make install8. check version:
Gcc -- version
Or gcc-vroot @ Ubuntu :~ /Download/gcc-build-5.1.0 $ gcc -- version
Gcc (GCC) 5.1.0
Copyright©2015 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.
Linux GCC 4.8.1 clear and concise tutorial (Ubuntu 12.04 64-bit edition as an example)
Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 and compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4
Install and use Vim + GCC + GDB in Ubuntu
Switch two GCC versions in Ubuntu
CentOS6.5 upgrade to manually install GCC4.8.2
GCC details: click here
GCC: click here
This article permanently updates the link address: