在CentOS 7上安装gcc 11(SCL)

首先

使用软件集合(Software Collection, SCL)在CentOS7上安装gcc11。
参考:【快速入门 – 软件集合】(https://www.softwarecollections.org/en/docs/)(截至2023年1月8日)

支持

如果使用此方法进行导入,根据红帽软件集产品生命周期-红帽客户门户网站,预计2023年12月将达到终止支持(EOL)。
在此之后可能不会进行对报告的漏洞或问题的处理。

记录

登记代码库

# yum install -y centos-release-scl

安装

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

# yum install -y devtoolset-11
... 略
# scl enable devtoolset-11 bash

确认的各种类型

# which gcc
/opt/rh/devtoolset-11/root/usr/bin/gcc

# gcc --version
gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# yum info devtoolset-11
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * centos-sclo-rh: ftp.iij.ad.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
Name        : devtoolset-11
Arch        : x86_64
Version     : 11.1
Release     : 2.el7
Size        : 2.2 k
Repo        : installed
From repo   : centos-sclo-rh
Summary     : Package that installs devtoolset-11
License     : GPLv2+
Description : This is the main package for devtoolset-11 Software Collection.

# yum info devtoolset-11-gcc
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * centos-sclo-rh: ftp.iij.ad.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
Name        : devtoolset-11-gcc
Arch        : x86_64
Version     : 11.2.1
Release     : 9.1.el7
Size        : 76 M
Repo        : installed
From repo   : centos-sclo-rh
Summary     : GCC version 11
URL         : http://gcc.gnu.org
License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Description : The devtoolset-11-gcc package contains the GNU Compiler Collection version 10.

# yum info devtoolset-11-gcc-c++
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * centos-sclo-rh: ftp.iij.ad.jp
 * centos-sclo-sclo: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
Name        : devtoolset-11-gcc-c++
Arch        : x86_64
Version     : 11.2.1
Release     : 9.1.el7
Size        : 31 M
Repo        : installed
From repo   : centos-sclo-rh
Summary     : C++ support for GCC  version 11
URL         : http://gcc.gnu.org
License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Description : This package adds C++ support to the GNU Compiler Collection
            : version 11.  It includes support for most of the current C++ specification
            : and a lot of support for the upcoming C++ specification.
广告
将在 10 秒后关闭
bannerAds