Setting up Django and Python 2.7 on Red Hat Enterprise 6 the easy way

Recently, I needed to get Django installed with Python 2.7 on Red Hat Enterprise Linux 6. As this is not a directly supported activity, I wanted to document how I went about it. As you might imagine, the generally expected method for install would be to grab the Python 2.7 source tree and then build it. Obviously, that can be a lot of work; is not particularly repeatable; and, potentially, exposes you to more security flaws. As a result, I decided to try to leverage a “new’ish” technology developed (in the open) by Red Hat called Software Collections. An in depth discussion of Software Collections is for another post, for now we just need to know that Software Collections are rpms that contain all (or most) of their supporting libraries, install under /opt, are updatable through yum, and, the core software collections code (scl-utils) is supported by Red Hat. A number of collections have been created and released by the community at http://bit.ly/fedora-scl.

OK, getting started. I created a new VM using a RHEL 6.3 image on an instance of RHOS (Red Hat Open Stack),

Continue reading “Setting up Django and Python 2.7 on Red Hat Enterprise 6 the easy way”

Share

Array allocation in C++

This technical article covers a subtlety in C++ array allocation and how we changed the GNU C++ compiler to deal with it properly. When a programmer writes

T *p = new T[3];

the C++ compiler allocates room for at least three copies of objects of type T on the heap. These objects require 3 * sizeof(T) bytes. For this example, assume sizeof(T) is 12, then it is straightforward to allocate 36 bytes (for example, using malloc). But what happens if the array length is 3937053355 (or 16909515400900422315 on a 64-bit architecture)? Then 47244640260 bytes are required. This number cannot be expressed in 32-bits, so if 32-bit arithmetic is used to perform the multiplication, the result is a mere 4. Unless special care is taken, a C++ implementation will provide a pointer to a heap area that is much too small for holding the requested number of objects (4 bytes instead of 47244640260 bytes).

Continue reading “Array allocation in C++”

Share

7 ways to improve your application’s performance with the new Developer Toolset 1.1 release

Are you missing out on opportunities to increase your applications’ performance? As an application developer building on Red Hat Enterprise Linux, you invest a lot of time and effort into making your applications compelling and useful for your users. You probably also want to see good performance. But beyond good design, careful algorithm selection and compiler optimizations, what can a developer use to boost their application performance?

1. The latest GCC release and associated tools

The very first thing a Red Hat Enterprise Linux developer should be aware of is the availability of Red Hat Developer Toolset. I described the content and architecture of this new offering from Red Hat in my last blog post. Developer Toolset 1.x gives you the gcc-4.7 toolchain, which, at the time of writing, is the current upstream major release.

Continue reading “7 ways to improve your application’s performance with the new Developer Toolset 1.1 release”

Share

Ruby on Rails 3.2 on Red Hat Enterprise Linux 6 with Software Collections

While Red Hat Enterprise Linux is known for its stability and flexibility, you might not think of it first when looking for the latest version of your web application framework. If you’re a developer working with Ruby and Ruby on Rails, you probably want to take advantage of their new features. Sure, you can use RVM, but sometimes you just want to get supported system packages.

Software Collections (often abbreviated as SCL) allows you to run more recent versions of software than what ships with your current version of Red Hat Enterprise Linux. This article will show you how to start development of a Rails 3.2 application running on Ruby 1.9.3 – all on RHEL 6, using only RPM packages, alongside your default Ruby installation. This tutorial assumes that you are familiar with Ruby on Rails basics, such as creating a new application and using bundler. It is also beneficial (although not necessary) to understand how Software Collections work in general.

Continue reading “Ruby on Rails 3.2 on Red Hat Enterprise Linux 6 with Software Collections”

Share

Software Collections on Red Hat Enterprise Linux

Did you ever wish you had newer versions of the software on your Red Hat Enterprise Linux machines? You are probably not alone. Providing new versions of software in rpm is hard, because rpm supports only one version installed on your computer at a time. Multiple versions on one machine can conflict with each other or create unpredictable behaviour in applications that you might not have considered dependencies.

Last year, we developed Software Collections to allow you to install newer versions of software in rpm safely into /opt and switch between new and old releases. This allows your Red Hat Enterprise Linux system applications to continue to run with the old version, while new apps can work with the new version. A good example of this is Python; many essential packages are written in Python. How can you update to the latest release of Python without causing half your system to break? Through Software Collections, you can install a newer version of Python – for example python-3.3 – into /opt avoiding conflicts in files and strange behaviour of apps that depend on an older version of Python.

I have multiple collections on my RHEL-6 machine for testing purposes. Let’s see all of them:

[root@rhel-6-marcela ~]# scl -l
perl514
perl516
python33
ruby193

How can you install those collections?
These collections are located as testing repositories on various “people pages.” You can add their repository into your /etc/yum.repos.d/:

Continue reading “Software Collections on Red Hat Enterprise Linux”

Share

Red Hat Developer Toolset 1.1 Now Available through Developer-focused Subscriptions

Today Red Hat announces the general availability of version 1.1 of Red Hat Developer Toolset through Red Hat Enterprise Linux Developer Subscriptions. For developers, having ready access to the latest, stable development tools is key to taking advantage of open source innovation. Red Hat Developer Toolset 1.1 bridges development agility with production stability by delivering the latest stable versions of essential C and C++ development tools. By employing Red Hat Developer Toolset, organizations can significantly increase developer productivity and improve deployment times.

Red Hat Developer Toolset helps to reduce development and deployment time by allowing users to compile once for multiple versions of Red Hat Enterprise Linux and more easily diagnose and debug applications in development. Using Red Hat Developer Toolset, software developers can develop applications that run on multiple versions of Red Hat Enterprise Linux. Applications developed on Red Hat Enterprise Linux 5 can run on both Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6.

Red Hat Developer Toolset 1.1 delivers the following significant enhancements:

Continue reading “Red Hat Developer Toolset 1.1 Now Available through Developer-focused Subscriptions”

Share

Is your C++ development team missing out? Developer Toolset: newer tools on and for multiple RHEL releases

Wouldn’t it be nice if your software development team could use one common set of development tools based on the latest, stable upstream versions for your Red Hat Enterprise Linux development? Think of all the extra years of open source innovation – the features, optimizations and new standards support it would allow your team to build into your products. That would be great, wouldn’t it?

Fortunately, this is already available to you today, and in this blog post I’ll explain how it works and how you can get it. Red Hat Developer Toolset provides a set of additional tools installed in parallel with those delivered as part of Red Hat Enterprise Linux itself. Currently featuring the GCC C/C++ compiler and GDB debugger and backed up by Red Hat’s solid customer support, Red Hat Developer Toolset 1.0 is a great way to unlock performance in your team and your software very easily.

And if you’re already a Red Hat Developer Program subscriber, you can install the tools right now. The Red Hat Developer Toolset version 1.1 Beta, released in October 2012,
showcased a good number of additional performance analysis tools. We’re just getting started with this new offering and have plans to include other tools in the future.

Continue reading “Is your C++ development team missing out? Developer Toolset: newer tools on and for multiple RHEL releases”

Share

Welcome to the Red Hat developer blog!

I’m writing this first entry at about 30,000 feet on my way back from Red Hat’s North American Partner Conference in San Diego, California. It’s rather appropriate to be typing this out at that altitude, as that is the way I felt for the entire conference after having the opportunity to meet with some amazing ISV, Systems Integrator, VAR and Solution Builder partners who have been building some incredibly powerful solutions using Red Hat technologies. The consistent theme across all of these conversations was making sure that the developers within these organizations had a deep relationship with Red Hat, an understanding of our technology and architecture roadmap as well as the chance to provide more input into how we can all work together.

Continue reading Welcome to the Red Hat developer blog!

Share