升级gcc 8.1

* sudo yum install -y glibc-devel bison flex texinfo build-essential gcc gcc-c++ make
* wget http://ftp.gnu.org/gnu/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz
* wget http://ftp.gnu.org/gnu/gdb/gdb-8.1.tar.gz
* tar -xzf gcc-8.1.0.tar.gz
* tar -xzf gdb-8.1.tar.gz

Install dependencies
* cd gcc-8.1.0
* ./contrib/download_prerequisites
OR
* wget https://mirrors.tuna.tsinghua.edu.cn/gnu/mpc/mpc-1.0.3.tar.gz
* tar xvfz mpc-1.0.3.tar.gz
* ln -s mpc-1.0.3 mpc

* wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gmp/gmp-6.1.0.tar.bz2
* tar xvfj gmp-6.1.0.tar.bz2
* ln -s gmp-6.1.0 gmp

* wget https://mirrors.tuna.tsinghua.edu.cn/gnu/mpfr/mpfr-3.1.4.tar.bz2
* tar xvfj mpfr-3.1.4.tar.bz2
* ln -s mpfr-3.1.4 mpfr

* wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
* tar xvfj isl-0.18.tar.bz2
* ln -s isl-0.18 isl

Install gcc
* sudo mkdir -p /usr/local/bin/gcc-8.1; cd $_
* ~/gcc-8.1.0/configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
* sudo make
* sudo make install
* source /etc/profile

Special complier link for cmake
* export CC=/usr/local/bin/gcc
* export CXX=/usr/local/bin/g++

你可能感兴趣的:(升级gcc 8.1)