blob: 17a9564cba170649a811afd04a05cc052dbbc675 [file] [log] [blame]
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -07001.. _boost-custom-install:
2
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -08003.. Installing boost libraries
4.. ++++++++++++++++++++++++++
Alexander Afanasyev7099ffb2012-10-16 20:42:11 -07005
6Normally, to compile and install boost libraries in non-privileged mode, you would need to issue following commands (e.g., for boost version 1.51.0)::
7
8 export BOOSTDIR=/home/non-privileged-user/boost
9
10 wget http://downloads.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.bz2
11 tar jxf boost_1_51_0.tar.bz2
12 cd boost_1_51_0
13 ./bootstrap.sh
14 ./b2 --prefix=$BOOSTDIR install
15
16However, after the following steps you may still not able to use ndnSIM.
17
18Common pitfalls
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080019^^^^^^^^^^^^^^^
Alexander Afanasyev7099ffb2012-10-16 20:42:11 -070020
21The common pitfalls is with boost iostreams library, which is failed to build because of missing bzip2 library.
22This problem can be easily fixed by downloading and installing bzip2 library, e.g., using the following steps::
23
24 wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
25 tar zxf bzip2-1.0.6.tar.gz
26 cd bzip2-1.0.6
27 make PREFIX=$BOOSTDIR CFLAGS="-fPIC -O2 -g" install
28
29Afte bzip2 library is installed, you may recompile and reinstall boost libraries using custom compilation flags::
30
31 ./b2 --prefix=$BOOSTDIR cxxflags=-I$BOOSTDIR/include linkflags=-L$BOOSTDIR/lib install
32
33Alternatively, you can solve this particular problem by installing development package for bzip2 library (if you have root access). For example, on Ubuntu 12.04 it would be the following command::
34
35 sudo apt-get install libbz2-dev
36
37And then compiling and installing boost without custom compilation flags::
38
39 ./b2 --prefix=$BOOSTDIR
40
41
42Compiling NS-3 with custom boost libraries
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080043++++++++++++++++++++++++++++++++++++++++++
Alexander Afanasyev7099ffb2012-10-16 20:42:11 -070044
45The following commands should allow compilation and run of NS-3 simulations with custom install of boost libraries::
46
47 cd <ns-3>
48 ./waf configure --boost-includes=$BOOSTDIR/include --boost-libs=$BOOSTDIR/lib --enable-examples --enable-ndn-plugins=topology,mobility
49 LD_LIBRARY_PATH=$BOOSTDIR/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
50
51.. note::
52 `LD_LIBRARY_PATH=$BOOSTDIR/lib` is necessary on Linux platform in order for the dynamic linker to find libraries installed in a location different from one of the folders specified in /etc/ld.so.conf.