构建GCC需要GMP 4.2+,MPFR 2.3.1+和MPC 0.8.0+ [英] Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+

查看:1774
本文介绍了构建GCC需要GMP 4.2+,MPFR 2.3.1+和MPC 0.8.0+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 http://www.netgull.com/下载了GCC 4.5 gcc / releases / gcc-4.5.0 / 但是当我尝试设置/构建时,我得到的错误如下:

  Linux:>〜/ shared_scripts / bin / gcc / gcc-4.5.0 1040> /x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0/configure CC =gcc -m64--prefix = / x / home / prakash_satya / shared_scripts / bin / gcc / gcc-4.5.0  - -with-gmp-lib = / usr / lib64 --with-mpfr-lib = / usr / lib64 --enable-shared --enable-threads = posix --enable -__ cxa_atexit --enable-clocale = gnu --enable -languages = c,c ++ 
检查编译系统类型... x86_64-unknown-linux-gnu
检查主机系统类型... x86_64-unknown-linux-gnu
检查目标系统类型... x86_64-unknown-linux-gnu
检查BSD兼容安装... / usr / bin / install -c
检查ln是否工作...是
检查是否ln -s工程...是
检查不截断输出的sed ... / bin / sed
检查gawk ... gawk
检查gcc ... gcc -m64
检查C编译器的默认输出文件名... a.out
检查C编译器是否工作...是
检查我们是否正在交叉编译... no
检查可执行文件的后缀...
检查对象的后缀文件...
检查我们是否使用GNU C编译器...是
检查gcc -m64是否接受-g ...是
检查gcc -m64选项是否接受ISO C89 ...无需
检查g ++ ... g ++
检查我们是否使用GNU C ++编译器...是
检查g ++是否接受-g ...是
检查gnatbind ... no
检查gnatmake ... no
检查编译器驱动程序是否理解Ada ... no
检查如何比较bootstrapped对象... cmp - -ignore-initial = 16 $$ f1 $$ f2
检查objdir ... .libs
检查gmp.h的正确版本... no
configure:error:Building GCC要求GMP 4.2+,MPFR 2.3.1+和MPC 0.8.0+。
试用--with-gmp,--with-mpfr和/或--with-mpc选项来指定
的位置。这些库的源代码可以在
各自的托管站点以及
ftp://gcc.gnu.org/pub/gcc/infrastructure/中找到。有关其他信息,另请参阅
http://gcc.gnu.org/install/prerequisites.html。如果
从供应商分发包中获得了GMP,MPFR和/或MPC,则
确保已经安装了库和
文件头。它们可能位于不同的包装中。
Linux:>〜/ shared_scripts / bin / gcc / gcc-4.5.0 1041>

以下库位于相应目录中

  /usr/lib/libgmp.a 
/usr/lib64/libgmp.a

/usr/lib/libmpfr.a
/usr/lib64/libmpfr.a

我没有在盒子的任何位置安装libmpc.a库。



基于错误我怎么知道:

a)libgmp.a的当前版本是什么和libmpfr.a被安装。
$ b b)b)如果它们版本不正确,我怎么能部署我自己的版本而不打扰当前版本?

$ b $在安装了这些库的目录( / usr / gnu64 / lib )中,我选择了 还有一个 libgmp.la 文件(和 libmpc.la libmpfr.la 文件),其中包含可读的文本。 SO版本信息在那里,但与产品版本不完全相同。它反映了链接兼容性。



我试图调查我的版本,我想出的奇怪解决方案是运行GCC(4.6.1)我用 -v 选项构建。部分地,它说:

  GNU C(GCC)版本4.6.1(x86_64-apple-darwin11.1.0)$ b由GNU C版本4.6.1编译的$ b,GMP版本5.0.1,MPFR版本3.0.0,MPC版本0.8.2 
警告:GMP头版本5.0.1与库版本5.0.2不同。
警告:MPFR头版本3.0.0与库版本3.1.0不同。
警告:MPC头版本0.8.2与库版本0.9不同。

所以,看起来我已经安装了GMP 5.0.2(但我用5.0.1构建了GCC )和MPFR 3.1.0(但我用3.0.0构建了GCC)和MPC 0.9(但我用0.8.2构建了GCC)。这种不匹配是因为我试图编译和安装GCC 4.6.2,它可能需要更新的版本。 (我没有成功,但这是一个不同的故事。)



我在 / usr / gnu64 / lib ,然后告诉GCC使用配置选项 - with-mpfr = / usr / gnu64 / lib --with-gmp = / usr / gnu64 / lib - with-mpc = / usr / gnu / 64 / lib 。这些路径是硬连线到GCC,它从那里工作。


I downloaded GCC 4.5 from http://www.netgull.com/gcc/releases/gcc-4.5.0/ but when I try to setup / build I am getting below error:

Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1040> /x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0/configure CC="gcc -m64" --prefix=/x/home/prakash_satya/shared_scripts/bin/gcc/gcc-4.5.0 --with-gmp-lib=/usr/lib64 --with-mpfr-lib=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... gcc -m64
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ 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.
Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1041>

The following libs are present in respective directories

/usr/lib/libgmp.a
/usr/lib64/libgmp.a

/usr/lib/libmpfr.a
/usr/lib64/libmpfr.a

I do not have libmpc.a library installed anywhere in boxes.

Based upon the error how can I know :

a) what is the current version of libgmp.a and libmpfr.a are installed.

b) If they are of incorrect version how can I deploy my own version without disturbing the current one?

解决方案

In the directory where I have those libraries installed (/usr/gnu64/lib), I also have a libgmp.la file (and libmpc.la and libmpfr.la files), which contain readable text. The SO version information is in there, but that is not quite the same as the 'product version'. It tells about link compatibility instead.

I was trying to investigate which version I had, and the weird solution I came up with was to run the GCC (4.6.1) that I built with the -v option. In part, it said:

GNU C (GCC) version 4.6.1 (x86_64-apple-darwin11.1.0)
    compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2
warning: GMP header version 5.0.1 differs from library version 5.0.2.
warning: MPFR header version 3.0.0 differs from library version 3.1.0.
warning: MPC header version 0.8.2 differs from library version 0.9.

So, it appears that I have GMP 5.0.2 installed (but I built GCC with 5.0.1), and MPFR 3.1.0 (but I built GCC with 3.0.0) and MPC 0.9 (but I built GCC with 0.8.2). The mismatch comes about because I tried to compile and install GCC 4.6.2 and it presumably needed the newer versions. (I didn't succeed, but that's a different story.)

I install my custom-built libraries in /usr/gnu64/lib, and then tell GCC that's where to find them with the configure options --with-mpfr=/usr/gnu64/lib, --with-gmp=/usr/gnu64/lib, --with-mpc=/usr/gnu/64/lib. These paths are hard-wired into GCC and it works from there.

这篇关于构建GCC需要GMP 4.2+,MPFR 2.3.1+和MPC 0.8.0+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆