Compile gcc4.8

Source: Internet
Author: User
Tags gmp

Compilation of gcc4.8 recently due to work needs

 

We recommend that you download the GCC source code package before preparation. In this way, the GCC is also downloaded when the preparation is complete.

Wget http://mirror.bjtu.edu.cn/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2

 

Before installing GCC, you need to install the other three dependency packages: GMP, MPRF, and MPC.

Wget http://mirror.bjtu.edu.cn/gnu/gmp/gmp-5.1.3.tar.gz

 

Http://mirror.bjtu.edu.cn/gnu/mpfr/mpfr-3.1.2.tar.gz

 

Wget http://mirror.bjtu.edu.cn/gnu/mpc/mpc-1.0.2.tar.gz

 

The three packages must be installed in sequence, followed by the previous ones.

Tar-xzvf gmp-5.1.3.tar.gz

CD gmp-5.1.3

./Configure -- prefix =/usr/gmp-5.1.3

Make & make install

 

Tar-xzvf mpfr-3.1.2.tar.gz

CD mpfr-3.1.2

./Configure -- prefix =/usr/mpfr-3.1.2 -- With-GMP =/usr/gmp-5.1.3

Make & make install

 

Tar-xzvf mpc-1.0.2.tar.gz

CD mpc-1.0.2

./Configure -- prefix =/usr/mpc-1.0.2 -- With-GMP =/usr/gmp-5.1.3 -- With-mpfr =/usr/mpfr-3.1.2

Make & make install

 

This is the end of preparation. At this time, GCC must have been downloaded.

 

Tar-xjvf gcc-4.8.0.tar.bz2

 

Check the GCC installation instructions and find that the GCC file cannot be directly compiled in the root directory of the resource. Create a new directory in the resource and directory to compile and install it. (For complete installation instructions, see install/configure.html or http://gcc.gnu.org/install/configure.html)

CD gcc-4.8.0

Mkdir TMP

CD TMP

.. /Configure -- prefix =/usr/gcc-4.8.0 -- With-GMP =/usr/gmp-5.1.3/-- With-mpfr =/usr/mpfr-3.1.2/-- With-MPC =/usr/mpc-1.0.2 /-- enable-threads = POSIX -- enable-packages ages = C, c ++, objc, obj-C ++, Fortran -- With-PPL -- With-cloog -- Build = i686-redhat-linux

 

Make & make install

 

Then there is a long wait.

 

After compilation, remember to add the system variables. If you do not want to change the original GCC, add the GCC bin directory to the beginning of the path.

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.