blob: 2a83682cc5f46ab0ac17f3b6a810e5ea674f643e [file] [log] [blame]
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -07001FAQ
2===
3
4Boost libraries
5---------------
6
Alexander Afanasyev326410e2013-03-09 20:39:11 -08007.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00008 **My ubuntu/redhat/freebsd have an old version of boost libraries. How can I get the
9 latest one?**
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070010
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080011.. _Installing boost libraries:
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070012
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080013Installing boost libraries to ``/usr/local``
14^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070015
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080016.. role:: red
17
Alexander Afanasyev326410e2013-03-09 20:39:11 -080018.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000019 **The following instructions are for those who want to install latest version of boost
20 libraries** :red:`and has root access`.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080021
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000022The following commands would install the latest version of boost libraries (at the time of
23writing, version 1.53) ot ``/usr/local``, assuming you have a root access to your machine. If
24you don't have root access, please refer to section :ref:`Installing boost libraries to a
25non-privileged location`.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080026
27.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000028 If you are using Ubuntu, make sure that you have installed ``libbz2-dev``, otherwise not
29 all libraries required by ndnSIM will be installed (see :ref:`Common pitfalls`)
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080030
31.. code-block:: bash
32 :linenos:
33
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000034 wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
35 tar jxf boost_1_57_0.tar.bz2
36 cd boost_1_57_0
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080037 ./bootstrap.sh
38 sudo ./b2 --prefix=/usr/local install
39
40
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000041The following commands should allow compilation and run of NS-3 simulations with custom install
42of boost libraries:
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080043
44.. code-block:: bash
45 :linenos:
46
47 cd <ns-3>
48 ./waf configure --boost-includes=/usr/local/include --boost-libs=/usr/local/lib --enable-examples
49 ./waf
50 LD_LIBRARY_PATH=/usr/local/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
51
52.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000053 ``LD_LIBRARY_PATH=/usr/local/lib`` is necessary on Linux platform in order for the dynamic
54 linker to find libraries installed in a location different from one of the folders
55 specified in ``/etc/ld.so.conf``.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080056
57.. _Installing boost libraries to a non-privileged location:
58
59Installing boost libraries to a non-privileged location
60^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
Alexander Afanasyev326410e2013-03-09 20:39:11 -080062.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000063 **Follow these general instructions if you are trying to installboost libraries to a
64 non-privileged location** :red:`(i.e., you do not have root access),` **but something is
65 going wrong.**
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080066
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000067Normally, to compile and install boost libraries in non-privileged mode, you would need to
68issue following commands (e.g., for boost version 1.57.0):
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080069
70.. code-block:: bash
71 :linenos:
72
73 export BOOSTDIR=/home/non-privileged-user/boost
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000074 wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
75 tar jxf boost_1_57_0.tar.bz2
76 cd boost_1_57_0
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080077 ./bootstrap.sh
78 ./b2 --prefix=$BOOSTDIR install
79
80However, after the following steps you may still not able to use ndnSIM.
81
82.. _Common pitfalls:
83
84Common pitfalls
85^^^^^^^^^^^^^^^
86
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000087The common pitfalls is with the **boost iostreams** library, which is required by ndnSIM, but
88failed to build because of the missing bzip2 library. This problem can be easily fixed by
89downloading and installing bzip2 library, e.g., using the following steps:
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080090
91.. code-block:: bash
92 :linenos:
93
94 wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
95 tar zxf bzip2-1.0.6.tar.gz
96 cd bzip2-1.0.6
97 make PREFIX=$BOOSTDIR CFLAGS="-fPIC -O2 -g" install
98
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000099Afte bzip2 library is installed, you may recompile and reinstall boost libraries using custom
100compilation flags::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800101
102 ./b2 --prefix=$BOOSTDIR cxxflags=-I$BOOSTDIR/include linkflags=-L$BOOSTDIR/lib install
103
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000104Alternatively, you can solve this particular problem by installing development package for
105bzip2 library (:red:`if you have root access`). For example, on Ubuntu 12.04 it would be the
106following command::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800107
108 sudo apt-get install libbz2-dev
109
110And then compiling and installing boost without custom compilation flags::
111
112 ./b2 --prefix=$BOOSTDIR
113
114
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000115The following commands should allow compilation and run of NS-3 simulations with custom install
116of boost libraries::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800117
118 cd <ns-3>
119 ./waf configure --boost-includes=$BOOSTDIR/include --boost-libs=$BOOSTDIR/lib --enable-examples --enable-ndn-plugins=topology,mobility
120 ./waf
121 LD_LIBRARY_PATH=$BOOSTDIR/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
122
123.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000124 ``LD_LIBRARY_PATH=$BOOSTDIR/lib`` is necessary on Linux platform in order for the dynamic
125 linker to find libraries installed in a location different from one of the folders
126 specified in /etc/ld.so.conf.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800127
128
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700129
130Visualizer problems
131-------------------
132
133.. topic:: Visualizer module is not working
134
135 Every time I'm trying to run visualizer, I get the following error::
136
137 Waf: Entering directory `/ndnSIM/ns-3/build'
138 Could not find a task generator for the name 'ns3-visualizer'..
139
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000140Something is wrong with your python bindings and python bindings dependencies. Please follow
141the :ref:`requirements` section that lists what should be installed in order to run visualizer.
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700142
143Code questions
144--------------
145
146.. topic:: Failing a link between nodes
147
148 How can I fail a link between to NDN nodes?
149
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800150Refer to :ref:`Link Control Helper`.
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700151
152General questions
153-----------------
154
155.. topic:: Errors/bugs reporting
156
157 I found an error in the documentation / bug in the code. What should I do?
158
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800159Please submit a bug report on `redmine <http://redmine.named-data.net/projects/ndnsim?jump=welcome>`_,
160or tell us about the error on `our mailing list
161<http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_ .