安装MPFR和GMP

分别加压缩.
[root@ibm ~]# tar jxf mpfr-2.3.0.tar.bz2 &
[root@ibm ~]# tar jxf gmp-4.2.2.tar.bz2 &

安装过程是先安装gmp,然后再安装mpfr.

安装gmp
[root@ibm ~]# cd gmp-4.2.2
[root@ibm gmp-4.2.2]# ./configure
[root@ibm gmp-4.2.2]# make
[root@ibm gmp-4.2.2]# make check  
这一步是必要的,用来查看有没有文件不匹配或缺失,在最后提示,到时注意看有没有Erro之类的提示,如果没有说明安装正常了. 本人安装过程中没有出现错误, 如果网友编译过程中出了问题记得告诉我.
[root@ibm gmp-4.2.2]# make install
安装编译后的软件,完成了安装过程

有必要说明程序的头文件(.h)和库文件(lib*)的位置,本次安装会安装在 /usr/local/include 和 /usr/local/lib . 这个对后面安装mpfr很有作用.

安装mpfr
[root@ibm ~]# cd mpfr-2.3.0
接下来把补丁给安装上
[root@ibm ~]# patch -N -Z -p1 < mpfr-2.3.0.patch
在安装过程中,有两个.c文件因为时间参数不能匹配而不能应用补丁.mpfr.h和version.c 

Not setting time of file mpfr.h (time mismatch)
Not setting time of file version.c (time mismatch)

在接下来的安装似乎没有影响.希望知道的朋友告诉我
接着配置
[root@ibm mpfr-2.3.0]# ./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib
[root@ibm mpfr-2.3.0]#  make
[root@ibm mpfr-2.3.0]#  make check

如果出现如下信息
====================
All 132 tests passed
====================
make[2]: Leaving directory `/root/mpfr-2.3.0/tests'
make[1]: Leaving directory `/root/mpfr-2.3.0/tests'
make[1]: Entering directory `/root/mpfr-2.3.0'
make[1]: Nothing to be done for `check-am'.
make[1]: Leaving directory `/root/mpfr-2.3.0'
说明编译成功了.
接下来安装
[root@ibm mpfr-2.3.0]#  make install


注:
如果在配置mpfr的过程中出现如下信息
checking if gmp.h version and libgmp version are the same... (4.2.2/4.1.4) no
configure: WARNING: 'gmp.h' and 'libgmp' seems to have different versions or
configure: WARNING: we cannot run a program linked with GMP (if you cannot
configure: WARNING: see the version numbers above).
configure: WARNING: However since we can't use 'libtool' inside the configure,
configure: WARNING: we can't be sure. See 'config.log' for details.
configure: creating ./config.status
gmp.h的版本不匹配
原因多数是因为没有添加 --with-gmp-include 而造成的, 只要安我的做就可以通过

如果没有 --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib 
很可能在 make check 的时候会出现以下错误
__gmp_get_memory_functions
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值