【发布时间】:2016-09-06 21:46:25
【问题描述】:
我正在尝试将我拥有的特定 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 位置,所以它们应该已经在搜索路径上。
【问题讨论】:
-
如果你用实际信息替换“a machine”、“a version”等会更简单...不,libsmurf.XYZ 中的数字不应该与包有任何关系版本。您应该检查 config.log。如果由于某种原因编译失败或版本错误,则错误消息是相同的。
标签: c++ gcc dependencies gmp