centos7.6 安装gcc

  运维

安装gcc

wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.xz
tar -xvf gcc-8.2.0.tar.xz 
cd gcc-8.2.0/
./contrib/download_prerequisites
(如遇gmp包解压报错, yum -y install bzip2)
cd .. 
mkdir temp_gcc82 && cd temp_gcc82 
../gcc-8.2.0/configure --prefix=/usr/local/gcc-8.2 --enable-threads=posix --disable-checking --disable-multilib 
make -j 40
make install 

配置环境vim /etc/profile

export PATH=/usr/local/gcc-8.2/bin:$PATH

LEAVE A COMMENT

Captcha Code