CentOS6.6 update gcc4.8 tutorial

Source: Internet
Author: User
Tags gmp

CentOS6.6 update gcc4.8 tutorial

Recently, if you want to upgrade mesos0.23.0, gcc4.8 + is required for compiling mesos0.23.0. However, gcc of centos 6.6 is only available in version 4.4.7, so you have to manually upgrade it.

Download 4.8.2 source code

wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.8.2/gcc-4.8.2.tar.bz2  

Download dependencies (gmp-4.3.2, mpfr-2.4.2, mpc-0.8.1)

/usr/install/gcc-4.8.2/contrib/download_prerequisities

Compile and install dependencies in sequence

cd /usr/install/gcc-4.8.2/contrib/gmpmkdir buildcd build../configure --prefix=/usr/local/gcc/gmp-4.3.2sudo makesudo make installcd /usr/install/gcc-4.8.2/contrib/mpfrmkdir buildcd build../configure --prefix=/usr/local/gcc/mpfr-2.4.2 --with-gmp=/usr/local/gcc/gmp-4.3.2  sudo makesudo make installcd /usr/install/gcc-4.8.2/contrib/mpcmkdir buildcd build../configure --prefix=/usr/local/gcc/mpc-0.8.1 --with-mpfr=/usr/local/gcc/mpfr-2.4.2 --with-gmp=/usr/local/gcc/gmp-4.3.2  sudo makesudo make install

Compile and install gcc4.8.2

cd /usr/install/gcc-4.8.2mkdir build../configure --prefix=/usr/local/gcc --enable-threads=posix --disable-checking --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gcc/gmp-4.3.2 --with-mpfr=/usr/local/gcc/mpfr-2.4.2 --with-mpc=/usr/local/gcc/mpc-0.8.1sudo makesudo make install

Uninstall old version

yum remove -y gcc gcc-c++updatedb

Link to new version

cd /usr/bin  ln -s /usr/local/gcc/bin/gcc gcc  ln -s /usr/local/gcc/bin/g++ g++  

Check version

gcc -v

Done

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.