Linux compiler installation GCC-5.1.0, linux compiler gcc-5.1.0

Source: Internet
Author: User

Linux compiler installation GCC-5.1.0, linux compiler gcc-5.1.0
Linux compiler installation GCC-5.1.0

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.gz

2. decompress:

  tar -zxvf gcc-5.1.0.tar.gz

3. download the required dependencies for compilation:

Cd gcc-5.1.0 // enter the gcc folder after unpacking./contrib/download_prerequisites // download dependency cd .. // return to the upper directory

4. Create a compilation output directory:

  mkdir gcc-build-5.1.0

5. 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-languages=c,c++ --disable-multilib

6. Compile:

  make -j4

The next step is to 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 install

8. Check the version:

Gcc -- version or gcc-v
Root @ 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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.