build: Fix compilation on Ubuntu platform and add work-around for ndn-cxx regression

Note that on Ubuntu 12.04, either boost libraries or compiler needs to be upgraded.

Change-Id: I33f1089f961f99abf3d1803bf833e76ff7fb528d
Refs: #2379, #2380, #2382, #2381, #2383
diff --git a/docs/source/faq.rst b/docs/source/faq.rst
index 068afb0..2a83682 100644
--- a/docs/source/faq.rst
+++ b/docs/source/faq.rst
@@ -5,7 +5,8 @@
 ---------------
 
 .. note::
-    **My ubuntu/redhat/freebsd have an old version of boost libraries.  How can I get the latest one?**
+    **My ubuntu/redhat/freebsd have an old version of boost libraries.  How can I get the
+     latest one?**
 
 .. _Installing boost libraries:
 
@@ -15,25 +16,30 @@
 .. role:: red
 
 .. note::
-    **The following instructions are for those who want to install latest version of boost libraries** :red:`and has root access`.
+    **The following instructions are for those who want to install latest version of boost
+     libraries** :red:`and has root access`.
 
-The following commands would install the latest version of boost libraries (at the time of writing, version 1.53) ot ``/usr/local``, assuming you have a root access to your machine.
-If you don't have root access, please refer to section :ref:`Installing boost libraries to a non-privileged location`.
+The following commands would install the latest version of boost libraries (at the time of
+writing, version 1.53) ot ``/usr/local``, assuming you have a root access to your machine.  If
+you don't have root access, please refer to section :ref:`Installing boost libraries to a
+non-privileged location`.
 
 .. note::
-    If you are using Ubuntyu, make sure that you have installed ``libbz2-dev``, otherwise not all libraries required by ndnSIM will be installed (see :ref:`Common pitfalls`)
+    If you are using Ubuntu, make sure that you have installed ``libbz2-dev``, otherwise not
+    all libraries required by ndnSIM will be installed (see :ref:`Common pitfalls`)
 
 .. code-block:: bash
    :linenos:
 
-    wget http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2
-    tar jxf boost_1_53_0.tar.bz2
-    cd boost_1_53_0
+    wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
+    tar jxf boost_1_57_0.tar.bz2
+    cd boost_1_57_0
     ./bootstrap.sh
     sudo ./b2 --prefix=/usr/local install
 
 
-The following commands should allow compilation and run of NS-3 simulations with custom install of boost libraries:
+The following commands should allow compilation and run of NS-3 simulations with custom install
+of boost libraries:
 
 .. code-block:: bash
    :linenos:
@@ -44,7 +50,9 @@
     LD_LIBRARY_PATH=/usr/local/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
 
 .. note::
-    `LD_LIBRARY_PATH=/usr/local/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.
+    ``LD_LIBRARY_PATH=/usr/local/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``.
 
 .. _Installing boost libraries to a non-privileged location:
 
@@ -52,17 +60,20 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. note::
-    **Follow these general instructions if you are trying to installboost libraries to a non-privileged location** :red:`(i.e., you do not have root access),` **but something is going wrong.**
+    **Follow these general instructions if you are trying to installboost libraries to a
+    non-privileged location** :red:`(i.e., you do not have root access),` **but something is
+    going wrong.**
 
-Normally, to compile and install boost libraries in non-privileged mode, you would need to issue following commands (e.g., for boost version 1.53.0):
+Normally, to compile and install boost libraries in non-privileged mode, you would need to
+issue following commands (e.g., for boost version 1.57.0):
 
 .. code-block:: bash
    :linenos:
 
     export BOOSTDIR=/home/non-privileged-user/boost
-    wget http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2
-    tar jxf boost_1_53_0.tar.bz2
-    cd boost_1_53_0
+    wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
+    tar jxf boost_1_57_0.tar.bz2
+    cd boost_1_57_0
     ./bootstrap.sh
     ./b2 --prefix=$BOOSTDIR install
 
@@ -73,8 +84,9 @@
 Common pitfalls
 ^^^^^^^^^^^^^^^
 
-The common pitfalls is with the **boost iostreams** library, which is required by ndnSIM, but failed to build because of the missing bzip2 library.
-This problem can be easily fixed by downloading and installing bzip2 library, e.g., using the following steps:
+The common pitfalls is with the **boost iostreams** library, which is required by ndnSIM, but
+failed to build because of the missing bzip2 library.  This problem can be easily fixed by
+downloading and installing bzip2 library, e.g., using the following steps:
 
 .. code-block:: bash
    :linenos:
@@ -84,11 +96,14 @@
     cd bzip2-1.0.6
     make PREFIX=$BOOSTDIR CFLAGS="-fPIC -O2 -g" install
 
-Afte bzip2 library is installed, you may recompile and reinstall boost libraries using custom compilation flags::
+Afte bzip2 library is installed, you may recompile and reinstall boost libraries using custom
+compilation flags::
 
     ./b2 --prefix=$BOOSTDIR cxxflags=-I$BOOSTDIR/include linkflags=-L$BOOSTDIR/lib install
 
-Alternatively, you can solve this particular problem by installing development package for bzip2 library (:red:`if you have root access`).  For example, on Ubuntu 12.04 it would be the following command::
+Alternatively, you can solve this particular problem by installing development package for
+bzip2 library (:red:`if you have root access`).  For example, on Ubuntu 12.04 it would be the
+following command::
 
     sudo apt-get install libbz2-dev
 
@@ -97,7 +112,8 @@
     ./b2 --prefix=$BOOSTDIR
 
 
-The following commands should allow compilation and run of NS-3 simulations with custom install of boost libraries::
+The following commands should allow compilation and run of NS-3 simulations with custom install
+of boost libraries::
 
     cd <ns-3>
     ./waf configure --boost-includes=$BOOSTDIR/include --boost-libs=$BOOSTDIR/lib --enable-examples --enable-ndn-plugins=topology,mobility
@@ -105,7 +121,9 @@
     LD_LIBRARY_PATH=$BOOSTDIR/lib NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
 
 .. note::
-    `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.
+    ``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.
 
 
 
@@ -119,8 +137,8 @@
         Waf: Entering directory `/ndnSIM/ns-3/build'
         Could not find a task generator for the name 'ns3-visualizer'..
 
-Something is wrong with your python bindings and python bindings dependencies.
-Please follow the :ref:`requirements` section that lists what should be installed in order to run visualizer.
+Something is wrong with your python bindings and python bindings dependencies.  Please follow
+the :ref:`requirements` section that lists what should be installed in order to run visualizer.
 
 Code questions
 --------------
diff --git a/docs/source/getting-started.rst b/docs/source/getting-started.rst
index 23ff20d..0f0ee5a 100644
--- a/docs/source/getting-started.rst
+++ b/docs/source/getting-started.rst
@@ -4,9 +4,30 @@
 Portability
 ------------
 
-ndnSIM has been successfully compiled and used under Ubuntu Linux 12.04 (only with boost
-libraries **1.48**), 14.04 (default version of boost), OS X 10.10 (Xcode 6.1.1, macports boost
-1.56-1.57).
+ndnSIM 2.0 has been successfully compiled and used on following platforms:
+
+- Ubuntu Linux 12.04 (see the note)
+- Ubuntu Linux 14.04
+- OS X 10.10
+
+.. note::
+    ndnSIM is currently cannot be compiled on Ubuntu Linux 12.04 with the packaged boost
+    libraries (there is an `issue with boost 1.48 and gcc 4.6
+    <https://svn.boost.org/trac/boost/ticket/6153>`_).  It is still possible to compile ndnSIM
+    on this platform, but either compiler or boost libraries (or both) need to get upgraded.
+
+    More recent version of boost can be installed from "Boost C++ Libraries" team PPA::
+
+        sudo apt-get install python-software-properties
+        sudo add-apt-repository ppa:boost-latest/ppa
+        sudo apt-get update
+        sudo apt-get install libboost1.55-all-dev
+
+        # add  --boost-libs=/usr/lib/x86_64-linux-gnu  to ./waf configure for ndn-cxx and ns3
+        # ./waf configure --boost-libs=/usr/lib/x86_64-linux-gnu
+
+    Make sure that all other version of boost libraries (``-dev`` packages) are removed,
+    otherwise compilation will fail.
 
 .. _requirements:
 
@@ -19,19 +40,12 @@
 .. role:: red
 
 .. note::
-   :red:`!!! ndn-cxx and ndnSIM requires boost version at least 1.48.` Many linux distribution
+   :red:`!!! ndnSIM requires boost version at least 1.49.` Many linux distribution
    (Fedora 16, 17 at the time of this writing) ship an old version of boost, making it
    impossible to compile ndnSIM out-of-the-box.  Please install the latest version, following
    :ref:`these simple instructions <Installing boost libraries>`.
 
 .. note::
-   :red:`For Ubuntu 12.04` Ubuntu 12.04 ships with two versions of boost libraries and it is
-   known that if both are installed, then compilation of ndnSIM will most likely fail.  Please
-   install ``libboost1.48-dev-all`` package and uninstall ``libboost-dev-all``.  If you want to
-   install the latest version of boost libraries, then uninstall both ``libboost1.48-dev-all``
-   and ``libboost-dev-all``, so the libraries do not interfere with each other.
-
-.. note::
    !!! If you do not have root permissions to install boost, you can install it in your home
    folder.  However, you need to be make sure that `libboost_iostreams` library is successfully
    compiled and is installed.  Please refer to :ref:`the following example <Installing boost
@@ -43,7 +57,7 @@
 dependencies should be installed.  For example, in order to run `visualizer`_ module, the
 following should be installed:
 
-   * For Ubuntu (tested on Ubuntu 14.04, should work on later versions as well):
+   * For Ubuntu:
 
        .. code-block:: bash
 
@@ -51,7 +65,7 @@
            sudo apt-get install python-pygoocanvas python-gnome2
            sudo apt-get install python-gnomedesktop python-rsvg ipython
 
-   * For Fedora (tested on Fedora 16):
+   * For Fedora:
 
        .. code-block:: bash
 
@@ -62,7 +76,7 @@
            sudo yum install python-pip
            sudo easy_install pygraphviz
 
-   * For MacOS (macports):
+   * For OS X with MacPorts:
 
        .. code-block:: bash
 
@@ -93,6 +107,9 @@
     mkdir ndnSIM
     cd ndnSIM
     git clone https://github.com/named-data/ndn-cxx.git ndn-cxx
+    cd ndn-cxx
+    git checkout 81a6c5dea60cea97c60dab0d78576c0d3b4e29ed
+    cd ..
     git clone https://github.com/cawka/ns-3-dev-ndnSIM.git ns-3
     git clone https://github.com/cawka/pybindgen.git pybindgen
     git clone https://github.com/named-data/ndnSIM.git ns-3/src/ndnSIM