在 RHEL 7 中将 gcc 升级到 gcc-4.9

在 RHEL 7 中将 gcc 升级到 gcc-4.9

redhat 7 有 gcc 4.8.5。

我希望它升级到 4.9。为此,我使用了以下命令

sudo yum install devtoolset-3-gcc.x86_64

我得到了以下回复

Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-3-gcc.x86_64 0:4.9.1-10.el6 will be installed
--> Processing Dependency: devtoolset-3-binutils >= 2.22.52.0.1 for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Processing Dependency: devtoolset-3-runtime for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Processing Dependency: libmpfr.so.1()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Running transaction check
---> Package devtoolset-3-binutils.x86_64 0:2.24-18.el6 will be installed
---> Package devtoolset-3-gcc.x86_64 0:4.9.1-10.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
---> Package devtoolset-3-runtime.noarch 0:3.0-15.el6 will be installed
--> Processing Dependency: scl-utils >= 20120927-11 for package: devtoolset-3-runtime-3.0-15.el6.noarch
--> Running transaction check
---> Package devtoolset-3-gcc.x86_64 0:4.9.1-10.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: devtoolset-3-gcc-4.9.1-10.el6.x86_64
---> Package scl-utils.x86_64 0:20130529-17.el7_1 will be installed
--> Finished Dependency Resolution
Error: Package: devtoolset-3-gcc-4.9.1-10.el6.x86_64 (slc6-scl)
           Requires: libmpfr.so.1()(64bit)
Error: Package: devtoolset-3-gcc-4.9.1-10.el6.x86_64 (slc6-scl)
           Requires: libgmp.so.3()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我已经确认 mpfr 已安装

[ec2-user@ip-172-31-31-165 ~]$ sudo yum install mpfr-devel
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package mpfr-devel-3.1.1-4.el7.x86_64 already installed and latest version
Nothing to do
[ec2-user@ip-172-31-31-165 ~]$ sudo yum install mpfr
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package mpfr-3.1.1-4.el7.x86_64 already installed and latest version
Nothing to do

我还验证了 gmp 已安装

[ec2-user@ip-172-31-31-165 ~]$ sudo yum install gmp
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package 1:gmp-6.0.0-12.el7_1.x86_64 already installed and latest version
Nothing to do
[ec2-user@ip-172-31-31-165 ~]$ sudo yum install gmp-devel
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package 1:gmp-devel-6.0.0-12.el7_1.x86_64 already installed and latest version
Nothing to do

但是它们都已经存在于我的系统中。我这里遗漏了什么吗?如何在 RHEL 7 中安装 gcc 版本 4.9?

答案1


不是 2000 年的“redhat 7”,而是 RHEL 7:Redhat Enterprise Linux 7

注意:devtoolset-3 不是 gcc/g++ 的更新,而只是 EL7 可用的额外编译器之一。也就是说,您可以同时安装任意数量的 gcc 版本。请确保您已安装系统编译器:#yum install gcc-c++

需要:libmpfr.so.1()(64 位)

需要:libgmp.so.3()(64 位)


“devtoolset-3” 已旧(RHEL 6):1)请安装这些软件包(专为 EL7 构建,“2015 年 1 月”)...... compat-libgmp-4.3.1-1.sl7.x86_64.rpm, compat-libmpfr-2.4.1-1.sl7.x86_64.rpm

链接,兼容 libgmphttps://drive.google.com/file/d/0B7S255p3kFXNZFJDdWtkV3RyZTA/view?usp=sharing...和 ​​compat-libmpfrhttps://drive.google.com/file/d/0B7S255p3kFXNV0FoOVlPemRBS0k/view?usp=sharing

# cd Downloads/ && yum install compat-libgmp-4.3.1-1.sl7.x86_64.rpm compat-libmpfr-2.4.1-1.sl7.x86_64.rpm


2) 不需要完整的 devtoolset-3。这将安装 gcc-4.9 / g++-4.9 : # yum install devtoolset-3-gcc-c++... 总共约 4 个软件包。... 'gfortran' :# yum install devtoolset-3-gcc-gfortran

启用 gcc-4.9、g++-4.9:$ scl enable devtoolset-3 bash...和 ​​$gcc -v将显示“gcc 版本 4.9”(该设置在退出终端之前有效。)


相关内容