Build and install Gcc-4.9 under CentOS

Source: Internet
Author: User
Tags gmp

To the company test Server environment, manual installation gcc-4.9.0 A lot of effort, recorded as follows.

1, install GCC, g++, the system source default installation version is 4.4.7;

2, install dependency package GMP, MPFR, MPC, pay attention to the installation sequence;

3, modify the dynamic library link path, add GMP, MPFR, MPC;

4, compile and install Gcc-4.9, create a new directory Gcc-build to store make process to produce files;

5, copy the Gcc-4.9 header file to the directory/usr/include/c++;

6, modify Ld_library_path, PATH and Cplus_include_path;

7, establish a new GCC, g++ soft connection.

1,Yum-YInstall GCC    Yum-YInstall GCC-c++2,mkdir/usr/local/gmp-4.3.2    ./configure--prefix=/usr/local/gmp-4.3.2/ Make     Make Install    mkdir/usr/local/mpfr-2.4.2    ./configure--prefix=/usr/local/mpfr-2.4.2--with-gmp=/usr/local/gmp-4.3.2     Make     Make Install    mkdir/usr/local/mpc-0.8.1    ./configure--prefix=/usr/local/mpc-0.8.1--with-gmp=/usr/local/gmp-4.3.2--with-mpfr=/usr/local/mpfr-2.4.2     Make     Make Install3, export Ld_library_path= $LD _library_path:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/mpc-0.8.1/Lib4,mkdir GCC-bulid CDGCC-Build:/GCC-4.9.0/configure--prefix=/usr/local/GCC-4.9.0--exec-prefix=/usr/local/GCC--enable-languages=c,c++--with-gmp=/usr/local/gmp-4.3.2--with-mpfr=/usr/local/mpfr-2.4.2--with-mpc=/usr/local/mpc-0.8.1--disable-Multilib Make     Make Install5,CP-r/usr/local/GCC-4.9.0/include/c++/4.9.0/usr/include/c++6, export Ld_library_path= $LD _library_path:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/mpc-0.8.1/lib:/usr/local/GCC/lib64 Export PATH= $PATH:/usr/local/GCC/Bin Export Cplus_include_path= $CPLUS _include_path:/usr/include/c++/4.9.0:/usr/include/c++/4.9.0/x86_64-unknown-linux-GNU7,MV GCC GCC-4.4.7    LN-s/usr/local/GCC/bin/GCC./GCC    MVg++ g++-4.4.7    LN-s/usr/local/GCC/bin/g++ g++

Build and install Gcc-4.9 under CentOS

Related Article

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.