jfritz42 jfritz42 - 1 month ago 6
C++ Question

How to build/deploy RPM(s) for new Boost version on RHEL?

I work in a team of 10+ developers and we use RHEL 6.4 for both our development machines as well as our servers (where our software is deployed).

RHEL 6.4 comes with Boost 1.41 but I need fixes that come in at least 1.47. I'd like to upgrade to latest (currently 1.56).

It is not as easy as downloading the source and building/installing, because:

  • I want everyone on our team (including future team members) to have easy access to the new Boost version. Asking everyone to build/install is a lot of trouble and there might be inconsistencies.

  • Our software is deployed as RPMs that get installed on hundreds of servers (and the servers are owned by other teams and outside of our control). These are also running RHEL 6.4. Our software would (presumably) need to run-time link to the new Boost shared libraries on all these machines.

To make matters uglier, RedHat seems to have their own proprietary way of bundling/packaging the Boost software/libraries into RPMs. They don't have just one RPM but a series of smaller RPMs:

$ yum list installed|grep boost
boost.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-date-time.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-devel.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-filesystem.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-graph.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-iostreams.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-program-options.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-python.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-regex.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-serialization.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-signals.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-system.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-test.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-thread.x86_64 1.41.0-11.el6_1.2 @Workstation
boost-wave.x86_64 1.41.0-11.el6_1.2 @Workstation

I have been Googling and can't find an easy solution. I am also somewhat of a newbie when it comes to RPMs.

How can I build/deploy Boost 1.56 as RPM(s) in our situation?


Building RPMS in of itself is a skill. Run, don't walk, to the nearest store, and buy a copy of the "Maximum RPM" book, 2nd edition, which will teach you how to build RPMS.

Building RPMS is not exactly rocket science, but it's not something that can be explained a couple of paragraphs, here. I am not very familiar with boost, but a quick check of the packages listed above: on Fedora all of them are built from the same source RPM. It's a single source package, and, as part of building RPMs, the RPM build script automatically chops it up into multiple packages, like the one you see. So, it's really a single package, and the RPM build script.

It might be worth a shot for you to try to rebuild Fedora's boost package from its source RPM, and see if it works for you. The latest boost package for Fedora appears to be 1.54, so 1.56 isn't even built yet. At least not yet on Fedora 20. 21 beta might have a newer boost; I don't know.

Trying to rebuild from source RPMS is worth a shot. It won't take long, it'll either work, or not. Go get a copy of boost-1.54.0-9.fc20.src.rpm from Fedora's download repository; download it on your RHEL box, and try to see what happens:

[user@localhost]$ rpmbuild --rebuild boost-1.54.0-9.fc20.src.rpm

You'll know fairly quick whether it'll work, or not.

But even if this work, you're not of the woods yet. Boost is not binary ABI compatible between releases. Meaning that, as soon as you update your boost packages, you are almost guaranteed to break any existing applications you have, including RHEL packages that link against boost; and rpm may or may not be able to catch that. So, if you get that far, prepare for the possibility of having to rebuild a bunch of other non-boost RPMS, too.