background
Recently I have to compile and install graph-tool, so I have to upgrade gcc from 4.8 to 9.3, because gcc9.1 and later support C++2017
method
1. Download the source code package https://mirrors.aliyun.com/gnu/gcc/gcc-9.3.0/
2. Unzip and cut into the directory
[root@scentos DynamicGraph]# tar -zxvf gcc-9.3.0.tar.gz
[root@scentos DynamicGraph]# cd gcc-9.3.0/
3. Download required dependencies
[root@scentos gcc-9.3.0]# ./contrib/download_prerequisites
[root@scentos gcc-9.3.0]# yum install glibc-devel.i686 libstdc++-devel.i686
4. Compile and install
[root@scentos gcc-9.3.0]# ./configure --prefix=/usr --enable-multilib
[root@scentos gcc-9.3.0]# make
[root@scentos gcc-9.3.0]# make install
5. Verification
[root@scentos gcc-9.3.0]# gcc --version
Conclusion
If downloading from the official website is slow, you can download it from my network disk:
Link: https://pan.baidu.com/s/17sWMSsRy9s08y3WP6vHtNQ
Extraction code: dgli