由于libgmp.so.3,无法安装本地构建的gcc-4.9.0
Can't install local-build gcc-4.9.0 because of libgmp.so.3
我正试图在linux上的本地构建中安装gcc-4.9.0,以及gmp-4.3.2、mpfr-3.1.4和mpc-1.0.3(我正在遵循本教程)。
但是当我在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'didn not failed for gmp),我检查了很多次链接是否正确,但没有做任何事情,我不知道为什么make文件找不到它。
在运行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以及librgmp.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 install
了,因为make文件不存在。。我应该保留新的gmp吗?改变我的gcc?或者根本没有?
感谢您的帮助
捷径
为了解决安装gmp时的测试问题,我只选择了较新版本进行安装,这看起来是一个兼容性问题。因此,我选择了gmp-6.1.0,安装和测试过程都很成功。
但这在安装gcc-4.9.0时带来了一个新问题,./configure
无法通过安装过程生成make文件。所以我不得不得到一个新的版本,我选择了gcc-4.9.3而不是gcc-4.90,一切都很完美。
干净的方式
正如@piyush让我注意到的那样,根本不建议走捷径。请参阅安装GCC。
如果你想进行本地构建,最好是在这里下载你想要的gcc版本,在安装它之前,在gcc源代码中运行./contrib/download_prerequisites
脚本。
如果没有,您可以使用包管理器,这会更好。
- GCC:随机构建导致执行期间分段错误
- 未知的 GCC 链接器错误,但已成功构建
- 在使用 GCC 4.8.5 构建的应用中对 cxx11 函数的未定义引用
- 调试模板时出现问题.专门针对 Linux GCC 7、GCC 6、GCC 5、GCC 4.9 错误构建失败:模板参数 1
- 无法使用 devtoolsets-8-gcc 构建提升?
- GCC:在调试构建中优化的静态数据成员
- 使用 CMake (make) 和 GCC 构建和编译 gSOAP 项目
- 从 macOS Sierra 上的存储库构建 GCC 7(头)
- 如何编辑和重新构建GCC libstdc++C++标准库源代码
- 在构建gcc-4.8.2时,我如何理解这些可怕的错误
- 如何在 CentOS 6 x64 上构建 gcc 4.7.2
- 如何在基于ARM的设备上正确构建GCC
- 使用其他文件构建 gcc 插件
- Clang 3.2 构建 GCC 4.7 后构建中断
- 我可以用X64为ARM构建gcc吗
- 在RHEL6上构建GCC 5.2
- 从源代码构建GCC 5.4;这样构建的可执行文件试图链接不兼容的libstdc++,但运行失败
- 如何确定构建GCC交叉编译器的体系结构
- 如何在自己构建GCC后配置共享库搜索路径
- 在centos上构建gcc