Alexander Afanasyev | 6dbacda | 2012-10-23 17:20:18 -0700 | [diff] [blame] | 1 | .. _boost-custom-install: |
| 2 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 3 | .. Installing boost libraries |
| 4 | .. ++++++++++++++++++++++++++ |
Alexander Afanasyev | 7099ffb | 2012-10-16 20:42:11 -0700 | [diff] [blame] | 5 | |
| 6 | Normally, 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 | |
| 16 | However, after the following steps you may still not able to use ndnSIM. |
| 17 | |
| 18 | Common pitfalls |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 19 | ^^^^^^^^^^^^^^^ |
Alexander Afanasyev | 7099ffb | 2012-10-16 20:42:11 -0700 | [diff] [blame] | 20 | |
| 21 | The common pitfalls is with boost iostreams library, which is failed to build because of missing bzip2 library. |
| 22 | This 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 | |
| 29 | Afte 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 | |
| 33 | Alternatively, 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 | |
| 37 | And then compiling and installing boost without custom compilation flags:: |
| 38 | |
| 39 | ./b2 --prefix=$BOOSTDIR |
| 40 | |
| 41 | |
| 42 | Compiling NS-3 with custom boost libraries |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 43 | ++++++++++++++++++++++++++++++++++++++++++ |
Alexander Afanasyev | 7099ffb | 2012-10-16 20:42:11 -0700 | [diff] [blame] | 44 | |
| 45 | The 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. |