首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Red Hat Enterprise linux 6.5上安装GCC 4.8.2

问在Red Hat Enterprise linux 6.5上安装GCC 4.8.2
EN

Stack Overflow用户
提问于 2014-08-22 02:07:51
回答 2查看 27.7K关注 0票数 0

我是Red Hat Enterprise linux的新手。我在Red Hat Enterprise Linux6.5I向下编译gcc 4.8.2时遇到了一些问题;从GNU网站加载了源代码。我按照此链接中的步骤操作,触发的http://gcc.gnu.org/wiki/InstallingGCC命令如下:

代码语言:javascript
复制
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.

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

EN

回答 2

Stack Overflow用户

发布于 2016-01-30 05:53:49

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

Professional

  • Red

  • Red企业Linux开发人员支持,Enterprise

  • 30 Hat企业Linux开发人员支持,企业

  • Red Hat企业Linux开发人员套件

  • Red Hat企业Linux开发人员工作站,Red Linux开发人员工作站,Red自助式Red Hat企业Linux开发人员工作站Evaluation

  • 60 day支持Evaluation

  • 90 day支持Red企业Linux开发人员工作站Evaluation

  • 1-year不支持的合作伙伴评估Red Hat Enterprise Linux

  • 1年不支持的Red Hat Advanced Partner Subscription

您可以通过运行以下命令检查您是否拥有这些订阅中的任何一个:

subscription-manager list --available

和

subscription-manager list --consumed。

如果您没有任何这些订阅,您将不会成功地执行"yum install devtoolset-2“。然而,幸运的是,cern为他们的SLC6提供了一个“后门”,该后门也可以在RHEL 6中使用。通过根目录运行以下三行代码,您应该能够拥有它:

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

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

yum install devtoolset-2

完成后,您应该在/opt/rh/devtoolset-2/root/中有了新的开发包。

票数 9
EN

Stack Overflow用户

发布于 2014-10-30 05:53:39

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

代码语言:javascript
复制
gcc/4.9.1/install$ ls -ad gmp mpc mpfr
gmp  mpc  mpfr

如果这些没有出现,那么只需从gcc网站下载它们:ftp://gcc.gnu.org/pub/gcc/infrastructure/

然后解压the并对它们进行symlink/重命名,这样您就拥有了类似于上面的目录。然后,当你./configure和make时,gcc的makefile会自动为你构建它们。

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

https://stackoverflow.com/questions/25433142

复制
相关文章

相似问题

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