As of writing this (March 31, 2014), the version of Boost included in Debian Wheezy is 1.49. This is a bit problematic for me, as some very useful things are included in more recent versions (e.g., better syslog event handlers in the logging library). One of the problems I sometimes face with Boost is in remembering how to compile/install it. The Boost “Getting Started” pages basically say that most of Boost is header-only and doesn’t need to be compiled, but that there are 16 libraries that need to be compiled. Unfortunately, it stops there. So, this is for future reference and for others that may find it useful. How does one compile/install all of Boost?

The first thing we need to do is make sure all the dependencies for Boost are available. Using your favorite package manager, make sure you have the following. (Depending on your distro, they may be named slightly differently. But, make sure you have the dev version when required.)

- build-essential
- g++
- python-dev
- autotools-dev
- libicu-dev
- libbz2-dev

Next, download and decompress the Boost version that you’d like. I’m using 1.55.

$ wget http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
$ gunzip boost_1_55_0.tar.gz
$ tar xvf boost_1_55_0.tar

Finally, as root, build and install. Since I’m placing the installation in /usr/local (as is the default), I’m not issuing any prefix declaration here. There are really just two commands:

(root) $ ./bootstrap.sh
(root) $ ./b2 --with=all -j 2 install

The -j n option will build the libraries using n threads, so this can be changed based on your system. After completion, you should be able to include and link against the required headers and libraries.h


2 Comments

  1. VulcanTheTerrible
    Posted June 13, 2014 at 19:58 | Permalink

    Thanks! Got it off the ground on Wheezy

  2. Posted January 2, 2017 at 11:06 | Permalink

    This blog is really interesting, but why it is on 19th place in google’s search results.
    It deserves to be in top 5. Many bloggers think that seo is dead in 2016, but it is not true.
    There is sneaky method to reach google’s top 5 that not many people know.
    Simply search for: pandatsor’s tools

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">