【问题标题】:Error in installing latest gcc in centos 6.8在 centos 6.8 中安装最新的 gcc 时出错
【发布时间】:2018-04-22 20:24:41
【问题描述】:

我已经遵循HDJEMAI 的建议,但是当我这样做时

./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

但请注意,here 中没有 libmpfr.a。在同一个目录中,我有libgmp.so

如何安装libmpc-devel?那我怎么安装gcc呢?

【问题讨论】:

    标签: gcc centos lib centos6.8


    【解决方案1】:

    您应该使用 GCC 源目录中的contrib/download_prerequisites 来下载依赖项的源代码。 GCC 会在构建过程中自动构建和使用它们。

    Red Hat Enterprise Linux 6 上的匹配系统库要么丢失,要么太旧。

    【讨论】:

    • 谢谢,安装完成。但是,我不知道可执行文件在哪里。转到文件gcc-7.2.0,没有bin文件夹,我猜不出在哪里可以找到gccg++gfortran
    • 我可以在这里看到gcc COLLECT_GCC=/usr/local/bin/gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper,但我怀疑这是yum 安装,这是我不想使用的安装。
    • 你已经运行make install了吗?它默认为 /usr/local 前缀。 Red Hat 存储库不包含 /usr/local/bin 中的程序。
    • 是的,我跑了make install。它以Libraries have been installed in: /usr/local/lib/../lib64 之类的东西结尾。但是在/usr/local/bin 中只有我之前提到的 gcc。 etc 上也没有任何内容。
    • 所以你已经将GCC安装到/usr/local。我不清楚你为什么在那之后没有完成。
    猜你喜欢
    • 2017-04-20
    • 2018-10-13
    • 2016-12-26
    • 1970-01-01
    • 2016-06-05
    • 2017-10-06
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    相关资源
    最近更新 更多