Friday, June 3, 2016

Modern Development Tools in CentOS 7 using Software Collections

I currently use CentOS 7 as my Linux Development environment for two major reasons:
  1. Personal - RedHat was the first Linux distribution I installed/used (RedHat 4.2 if you are curious – and I don’t mean RHEL 4) so while I have frequently dabbled with other distribution such as Gentoo and Ubuntu, it’s always been my “Linux Home”. After RedHat “transitioned” into Fedora Core I started using RHEL 3 professionally before moving to cAos/CentOS.
  2. Life Cycle - Once a server is built (even more so with fleets of servers that need to be binary compatible) it’s very difficult to implement a forklift OS upgrade. Therefore, it is very common to see a physical server run the same distribution version for its entire deployment, and with virtualization often the length of the application deployment! While Ubuntu has more recently tried to address this shortcoming with Long Term Support (LTS) versions, this is one of the major reasons RHEL/CentOS is so popular with its 9-10 year support life cycles.
One major drawbacks to a long life cycle is (to put it mildly) a rather stale developer toolchains. This is often cited as a major reason for the rise in popularity of Ubuntu with developers. Fortunately, RedHat finally addressed this shortcoming with RHEL a few years back with the introduction of Software Collections (SCL) and Developer Toolset. SLC enables newer software versions to be installed and used on RHEL/CentOS (and here is the important part) without disturbing the default systems tools therefore preserving compatibility. The great news is SCL is available for CentOS 7 providing access to the modern Developer Toolset!

Getting Started with Software Collections & Developer ToolSet under CentOS 7


SCL is already included in CentOS extras, so it is a single command to install and enable:
sudo yum install centos-release-scl
Next, there are currently two available versions of Developer ToolSet v3 and v4 for CentOS 7. Version 3 includes GCC 4.9 and version 4 includes GCC 5.2. If you decide to “live on the edge” with GCC 5.2, be aware that GCC 5.1+ uses a new ABI that might cause compatibility issues, one possible options is gcc’s -D_GLIBCXX_USE_CXX11_ABI=0 flag if you need to link to systems libraries that weren’t compiled with GCC 5.1+. In this example I’m using version 3 and I’m currently working with some source code that isn’t yet gcc 5 compatible.
sudo yum install devtoolset-3-toolchain
Alright, you are ready to use the SCL version of gcc and other tools! To enabled and test just type:
scl enable devtoolset-3 bash
gcc --version
gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
ld.gold --version
GNU gold (version 2.24) 1.11
When you are done, it’s easy to just exit the SCL shell and return to the default systems tools.
exit
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
ld.gold --version GNU gold (version 2.23.52.0.1-55.el7 20130226) 1.11
This is just a small glimpse of the power of Software Collections, so I encourage you to visit their website at https://www.softwarecollections.org to learn even more!


7 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete