我试图在我拥有的一台特定的linux机器上更新GCC,使之成为一个没有包可用的版本。
我运行配置脚本,它抱怨GMP的版本:
# ../gcc/configure
checking build system type... i686-pc-linux-gnu
[snip]
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
但是,当我检查gmp.h时,它显示:
/* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
#define __GNU_MP_VERSION 4
#define __GNU_MP_VERSION_MINOR 2
#define __GNU_MP_VERSION_PATCHLEVEL 1
RPM报告如下:
# rpm -q --qf "%{VERSION}\n" gmp
4.2.1
# rpm -q --qf "%{VERSION}\n" gmp-devel
4.2.1
因此,库和头似乎都是正确的版本(令人困惑的是,libgmp的.so文件编号似乎与版本号完全无关.正显示为
libgmp.so -> libgmp.so.3.4.1
有人知道为什么会失败吗?这是唯一安装在这台机器上的两个gmp包,它们位于标准/usr/include和/usr/lib位置,因此它们应该已经在搜索路径上了。
发布于 2016-05-11 13:53:43
请阅读安装GCC
不推荐的困难方法是下载GMP、MPFR和mpc的源代码,然后在非标准位置配置并安装它们,然后配置GCC,使用- with -gmp=/gmp/path/gmp-with-mpfr=/mpc/生疏/path/mpfr-with=/生疏/path/ MPC,然后被迫永远在您的环境中设置LD_LIBRARY_PATH=/some/silly/path/gmp:/some/silly/path/mpfr:/some/silly/path/mpc/lib。这是愚蠢的,并给那些不了解动态链接器如何在运行时找到库的人带来了重大问题。别这么做。如果GCC的建筑在使用任何一种gmp或-with或-with选项时都失败了,那么你可能不应该使用它们。
只要运行./contrib/download_prerequisites
,就可以节省大量的时间和痛苦。
https://stackoverflow.com/questions/37163525
复制相似问题