blob: a08a8d97d02ae67cea76c5f41f0eb6a6d845115c [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 Afanasyev11381c22015-01-19 16:07:46 -08008 **My ubuntu/redhat/freebsd have an old version of boost libraries. How can I get the latest one?**
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -07009
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080010.. _Installing boost libraries:
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070011
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080012Installing boost libraries to ``/usr/local``
13^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -070014
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080015.. role:: red
16
Alexander Afanasyev326410e2013-03-09 20:39:11 -080017.. note::
Alexander Afanasyev11381c22015-01-19 16:07:46 -080018 **The following instructions are for those who want to install latest version of boost libraries** :red:`and has root access`.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080019
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000020The following commands would install the latest version of boost libraries (at the time of
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -080021writing, version 1.62) ot ``/usr/local``, assuming you have a root access to your machine. If
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000022you don't have root access, please refer to section :ref:`Installing boost libraries to a
23non-privileged location`.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080024
25.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000026 If you are using Ubuntu, make sure that you have installed ``libbz2-dev``, otherwise not
27 all libraries required by ndnSIM will be installed (see :ref:`Common pitfalls`)
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080028
29.. code-block:: bash
30 :linenos:
31
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -080032 wget http://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.bz2
33 tar jxf boost_1_62_0.tar.bz2
34 cd boost_1_62_0
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080035 ./bootstrap.sh
36 sudo ./b2 --prefix=/usr/local install
37
38
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000039The following commands should allow compilation and run of NS-3 simulations with custom install
40of boost libraries:
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080041
42.. code-block:: bash
43 :linenos:
44
45 cd <ns-3>
46 ./waf configure --boost-includes=/usr/local/include --boost-libs=/usr/local/lib --enable-examples
47 ./waf
48 LD_LIBRARY_PATH=/usr/local/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
49
50.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000051 ``LD_LIBRARY_PATH=/usr/local/lib`` is necessary on Linux platform in order for the dynamic
52 linker to find libraries installed in a location different from one of the folders
53 specified in ``/etc/ld.so.conf``.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080054
55.. _Installing boost libraries to a non-privileged location:
56
57Installing boost libraries to a non-privileged location
58^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
Alexander Afanasyev326410e2013-03-09 20:39:11 -080060.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000061 **Follow these general instructions if you are trying to installboost libraries to a
62 non-privileged location** :red:`(i.e., you do not have root access),` **but something is
63 going wrong.**
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080064
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000065Normally, to compile and install boost libraries in non-privileged mode, you would need to
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -080066issue following commands (e.g., for boost version 1.62.0):
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080067
68.. code-block:: bash
69 :linenos:
70
71 export BOOSTDIR=/home/non-privileged-user/boost
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -080072 wget http://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.bz2
73 tar jxf boost_1_62_0.tar.bz2
74 cd boost_1_62_0
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080075 ./bootstrap.sh
76 ./b2 --prefix=$BOOSTDIR install
77
78However, after the following steps you may still not able to use ndnSIM.
79
80.. _Common pitfalls:
81
82Common pitfalls
83^^^^^^^^^^^^^^^
84
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000085The common pitfalls is with the **boost iostreams** library, which is required by ndnSIM, but
86failed to build because of the missing bzip2 library. This problem can be easily fixed by
87downloading and installing bzip2 library, e.g., using the following steps:
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080088
89.. code-block:: bash
90 :linenos:
91
92 wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
93 tar zxf bzip2-1.0.6.tar.gz
94 cd bzip2-1.0.6
95 make PREFIX=$BOOSTDIR CFLAGS="-fPIC -O2 -g" install
96
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000097Afte bzip2 library is installed, you may recompile and reinstall boost libraries using custom
98compilation flags::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080099
100 ./b2 --prefix=$BOOSTDIR cxxflags=-I$BOOSTDIR/include linkflags=-L$BOOSTDIR/lib install
101
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000102Alternatively, you can solve this particular problem by installing development package for
103bzip2 library (:red:`if you have root access`). For example, on Ubuntu 12.04 it would be the
104following command::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800105
106 sudo apt-get install libbz2-dev
107
108And then compiling and installing boost without custom compilation flags::
109
110 ./b2 --prefix=$BOOSTDIR
111
112
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000113The following commands should allow compilation and run of NS-3 simulations with custom install
114of boost libraries::
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800115
116 cd <ns-3>
117 ./waf configure --boost-includes=$BOOSTDIR/include --boost-libs=$BOOSTDIR/lib --enable-examples --enable-ndn-plugins=topology,mobility
118 ./waf
119 LD_LIBRARY_PATH=$BOOSTDIR/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
120
121.. note::
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000122 ``LD_LIBRARY_PATH=$BOOSTDIR/lib`` is necessary on Linux platform in order for the dynamic
123 linker to find libraries installed in a location different from one of the folders
124 specified in /etc/ld.so.conf.
Alexander Afanasyev26b558b2012-12-13 11:39:46 -0800125
126
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700127
128Visualizer problems
129-------------------
130
131.. topic:: Visualizer module is not working
132
133 Every time I'm trying to run visualizer, I get the following error::
134
135 Waf: Entering directory `/ndnSIM/ns-3/build'
136 Could not find a task generator for the name 'ns3-visualizer'..
137
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +0000138Something is wrong with your python bindings and python bindings dependencies. Please follow
139the :ref:`requirements` section that lists what should be installed in order to run visualizer.
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700140
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -0800141.. _Problems with the gtk python module on macOS:
Spyridon Mastorakisc33e2882015-01-20 21:45:44 -0800142
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -0800143Problems with the gtk python module on macOS
144--------------------------------------------
Spyridon Mastorakisc33e2882015-01-20 21:45:44 -0800145
146.. topic:: ./waf configure got stuck during the gtk module check
147
148 When running ``./waf configure``, the process freezes at the stage of detecting gtk module::
149
150 ...
151 Checking for 'sqlite3' : yes
152 Checking for header linux/if_tun.h : not found
153 Checking for python module 'gtk' :
154
155If ``./waf configure`` on OSX got stuck during the gtk python module check, it most likely
156means that something is wrong with X11 required by this module. You can try to reinstall X11
Xinyu Mafc8956c2019-04-08 23:17:52 -0700157(`XQuartz <https://xquartz.macosforge.org>`_) or configure NS-3 without python bindings (``./waf
Spyridon Mastorakisc33e2882015-01-20 21:45:44 -0800158configure --disable-python``). Note that disabling python bindings will also disable the
159visualizer module.
160
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700161Code questions
162--------------
163
164.. topic:: Failing a link between nodes
165
166 How can I fail a link between to NDN nodes?
167
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800168Refer to :ref:`Link Control Helper`.
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700169
spirosmastorakis2c9c0052016-10-31 13:51:14 -0700170.. topic:: Network-level NACKs
171
172 How the current version of ndnSIM handles network-level NACKs?
173
Spyridon Mastorakisacd5e1a2016-12-07 14:34:25 -0800174ndnSIM 2.3 includes full support of NDNLPv2 and, thus, can be
175used to simulate network-level NACKs across simulation nodes.
spirosmastorakis2c9c0052016-10-31 13:51:14 -0700176
Alexander Afanasyev6dbacda2012-10-23 17:20:18 -0700177General questions
178-----------------
179
180.. topic:: Errors/bugs reporting
181
182 I found an error in the documentation / bug in the code. What should I do?
183
Xinyu Mafc8956c2019-04-08 23:17:52 -0700184Please submit a bug report on `redmine <https://redmine.named-data.net/projects/ndnsim?jump=welcome>`_,
185or tell us about the error on `our mailing list <https://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_ .