Upgrade GCC to 4.8.2

Source: Internet
Author: User

Current Environment: Centos6.5_64-minimal

First install GCC and gcc-c++

[Email protected] ~]# Rpm-qa | grep gcclibgcc-4.4.7-11.el6.x86_64[[email protected] ~]# yum install-y gcc gcc-c++ #安装gcc, gcc-c++ can be compiled and installed behind the later version of GCC [Email protected] ~]# Rpm-qa | grep gcclibgcc-4.4.7-11.el6.x86_64gcc-4.4.7-11.el6.x86_64gcc-c++-4.4.7-11.el6.x86_64

1. Download the source package

wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2 Decompression: TAR-JXVF gcc-4.8.2.tar.bz2
2. Download the required libraries for compilation
CD gcc-4.8.2./contrib/download_prerequisites CD.
3. Build the compiled output directory
mkdir gcc-build-4.8.2
4. Enter this directory and execute the following command to generate the makefile file
CD gcc-build-4.8.2. /gcc-4.8.2/configure--enable-checking=release--enable-languages=c,c++--disable-multilib
5. Compiling

make -j4                                                #j4选项是make对多核处理器的优化,如果不成功请使用 make


If the compilation succeeds, then the time is relatively long, half an hour or so, so if you look at it has been in the output did not immediately stop, should be very happy! 6. Installation
Make install
7. Switch GCC to the new versiondetermine the path of the newly installed GCC, the general default is under/usr/local/bin.add a new gcc to the optional, the last third is the name, the penultimate parameter is the new GCC path, the final parameter 40 is the priority, and the new version is automatically used after setting a larger one.
Update-alternatives--INSTALL/USR/BIN/GCC gcc/usr/local/bin/x86_64-unknown-linux-gnu-gcc-4.8.2 40
8. Verify that the current version has been switched to the new
Gcc-v



Upgrade GCC to 4.8.2

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.