首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >GCC升级- GMP版本引发问题

GCC升级- GMP版本引发问题
EN

Stack Overflow用户
提问于 2016-05-11 13:01:58
回答 2查看 1.4K关注 0票数 0

我试图在我拥有的一台特定的linux机器上更新GCC,使之成为一个没有包可用的版本。

我运行配置脚本,它抱怨GMP的版本:

代码语言:javascript
运行
复制
# ../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时,它显示:

代码语言:javascript
运行
复制
/* 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报告如下:

代码语言:javascript
运行
复制
# rpm -q --qf "%{VERSION}\n" gmp
4.2.1
# rpm -q --qf "%{VERSION}\n" gmp-devel
4.2.1

因此,库和头似乎都是正确的版本(令人困惑的是,libgmp的.so文件编号似乎与版本号完全无关.正显示为

代码语言:javascript
运行
复制
libgmp.so -> libgmp.so.3.4.1

有人知道为什么会失败吗?这是唯一安装在这台机器上的两个gmp包,它们位于标准/usr/include和/usr/lib位置,因此它们应该已经在搜索路径上了。

EN

Stack Overflow用户

发布于 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,就可以节省大量的时间和痛苦。

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37163525

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档