Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can have the meta RPM "devtoolset-4-toolchain" installed to get all the devtoolset GCC related RPMs installed:

ksa@iris02 $ rpm -q --requires devtoolset-4-toolchain
devtoolset-4-runtime  
devtoolset-4-gcc  
devtoolset-4-gcc-c++  
devtoolset-4-gcc-gfortran  
devtoolset-4-binutils  
devtoolset-4-gdb  
devtoolset-4-strace  
devtoolset-4-dwz  
devtoolset-4-elfutils  
devtoolset-4-memstomp  
devtoolset-4-ltrace  

 

To use the newer versions in a bash script after the RPMs are installed:

...

#-----------------------------------------

...

# to enable newer gcc from software collections:

...

# (replace devtoolset-4 with current version of devtoolset)

...

#-----------------------------------------

...

if [ -x /opt/rh/devtoolset-4/enable ]; then

...

  echo Enabling GCC from Developer Toolset

...

  source /opt/rh/devtoolset-4/enable

...

fi

 

To use the newer versions on the command line after the RPMs are installed:

...

user@host $ scl enable devtoolset-4 bash

...

bash-4.1$ gcc --version

...

gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)

...

bash-4.1$ exit

...

ksa@iris02 $ scl enable devtoolset-4 'gcc --version'

...

gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)

...

Copyright (C) 2015 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.

 

The Red Hat Developer Toolset (DTS) is intended to give developers access to updated compilers and tools for C and C++ development.

...