1、安装依赖包
yum -y groupinstall "development tools"
yum -y install dejagnu texinfo
2、安装
cd /home/share
tar -zxf gcc-9.3.0.tar.gz
rm -f gcc-9.3.0.tar.gz
cd gcc-9.3.0
./contrib/download_prerequisites
mkdir build
cd build
../configure --prefix=/home/software/gcc-9.3.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j2 && make install
3、移除安装包
cd /home/share
rm -rf gcc-9.3.0
4、更新lib库软链接
cd /lib64/
rm -f libstdc++.so.6
ln -s /home/software/gcc-9.3.0/lib64/libstdc++.so.6.0.28 libstdc++.so.6
配置环境变量模块
mkdir -p /home/software/modules/gcc/
vi /home/software/modules/gcc/9.3
-
#%Module1.0
-
-
set GCC /home/software/gcc-9.3.0
-
prepend-path PATH ${GCC}/bin
-
prepend-path LD_LIBRARY_PATH ${GCC}/lib64
-
prepend-path INCLUDE ${GCC}/include
阅读(1800) | 评论(0) | 转发(0) |