Building Autobahn|Cpp

Notes

  • The library code is written in standard C++ 11. Target toolchains currently include clang and gcc. Support for MSVC is tracked on this issue.
  • While C++ 11 includes std::future in the standard library, this lacks continuations. boost::future.then allows attaching continuations to futures as outlined in the proposal here. This feature will come to standard C++, but probably not before 2015 (see C++ Standardisation Roadmap)
  • Support for when_all and when_any as described in above proposal depends on Boost 1.56 (upcoming release as of 31/03/2014) or higher.
  • The library and example programs were tested and developed with clang 3.4, libc++ and Boost trunk/1.56 on an Ubuntu 13.10 x86-64 bit system. It also works with gcc 4.8, libstdc++ and Boost trunk/1.56. Your mileage with other versions of the former may vary, but we accept PRs ;)

Build tools

Install some libs and build tools:

sudo apt-get install libbz2-dev libssl-dev ruby libtool autoconf scons

clang

Install clang and libc++:

sudo apt-get install clang-3.4 libc++1 libc++-dev

Boost

To build Boost 1.55 (current release) from sources, get source code package for the latest Boost release from here and

cd $HOME
tar xvjf Downloads/boost_1_55_0.tar.bz2
cd boost_1_55_0/
./bootstrap.sh
./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" -j 4

..note:: Note: The -j 4 option will allow use of 4 cores for building.

To build with GCC instead of clang:

./b2 toolset=gcc -j 4

To build Boost trunk (needed for when_all, when_any)

cd $HOME
git clone --recursive git@github.com:boostorg/boost.git
cd boost/
./bootstrap.sh
./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" -j 4

MsgPack-C

Get MsgPack-C and build with clang:

cd $HOME
git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
./bootstrap
CXX=`which clang++` CC=`which clang` CXXFLAGS="-std=c++11 -stdlib=libc++" \
   LDFLAGS="-stdlib=libc++" ./configure --prefix=$HOME/msgpack_clang
make
make install

To build with GCC instead of clang:

./configure --prefix=$HOME/msgpack_gcc
Reactive Manifesto: We are reactive banner