svn checkout svn://gcc.gnu.org/svn/gcc/trunk拿了GCC的最新代码,打算编译了学东西习学习C++
11的东西,结果在configure的时候出现例如以下问题:

   Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+

   
http://www.multiprecision.org/mpc 下载mpc-0.9.tar.gz      

   ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.bz2下载gmp-5.0.1.tar.bz2

   http://ftp.gnu.org/gnu/mpfr/下载mpfr-3.1.0.tar.xz。

     先開始安装GMP。解压GMP的压缩包后,得到源码文件夹gmp-5.0.1。在该文件夹的同级文件夹下建立一个暂时的编译文件夹,这里命名为temp。然后開始配置安装选项,进入temp文件夹,输入下面命令进行配置:

  ../gmp-5.0.1/configure --prefix=/usr/local/gmp-5.0.1

make

sudo make install

mpfr和mpc的安装方法与gmp类似。只是要注意配置的时候要把gmp与mpfr的依赖关系选项加进去,详细配置命令例如以下:

  ../mpfr-3.1.0/configure --prefix=/usr/local/mpfr-3.1.0 --with-gmp=/usr/local/gmp-5.0.1

  ../mpc-0.9/configure --prefix=/usr/local/mpc-0.9 --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.0

  安装好这三个库之后,就能够正式開始安装gcc了。

当然了链接的时候,须要刚刚编译的3个lib。

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-0.9/lib:/usr/local/gmp-5.0.1/lib:/usr/local/mpfr-3.1.0/lib 

然后是典型的configure,make,install三步曲。

../gcc-4.7.2/configure --prefix=/usr/local/gcc-4.7 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.0
--with-mpc=/usr/local/mpc-0.9

make

make check(可选)

sudo make install

经过漫长的等待:

/usr/local/gcc-4.7/bin/g++ -v

使用内建 specs。

COLLECT_GCC=/usr/local/gcc-4.7/bin/g++

COLLECT_LTO_WRAPPER=/usr/local/gcc-4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper

目标:x86_64-unknown-linux-gnu

配置为:../gcc-4.7.2/configure --prefix=/usr/local/gcc-4.7 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-3.1.0 --with-mpc=/usr/local/mpc-0.9

线程模型:posix

gcc 版本号 4.7.0 20120113 (experimental) (GCC)

開始C++ 11学习了。

gcc configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0的更多相关文章

  1. GCC升级问题解决:configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.,mpfr2.4.0

    如果遇到类似问题: configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.,mpfr2.4.0 解决 ...

  2. configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

    configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+. 一.错误发生情景: 在安装gcc时,执行.c ...

  3. Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)

    本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢!   今天在CentOS6.5下编译安装PHP时,一直报错 confi ...

  4. 升级 GCC 支持C++11 或 configure: error: *** A compiler with support for C++11 language features is required.

    configure: error: *** A compiler with support for C++11 language features is required. 参考链接: (1)升级 G ...

  5. maven 项目编译时候提示:Error building POM (may not be this project's POM).

    编译时候提示Error building POM (may not be this project's POM)的错误,具体信息如下: [0] 'dependencies.dependency.ver ...

  6. nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的

    源码安装nginx报错,找不到gcc,但是实际上gcc是存在的,如下: # ./configure checking for OS + Linux -.el7.x86_64 x86_64 checki ...

  7. CentOS安装Nginx 报错“configure: error: the HTTP rewrite module requires the PCRE library”解决办法

    错误提示: ./configure: error: the HTTP rewrite module requires the PCRE library.      yum install gcc gc ...

  8. python psutil 编译中断。 error: command 'gcc' failed with exit status 1

    error info [root@chenbj psutil-2.0.0]# python setup.py install running install running bdist_egg run ...

  9. pip error: command 'gcc' failed with exit status 1

    SWIG/_m2crypto_wrap.c:127:20: 致命错误:Python.h:没有那个文件或目录     #include <Python.h>                  ...

随机推荐

  1. CocoaPods的安装及设置

    1>CocoaPods简介 CocoaPods是一个用来帮助我们管理第三方依赖库的工具 在开发iOS应用时,会经常使用第三方类库,手动下载比较麻烦,通过CocoaPods可以便捷的下载与管理第三 ...

  2. Pahom on Water(最大流)

    Pahom on Water Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  3. jsp验证表单后再提交

    在提交表单时,我们常常需要验证核实表单内容,若都不为空时,方能提交:若有文本框为空则不提交,并获取鼠标焦点到文本框上 ,所以我们可以利用onsubmit的方法来做,请看下面例子: <html&g ...

  4. HDU 5091 线段树扫描线

    给出N个点.和一个w*h的矩形 给出N个点的坐标,求该矩形最多能够覆盖多少个点 对每一个点point(x.y)右边生成相应的点(x+w,y)值为-1: 纵向建立线段树,从左到右扫描线扫一遍.遇到点则用 ...

  5. 关于int.TryParse的使用

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  6. 树莓派deian的linux常用命令

    Linux系统,这个强大的系统,现在树莓派也要用到.给大家普及一下. 那些常用的Linux命令 linux的文件结构 /   根目录下的目录 /bin /home /dev /usr /opt /et ...

  7. ZOJ 3329 One Person Game 【概率DP,求期望】

    题意:有三个骰子,分别有k1,k2,k3个面. 每次掷骰子,如果三个面分别为a,b,c则分数置0,否则加上三个骰子的分数之和. 当分数大于n时结束.求游戏的期望步数.初始分数为0 设dp[i]表示达到 ...

  8. Ural 1149 - Sinus Dances

    Let An = sin(1–sin(2+sin(3–sin(4+…sin(n))…)Let Sn = (…(A1+n)A2+n–1)A3+…+2)An+1For given N print SN I ...

  9. csharp .net vb 复制图像

    .NET Compact Framework 不支持 Image.Clone 方法,可是仍能够复制图像和图像的某些部分.以下的演示例子演示怎样运行以下操作: 定义一个方法以创建位图. 定义一个重载方法 ...

  10. 修改Hadoop作业调度算法过程解析

    最近几个星期一直在修改hadoop的计算能力调度算法,遇到了这样那样的问题. 我修改的版本是hadoop-0.20.2 第一步: 将hadoop的源码加载到eclipse中配置使用ant编译 第二步: ...