Question : The default?gcc?version on CentOS are too old to build a particular application. How can I upgrade the version of?gcc?installed on CentOS?
??
As of CentOS 6.5, the default version of?gcc?installed is 4.4.7. If you want to Upgrade?gcc?on CentOS, can installdevtools, which is a centos version of? Red Hat Developer toolset. The?devtools, which is available for CentOS 5 and 6, contains a suite of development tools Including?gcc,?gdb,?binutils,?e Lfutils, etc. the?devtools?1.1. Offers?gccversion 4.7.2.
To Install?devtools?on CentOS, use the following commands.
$ sudo wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo-P/etc/yum.repos.d
$ sudo sh-c ' echo ' enabled=1 ' >>/etc/yum.repos.d/devtools-1.1.repo '
$ sudo yum install devtoolset-1.1
Devtools would beinstalled under?/opt/centos/devtoolset-1.1.
To Use?gcc?from?devtoolset, use the following command. This command would launch a new shell, wherein all environment variables is automatically set to Use?devtools.
$ SCL Enable devtoolset-1.1 bash
$ gcc--version
GCC (gcc) 4.7.2 20121015 (Red Hat 4.7.2-5)
Alternatively, you can explicitly define the following variables to Use?devtools.
Export CC=/OPT/CENTOS/DEVTOOLSET-1.1/ROOT/USR/BIN/GCC
Export Cpp=/opt/centos/devtoolset-1.1/root/usr/bin/cpp
Export cxx=/opt/centos/devtoolset-1.1/root/usr/bin/c++
??
From
Find problem solving problem: How to upgrade gcc on CentOS