# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
sudo yum install centos-release-scl
# 2. Install the collection:
$ sudo yum install devtoolset-7
# 3. Start using software collections:
$ scl enable devtoolset-7 bash
More than an issue this is a note.
Follow these instructions
https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/