copr.fedoraproject.org 提供了第三方构建的 devtoolset-3/4 的仓库, 可直接添加yum源repo后体验 devtoolset-3(gcc-4.9.2) devtoolset-4(gcc-5.2.1),免去自己构建编译 gcc 麻烦。
devtoolset-3
CentOS 6
https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/
wget https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo
yum --disablerepo='*' --enablerepo='rhscl-devtoolset-3' list
yum --disablerepo='*' --enablerepo='rhscl-devtoolset-3' install devtoolset-3-gcc devtoolset-3-gcc-c++
CentOS 7
https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3-el7/
wget https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3-el7/repo/epel-7/rhscl-devtoolset-3-el7-epel-7.repo
yum --disablerepo='*' --enablerepo='rhscl-devtoolset-3-el7' list
yum --disablerepo='*' --enablerepo='rhscl-devtoolset-3-el7' install devtoolset-3-gcc devtoolset-3-gcc-c++
devtoolset-4
https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/
# CentOS 6
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-6/hhorak-devtoolset-4-rebuild-bootstrap-epel-6.repo
# CentOS 7
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-7/hhorak-devtoolset-4-rebuild-bootstrap-epel-7.repo
yum --disablerepo='*' --enablerepo='hhorak-devtoolset-4-rebuild-bootstrap' list
yum --disablerepo='*' --enablerepo='hhorak-devtoolset-4-rebuild-bootstrap' install devtoolset-4-gcc devtoolset-4-gcc-c++
https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap2/
# CentOS 6
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-6/hhorak-devtoolset-4-rebuild-bootstrap-epel-6.repo
# CentOS 7
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-7/hhorak-devtoolset-4-rebuild-bootstrap-epel-7.repo