Install gcc-5.3 on CentOS6.10

1. download gcc-5.3 source code:


curl ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2 -O

or:

ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2.sig

2. untar it:


tar xvfj gcc-5.3.0.tar.bz2
cd gcc-5.3.0

3. download prerequisites


./contrib/download_prerequisites

4. Compile gcc-5.3


unset CPLUS_INCLUDE_PATH LIBRARY_PATH

./configure --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --prefix=/opt/rh/devtoolset-6/root/usr --mandir=/opt/rh/devtoolset-6/root/usr/share/man --infodir=/opt/rh/devtoolset-6/root/usr/share/info

make clean && make -j3
make install

5. Add confige in bash_profile


1). first open ~/.bash_profile
2). append below to it:
scl enable devtoolset-6 bash

Done.

你可能感兴趣的:(Install gcc-5.3 on CentOS6.10)