[英]Can't install local-build gcc-4.9.0 because of libgmp.so.3
我正在尝试在Linux的本地版本中与gmp-4.3.2 , mpfr-3.1.4和mpc-1.0.3一起安装gcc-4.9.0 (我正在关注本教程)。
但是当我在gcc构建目录中运行make install
,出现此错误:
test -z "/home/k.masson/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0" || /usr/bin/mkdir -p "/home/k.masson/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0"
Installing dummy lib libgcj_bc.so.1.0.0
/home/k.masson/build/gcc-4.9.0/host-x86_64-unknown-linux-gnu/gcc/cc1:
主要是这样的:
error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
似乎libgmp.so.3没有正确安装,但确实是('make install'对于gmp来说没有失败),我检查了很多次链接是否正确但无事可做,我不知道为什么文件找不到。
在运行make install
之前,我按以下顺序运行这些命令:
LD_LIBRARY_PATH=/home/k.masson/gmp-4.3.2/lib:/home/k.masson/mpfr-2.4.2/lib:/home/k.masson/mpc-0.8.1/lib ./configure --prefix=/home/k.masson/gcc-4.9.0 --with-gmp=/home/k.masson/gmp-4.3.2 --with-mpfr=/home/k.masson/mpfr-2.4.2 --with-mpc=/home/k.masson/mpc-0.8.1 --disable-multilib
这(我不知道为什么,但这在本教程中):
LD_LIBRARY_PATH=/home/k.masson/gmp-4.3.2/lib:/home/k.masson/mpfr-2.4.2/lib:/home/k.masson/mpc-0.8.1/lib nice -n 19 time make -j8
libgmp.so.3位于/home/k.masson/gmp-4.3.2/lib和libgmp.so.3.5.2中 。 我什至尝试用ln -s libgmp.so.3.5.2 libgmp.so.3
自己创建链接,但不能解决问题。
要在本地构建中安装gmp ,我使用了以下命令:
./configure --prefix=/home/k.masson/gmp-4.3.2 --enable-cxx
nice -n 19 time make -j8
make install
make check
echo $? # Returns 2
但是一个测试失败了 :
====================================
1 of 58 tests failed
Please report to gmp-bugs@gmplib.org
====================================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/home/k.masson/build/gmp-4.3.2/tests/mpz'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/k.masson/build/gmp-4.3.2/tests/mpz'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/k.masson/build/gmp-4.3.2/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/k.masson/build/gmp-4.3.2'
make: *** [check] Error 2
另外,在运行测试时,我在上面得到了以下几行内容:
/bin/sh: line 4: 20956 Segmentation fault (core dumped) ${dir}$tst
所以我尝试安装gmp-6.1.0来避免此测试问题,并且它可以正常工作,所有测试都可以,但是现在,这是一个gcc问题,由于make文件不存在,我无法再运行make install
了。我应该保留新的gmp吗? 并更改我的gcc吗? 还是根本不?
谢谢你的帮助
为了解决安装gmp时的测试问题,我只是选择了一个较新的版本进行安装,它看起来是兼容性问题。 因此,我选择了gmp-6.1.0 ,安装和测试过程均成功。
但这在安装gcc-4.9.0时带来了一个新问题, ./configure
无法通过安装过程生成make文件。 因此,我必须获得一个较新的版本,我选择了gcc-4.9.3而不是gcc-4.9.0,并且一切正常。
正如@piyush令我注意到的那样,根本不建议使用简短的方法。 请参阅安装GCC 。
如果要进行本地构建,最好的方法是在此处下载所需的gcc版本,并在安装之前,在gcc源代码中运行./contrib/download_prerequisites
脚本。
如果没有,您可以使用软件包管理器,这会更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.