Centos 6.5 compile and install gcc-4.9.1

Source: Internet
Author: User
Tags gmp

1. The environment is in the title

2. gcc-4.9.1 compilation and installation requires the system to have a set of GCC/g ++

3. Use Yum to install gcc/g ++

1 yum install gcc2 yum install gcc-c++

4. Download gcc-4.9.1 upload server via winscp

5. Extract

1 tar xvf gcc-4.9.1.tar.gz

6. download the dependencies compiled by GCC. This step will enable automatic download. However, after downloading the dependencies on my machine, it stops, I wonder whether the download server is unstable or why it is my local network. Then I used manual download.

1 ./contrib/download_prerequisites

7. If the download_prerequisites file is not successfully downloaded, download it manually and open the download_prerequisites file in the previous step.

 
# Necessary to build GCC.
MPFR=mpfr-2.4.2
GMP=gmp-4.3.2
MPC=mpc-0.8.1

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPFR.tar.bz2 || exit 1
tar xjf $MPFR.tar.bz2 || exit 1
ln -sf $MPFR mpfr || exit 1

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$GMP.tar.bz2 || exit 1
tar xjf $GMP.tar.bz2  || exit 1
ln -sf $GMP gmp || exit 1

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$MPC.tar.gz || exit 1
tar xzf $MPC.tar.gz || exit 1
ln -sf $MPC mpc || exit 1

# Necessary to build GCC with the Graphite loop optimizations.
if [ "$GRAPHITE_LOOP_OPT" = "yes" ] ; then
  ISL=isl-0.12.2
  CLOOG=cloog-0.18.1

  wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$ISL.tar.bz2 || exit 1
  tar xjf $ISL.tar.bz2  || exit 1
  ln -sf $ISL isl || exit 1

  wget ftp://gcc.gnu.org/pub/gcc/infrastructure/$CLOOG.tar.gz || exit 1
  tar xzf $CLOOG.tar.gz || exit 1
  ln -sf $CLOOG cloog || exit 1
fi

Download the five files manually, put the five files in the contrib directory, edit the download_prerequisites file, comment out the statements with wget, save them, and run them once.

8. Run configure

1 ./configure --prefix=/usr/gcc --enable-languages=c,c++ --disenable-multilib

9. Then make/make install to verify whether gcc-V/g ++-V has been installed successfully.

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.