How to build and install Boost.Log?

Update: Boost.Log is now part of the entire set of Boost Libraries since v1.54. The instructions on how to build Boost Log is available here: Configuring and building the Boost Log library

The following instructions are valid only for v1.0 of Boost Log.

This is a brain dump of the method followed by me to install Boost.Log. One important note before you build and install boost libraries: Make sure you have installed a threading library like pthreads. Most package managers should have them.

Now lets get on to the build steps:

  1. If you have installed Boost already from source, then its fine continue to next step. Otherwise download it from here (this link is for latest version as of this writing: v1.45). Extract the boost libraries at say: /opt. We can build the libraries along with Boost.Log.
  2. Download Boost.Log from Sourceforge.
  3. Extract the Boost.Log source archive in a folder - say /opt.
  4. Copy the log folder in: /opt/boost-log-1.0/boost to your boost source directory /opt/Boost_1_45_0/boost (assuming that you have extracted it in /opt).
  5. Copy the log folder in: /opt/boost-log-1.0/libs to your boost libs directory /opt/Boost_1_45_0/libs (assuming that you have extracted it in /opt).
  6. If you haven't installed other Boost libraries, then follow these steps:
  • cd /opt/Boost_1_45_0
  • .bootstrap.sh --show-libraries --- this will list all the libraries that will be built and installed. You should see log listed as part of it.
  • .bootstrap.sh --with-libraries=all --prefix=/usr/local --includedir=/usr/local/include --libdir=/usr/local/lib
  • ./bjam install

Finally make sure $LD_LIBRARY_PATH has /usr/local/lib (the path specified in bjam to install the built libraries) as part of it. If it is not edit your ~/.bashrc and add the following:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

About these ads

4 thoughts on “How to build and install Boost.Log?

  1. Thanks for this article. It was very helpfull.
    One more comment resulting from compilation of boost log v1.1 with boost v.1.51. When compiling with MSVC 2008 the boost log library fails on file libs\log\src\text_file_backend.cpp due to use of deprecated syntax. To fix it change line 1197 from get_generic_category() to generic_category().

  2. Pingback: Boost Version 1.52.0 and Boost.Log Version 2 « KK's Space

  3. Pingback: Boost Log not being recognized by cmake | BlogoSfera

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s