安装MPFR和GMP
本⼈的系统是RH4.0AS.想升级GCC到4.3.0版本,在安装前,需要先安装MPFR和GMP.
下载 (mpfr-2.3.0),  和 (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 (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
include和contain
gmp.h的版本不匹配
原因多数是因为没有添加 --with-gmp-include ⽽造成的, 只要安我的做就可以通过
如果没有 --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib 很可能在 make check 的时候会出现以下错误
__gmp_get_memory_functions

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。