I just found out that RedHat provides this "Developer toolset" which allows me to install (and of course use) the most up-to-date gcc-4.7.2. I use it on Centos, but the process is the same.
Once installed, you can start a new bash session with this toolset enabled by issuing:
scl enable devtoolset-1.1 bash
That works all right. Now, could I somehow add this to my bashrc since this actually starts a new bash session? Or should I better place it inside my makefiles to avoid starting a new bash session. Would there be a way to issue this within a makefile?
Red Hat Software Collections is a prescribed set of content intended for use in Red Hat Enterprise Linux production environments.
Software collections or SCL - is a collection of 'add-on" software packages. Software Collections give you the power to build, install, and use multiple versions of software on the same system, without affecting system-side installed packages.
I wrote a blog post on this subject because it started to come up a lot. If you would like to read it, you can find it here: http://developerblog.redhat.com/2014/03/19/permanently-enable-a-software-collection/
tl;dr
you can source /opt/rh/devtoolset-1.1/enable
in your .bashrc or, for somewhat better solution you can include:
source /opt/rh/devtoolset-1.1/enable
export X_SCLS="`scl enable devtoolset-1.1 'echo $X_SCLS'`"
But definitely check out the post for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With