개인 공부/리눅스

CentOS7 gcc, g++ version update

RyoTTa 2023. 9. 1. 15:42
반응형

gcc compile

$ cd $HOME/tools
$ wget https://ftp.kaist.ac.kr/gnu/gcc/gcc-12.3.0/gcc-12.3.0.tar.gz
$ tar -xvf gcc-12.3.0.tar.gz
$ cd gcc-12.3.0
$ mkdir build
$ ./configure --prefix=$HOME/tools/gcc-12.3.0/build --disable-multilib --enable-languages=c,c++
$ make -j
$ make install

 

bashrc 수정

$ vim ~/.bashrc

export GCC12=$HOME/tools/gcc-12.3.0/build
export PATH=$GCC12/bin:$PATH

$ source ~/.bashrc
$ gcc -v
반응형