在Red Hat Enterprise linux 6.5上安装GCC 4.8.2

在Red Hat Enterprise linux 6.5上安装GCC 4.8.2,linux,gcc,gmp,mpfr,mpc,Linux,Gcc,Gmp,Mpfr,Mpc,我是Red Hat Enterprise linux的新手。 在Red Hat Enterprise Linux 6.5上编译gcc 4.8.2时,我遇到了一些问题 我放下;已从GNU webite加载源代码。 我遵循了此链接中的步骤 触发的命令包括: tar xzf gcc-4.6.2.tar.gz cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir $PWD/../gcc-4.8.2/confi

我是Red Hat Enterprise linux的新手。 在Red Hat Enterprise Linux 6.5上编译gcc 4.8.2时,我遇到了一些问题 我放下;已从GNU webite加载源代码。 我遵循了此链接中的步骤 触发的命令包括:

tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.2/configure 

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-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 libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for gcc... gcc
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 accepts -g... yes
checking for gcc 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 whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... gnatbind
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
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.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.
我在谷歌上进行了调查,然后发现以下问题与此相关 但它再次将我重定向到上面的链接,我在前面找到并遵循了这个链接

我需要关于如何处理这个问题的指导。
欢迎您提出建议。

由于某些原因,mpc/mpfr/gmp软件包无法下载。只需查看您的gcc源目录,它应该已经创建了指向这些包的符号链接:

gcc/4.9.1/install$ ls -ad gmp mpc mpfr
gmp  mpc  mpfr
如果没有显示,只需从gcc站点下载即可:


然后对它们进行解压和符号链接/重命名,这样您就拥有了如上所述的目录。然后,当您./configure和make时,gcc的makefile将自动为您构建它们。

在RHEL 6上安装gcc 4.8.2的官方方式是通过安装Red Hat Developer Toolset(yum install devtoolset-2),要安装它,您需要具有以下订阅之一:

  • Red Hat Enterprise Linux开发人员支持,专业版
  • Red Hat Enterprise Linux开发人员支持,企业版
  • 红帽企业Linux开发者套件
  • Red Hat Enterprise Linux开发人员工作站,专业版
  • Red Hat Enterprise Linux开发者工作站,企业版
  • 30天自支持Red Hat Enterprise Linux开发者工作站评估
  • 60天支持的Red Hat Enterprise Linux开发者工作站评估
  • 支持90天的Red Hat Enterprise Linux开发者工作站评估
  • 1年不受支持的合作伙伴评估Red Hat Enterprise Linux
  • 1年不受支持的Red Hat Advanced Partner订阅
您可以通过运行以下命令来检查是否有这些订阅:

订阅管理器列表--可用

订阅管理器列表--已使用

如果您没有这些订阅,则无法成功执行“yum安装devtoolset-2”。然而,幸运的是,欧洲核子研究所为他们的SLC6提供了一个“后门”,也可用于RHEL 6。通过root在下面三行运行,您应该能够拥有它:

wget-O/etc/yum.repos.d/slc6-devtoolset.repohttp://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo

wget-O/etc/pki/rpm-gpg/rpm-gpg-KEY-cernhttp://ftp.scientificlinux.org/linux/scientific/5x/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-cern

yum安装devtoolset-2


完成后,您应该在/opt/rh/devtoolset-2/root/

中拥有新的开发包,如前所述,您必须拥有错误日志中所示的库--
gmp
mpfr
mpc
!我想使用<代码> YUM信息< /代码>您可以知道是否安装了这些实用工具。请考虑安装ReHAT开发者工具集,这是一个附加程序,它包括一些重要的开发软件(包括GCC)的最新版本。商业RedHat版本在这里:免费相同的CentOS版本(在RHEL上工作)在这里:您构建GCC是为了好玩/学习还是因为您需要更新的版本?我在您的帖子中看到了4.6.2和4.8.2,您是否一直键入相同的版本?请使用关键URL