This is the method I followed to install Boost.Log in my Linux box. 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.
Here are the build steps:
If you have installed Boost already from source, then its fine continue to next step. Otherwise download it from here (preferably the latest version (v1.46). I used v1.45). Extract the boost libraries at say: /opt
. We can build the libraries along with Boost.Log.
- Download Boost.Log from Sourceforge.
- Extract the Boost.Log source archive in a folder – say
/opt
. 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
). - 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
). 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 seelog
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