在centos 6.8中安装最新gcc时出错

在centos 6.8中安装最新gcc时出错,gcc,centos,lib,centos6.8,Gcc,Centos,Lib,Centos6.8,我已经听从了这个建议,但当我这样做的时候 ./configure --with-system-zlib --disable-multilib --enable-languages=c,c++ 存在以下错误: 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 specif

我已经听从了这个建议,但当我这样做的时候

./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
存在以下错误:

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.
但是如果我这样做了

sudo yum install libmpc-devel
Loaded plugins: fastestmirror, nvidia, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: repos-tx.psychz.net
 * elrepo: repos.dfw.lax-noc.com
 * extras: mirrors.thaidns.co.th
 * rpmforge: mirror.team-cymru.org
 * updates: mirror.mojohost.com
No package libmpc-devel available.
Error: Nothing to do
如果我看看图书馆,我有

ls /usr/lib64/libmp
libmpcdec.so.5        libmpfr.so.1.2.0      libmpssconfig.so
libmpcdec.so.5.0.2    libmp.so              libmpssconfig.so.0
libmpfr.so            libmp.so.3            libmpssconfig.so.0.1
libmpfr.so.1          libmp.so.3.1.14
但是请注意,没有像中那样的
libmpfr.a
。在同一目录中,我有
libgmp.so


如何安装
libmpc-devel
?然后如何安装gcc?

您应该使用gcc源目录中的
contrib/download\u先决条件
来下载依赖项的源。GCC将在构建过程中自动构建和使用它们


Red Hat Enterprise Linux 6上的匹配系统库缺失或太旧。

谢谢,安装已完成。但是,我不知道可执行文件在哪里。转到文件
gcc-7.2.0
没有bin文件夹,我猜不出在哪里可以找到
gcc
g++
gfortran
。我可以在这里看到一个
gcc
,这里是
COLLECT\u gcc=/usr/local/bin/gcc COLLECT\u LTO\u-WRAPPER=/usr/local/libexec/gcc/x86\u-pc-linux-gnu/7.2.0/LTO-WRAPPER>,但我怀疑这就是我不想使用的
yum
安装。您是否已经运行了
makeinstall
?它默认为
/usr/local
前缀。Red Hat存储库不包含
/usr/local/bin
中的程序。是的,我运行了
make install
。它的结尾类似于在:/usr/local/lib/。/lib64
中安装了库。但是在
/usr/local/bin
中,只有我前面提到的gcc。
etc
上也没有任何内容。因此您已将GCC安装到
/usr/local
。我不清楚你为什么在那之后还没做完。