GCC 6.2.0 Upgrade

Source: Internet
Author: User
Tags gmp

1. Download gcc (6.2.0 version)
Yum install-y gcc
Yum Install-y gcc-c++
Https://gcc.gnu.org/mirrors.html
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-6.2.0/gcc-6.2.0.tar.gz
wget http://ftp.gnu.org/gnu/gcc/gcc-6.2.0/gcc-6.2.0.tar.gz

It can also be found in the./contrib/download_prerequisites in the downloaded GCC (this method is recommended because the corresponding dependency is corresponding to your GCC version and does not require too much choice).
2. Download the required libraries for compilation
CD gcc-6.2.0
./contrib/download_prerequisites
Cd..

3. Build the compiled output directory
mkdir gcc-build-6.2.0

4. Enter this directory and execute the following command to generate the makefile file
CD gcc-build-6.2.0
.. /gcc-6.2.0/configure--PREFIX=/USR/LOCAL/GCC--enable-checking=release--enable-languages=c,c++--disable-multilib

5. Compiling

Make-j8

6. Installation

Make install

5. Check the GCC version

Gcc-v
6. Add a new version of GCC to the command search path:
Update-alternatives--INSTALL/USR/BIN/GCC GCC/USR/LOCAL/GCC/BIN/GCC 40
#ln-S/USR/LOCAL/GCC/BIN/GCC/USR/LOCAL/BIN/CC (must be added)
#ln-S/USR/LOCAL/GCC/BIN/GCC/USR/LOCAL/BIN/GCC (must be added)
#ln-S/usr/local/gcc/bin/g++/usr/local/bin/g++ (must be added)

7. Add Environment variables:

Vi/etc/bashrc

Add code:

Add the following code:

Gcc

ld_library_path=:/usr/local/mpc-0.8.1/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/ Gcc-4.6.1/lib
Export Ld_library_path= $LD _library_path:/usr/local/gmp/lib:/usr/local/mpfr/lib:/usr/local/mpc/lib:/usr/local/ Gcc/lib
Source/etc/profile
#export Ld_library_path
Yum Remove gcc-y
Yum Remove g++-y

GCC 6.2.0 Upgrade

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.