CentOS 7にgcc 10をインストール（SCL）

# はじめに

Software Collection(SCL)を利用してCentOS7にgcc10をインストール
参考：[Quick Start — Software Collections] (https://www.softwarecollections.org/en/docs/) (2021-06-23現在掲載なし)

## サポート

本手法で導入した場合、[Red Hat Software Collections Product Life Cycle - Red Hat Customer Portal](https://access.redhat.com/support/policy/updates/rhscl)より、2022-12がEOLだと思われる。
それ以降に報告された脆弱性や不具合への対応は実施されない可能性がある。

## LOG

### レポジトリ登録

```shell-session
# yum install -y centos-release-scl
```

### インストール

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

# yum install -y devtoolset-10
# scl enable devtoolset-10 bash
... 略
```

### 各種確認

```shell-session
# which gcc
/opt/rh/devtoolset-10/root/usr/bin/gcc

# gcc --version
gcc (GCC) 10.2.1 20200804 (Red Hat 10.2.1-2)
Copyright (C) 2020 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-10
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp-srv2.kddilabs.jp
 * centos-sclo-rh: ftp-srv2.kddilabs.jp
 * centos-sclo-sclo: ftp-srv2.kddilabs.jp
 * extras: ftp-srv2.kddilabs.jp
 * updates: ftp-srv2.kddilabs.jp
Installed Packages
Name        : devtoolset-10
Arch        : x86_64
Version     : 10.0
Release     : 0.el7
Size        : 2.2 k
Repo        : installed
From repo   : centos-sclo-rh
Summary     : Package that installs devtoolset-10
License     : GPLv2+
Description : This is the main package for devtoolset-10 Software Collection.

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

# yum info devtoolset-10-gcc-c++
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ftp-srv2.kddilabs.jp
 * centos-sclo-rh: ftp-srv2.kddilabs.jp
 * centos-sclo-sclo: ftp-srv2.kddilabs.jp
 * extras: ftp-srv2.kddilabs.jp
 * updates: ftp-srv2.kddilabs.jp
Installed Packages
Name        : devtoolset-10-gcc-c++
Arch        : x86_64
Version     : 10.2.1
Release     : 2.1.el7
Size        : 30 M
Repo        : installed
From repo   : centos-sclo-rh
Summary     : C++ support for GCC  version 10
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 10.  It includes support for most of the current C++ specification
            : and a lot of support for the upcoming C++ specification.
```