Compiling gcc in a ubuntu14.04 environment

Source: Internet
Author: User
Tags gmp

    1. Download the GCC source code to the GNU Open Source website and view the compilation tutorial

      GNU/GCC Website: http://www.gnu.org/software/gcc/

2. According to the official website tutorial, compiling GCC's required environment depends on M4,GMP,MFPR,MPC

  • GNU multiple Precision Library (GMP) version 4.3.2 (or later)

  • necessary to build GCC.  If a GMP source distribution is found in asubdirectory of your GCC sources named gmp , it'll be builttogether with GCC. Alternatively, if GMP is already installed and itis not in your library search path, you'll have the  --with-gmpConfigure option. See also --with-gmp-lib and --with-gmp-include .

  • MPFR Library version 2.4.2 (or later)

  • necessary to build GCC.  It can be downloaded fromhttp://www.mpfr.org/. If an MPFR source distribution is FoundIn a subdirectory of your GCC sources named mpfr , it'll bebuilt together with GC C. Alternatively, if MPFR is already installedbut it's not in your default library search path, the --with-mpfr configure Optio  n should be used. See also --with-mpfr-lib and --with-mpfr-include .

  • MPC Library version 0.8.1 (or later)

  • Necessary to build GCC.  it can is downloaded fromhttp://www.multiprecision.org/.  if an MPC source Distr Ibutionis found in a subdirectory of your GCC sources named MPC , Itwill is built to Gether with GCC.  alternatively, if MPC is alreadyinstalled but it's not in your default library search path, the --WITH-MPC Configure option should be used.  see also --with-mpc-lib and -- With-mpc-include .

--------from https://gcc.gnu.org/install/prerequisites.html

3. The above dependency package, also the GNU project, can be found on the GNU website

http://www.gnu.org/software/m4/

http://www.gnu.org/software/gmp/

http://www.gnu.org/software/mpfr/

http://www.gnu.org/software/mpc/

4. Sequentially

Extract

Tar xjf XXX.tar.bz2

./configure

Make

sudo make install

5. Compiling GCC

Extracting GCC source code

Create Gcc-build

.. /gcc-5.3.0/configure

Setting environment variables Export ld_library_path= $LD _library_path:/usr/local/lib

Make

sudo make install

6. Success

/usr/local/bin/gcc-v

7. Problems encountered:

Issue 1:cannot compute suffix of object Files:cannot compile

Configure the environment variable, or the path is incorrect

Solution: Export ld_library_path= $LD _library_path:/usr/local/lib

Compiling gcc in a ubuntu14.04 environment

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.