安装MPFR和GMP

本人的系统是RH4.0AS.想升级GCC到4.3.0版本,在安装前,需要先安装MPFR和GMP.
下载MPFR (mpfr-2.3.0), MPFR_patchGMP (gmp-4.2.2).

分别加压缩.
[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

 

——————————————————————————————————————————————————————————

你好,我在龙芯的福珑电脑上安装gmp库,在make check的时候,出现以下问题
make[4]: Entering directory `/home/users/glibc/gmp-4.2.2/tests/mpn'
PASS: t-asmtype
PASS: t-aors_1
Segmentation fault
FAIL: t-divrem_1
Bus error
FAIL: t-fat
PASS: t-get_d
PASS: t-instrument
PASS: t-iord_u
PASS: t-mp_bases
PASS: t-perfsqr
PASS: t-scan
==================================
2 of 10 tests failed
Please report to gmp-bugs@swox.com
==================================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/home/users/glibc/gmp-4.2.2/tests/mpn'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/users/glibc/gmp-4.2.2/tests/mpn'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/users/glibc/gmp-4.2.2/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/users/glibc/gmp-4.2.2'
make: *** [check] Error 2
root:/home/users/glibc/gmp-4.2.2#
请问这可能的问题在哪里呢,谢谢

 

 

 

answer: sudo make install

权限不够

 

 

——————————————————————————————————————————————————————————

 

 

http://passmyeye.blog.163.com/blog/static/40890633200842143857138/

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值