Skip to content

How to build boost thread (on Linux)

jslick edited this page Mar 20, 2012 · 2 revisions

Boost thread version 1.42 (and possibly later versions) is not sufficient for MatrixVM because it does not work with GCC c++0x . Boost thread version 1.48 is known to work; earlier versions may work as well. If your distribution does not provide a new enough version, you may have to build your own version of boost thread in order to build MatrixVM.

  1. Download boost thread from http://www.boost.org/users/download/

  2. Extract the file.

cd /tmp

tar xvf ~/Downloads/boost_1_49_0.tar.bz2

  1. Change directory to extracted contents cd boost_1_49_0

  2. Bootstrap

sh bootstrap.sh --prefix=$HOME/boost --with-libraries=thread

Here, I chose to only build boost-thread, instead of the whole suite.

Depending on the format of the archive (like .7z), you may get a permissions error. If this happens, you probably need to:

chmod +x tools/build/v2/engine/build.sh and try the bootstrap command again.

  1. Install

./b2 install

You should get output similar to:

...updated 9666 targets...

at the end

  1. Build matrixvm using the custom installation

cd /path/to/matrixvm

mkdir build

pushd build

cmake -D CMAKE_CXX_FLAGS="-I $HOME/boost/include" -D CMAKE_LIBRARY_PATH="$HOME/boost/lib" ..

make -j4