For compatibility with another SDK I’m using, I have to use GCC 7.2.0 (RHEL devtoolset-7 provides GCC 7.3 at the time of this writing). So it should also be noted that I’m using GCC 7.3.1 to compile GCC 7.2.0; although the instructions should be generally applicable to other combinations. Notes on installing devtoolset-7: RHEL7 devtoolset-7
sudo yum -y install make bison flex gmp-devel libmpc-devel mpfr-devel texinfo wget https://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.gz tar xf gcc-7.2.0.tar.gz && cd gcc-7.2.0 mkdir build && cd build && ../configure --enable-languages=c,c++ --disable-multilib make -j$(nproc) sudo make install echo "export PATH=/usr/local/bin:\$PATH" >> ~/.bashrc echo "export LD_LIBRARY_PATH=/usr/local/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc source ~/.bashrc gcc --version
Attempting this on RHEL6 I discovered that epel needed to be installed in order for libmpc-devel to be available.
sudo yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Pingback: Installing boost on RHEL7/CentOS7 – GeoHub