cent 6系に無理やりdevtools-3入れる
gccのバージョンを4.9系にしないとC++の正規表現ライブラリが使えないので、バージョンアップ。そのためにはScientific Linux Cern 6 repositoryを使う。
cd /etc/yum.repos.d
wget http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo
本家のレポジトリだと重いので、インストールする前にslc6-scl.repoの中のbaseurlを適当なミラーに書き換えておく。ここでは理研ミラー使わせてもらった。
baseurl=http://ftp.riken.jp/Linux/cern/scl/slc6X/$basearch/yum/scl/
んで、インストール
yum -y --nogpgcheck install devtoolset-3-gcc devtoolset-3-gcc-c++
あとは
scl enable devtoolset-3 bash
をたたけばOK。
$ gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ scl enable devtoolset-3 bash $ gcc --version gcc (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
いい加減面倒なので、OSごとcent 7にするか…。
参考
devtoolset-2の話:scl enable devtoolset-2 bash - My Life as a Mock Quant