makefilecentosredhatdevtoolsetredhat-dts

Enabling "Software collections". RedHat developer toolset


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?


Solution

  • 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.