Skip to content

Instantly share code, notes, and snippets.

@1duo
Last active April 13, 2018 23:12
Show Gist options
  • Save 1duo/ebd12d742331ce82cf4b1523f4e48a82 to your computer and use it in GitHub Desktop.
Save 1duo/ebd12d742331ce82cf4b1523f4e48a82 to your computer and use it in GitHub Desktop.
Install GCC (GNU Compiler Collection) on CentOS 7.
  • Install Dependencies
yum install -y libmpc-devel mpfr-devel gmp-devel
  • Download GCC from:
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar -xvf gcc-4.9.2.tar.bz2 && cd gcc-4.9.2
  • Configure and Install
./configure --disable-multilib --enable-languages=c,c++
make -j$(nproc)
make install
  • To link GCC-4.9.2
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment