Enabling "Software collections". RedHat developer toolset

5k views Asked by At

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?

2

There are 2 answers

0
1angdon On BEST ANSWER

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.

0
GM. On

Check the URL

http://preilly.me/2013/05/28/redhat-developer-toolset-1-1/

for more information, for example how to set the CC, CPP, CXX environment variables. Or check

http://people.centos.org/tru/devtools-1.1/

for the devtool-1.1 repository for CentOS.