Alexander Afanasyev | bd5b67a | 2014-09-02 16:06:21 -0700 | [diff] [blame^] | 1 | .. _NDNS Installation Instructions: |
| 2 | |
| 3 | NDNS Installation Instructions |
| 4 | ============================== |
| 5 | |
| 6 | Prerequisites |
| 7 | ------------- |
| 8 | |
| 9 | - Install the `ndn-cxx library <http://named-data.net/doc/ndn-cxx/current/INSTALL.html>`_ |
| 10 | and its requirements |
| 11 | |
| 12 | To build manpages and API documentation: |
| 13 | |
| 14 | - ``doxygen`` |
| 15 | - ``graphviz`` |
| 16 | - ``python-sphinx`` |
| 17 | |
| 18 | On OS X 10.8 and 10.9 with MacPorts: |
| 19 | |
| 20 | :: |
| 21 | |
| 22 | sudo port install doxygen graphviz py27-sphinx sphinx_select |
| 23 | sudo port select sphinx py27-sphinx |
| 24 | |
| 25 | On Ubuntu >= 12.04: |
| 26 | |
| 27 | :: |
| 28 | |
| 29 | sudo apt-get install doxygen graphviz python-sphinx |
| 30 | |
| 31 | Build |
| 32 | ----- |
| 33 | |
| 34 | The following basic commands should be used to build NDNS on Ubuntu: |
| 35 | |
| 36 | :: |
| 37 | |
| 38 | ./waf configure |
| 39 | ./waf |
| 40 | sudo ./waf install |
| 41 | |
| 42 | Some platforms, such as OS X with MacPorts and certain Linux distributions (e.g., Fedora) |
| 43 | require setting the ``PKG_CONFIG_PATH`` before running configure. |
| 44 | |
| 45 | For example, on OS X with MacPorts (assuming the default ``/opt/local`` MacPorts path): |
| 46 | |
| 47 | :: |
| 48 | |
| 49 | export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH |
| 50 | ./waf configure |
| 51 | ./waf |
| 52 | sudo ./waf install |
| 53 | |
| 54 | or some Linux distributions: |
| 55 | |
| 56 | :: |
| 57 | |
| 58 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:$PKG_CONFIG_PATH |
| 59 | ./waf configure |
| 60 | ./waf |
| 61 | sudo ./waf install |
| 62 | |
| 63 | |
| 64 | Refer to ``./waf --help`` for more options that can be used during ``configure`` stage and |
| 65 | how to properly configure and run NFD. |
| 66 | |
| 67 | Debug symbols |
| 68 | +++++++++++++ |
| 69 | |
| 70 | The default compiler flags enable debug symbols to be included in binaries. This |
| 71 | potentially allows more meaningful debugging if NDNS or other tools happen to crash. |
| 72 | |
| 73 | If it is undesirable, default flags can be easily overridden. The following example shows |
| 74 | how to completely disable debug symbols and configure NDNS to be installed into ``/usr`` |
| 75 | with configuration in ``/etc`` folder. |
| 76 | |
| 77 | :: |
| 78 | |
| 79 | CXXFLAGS="-O2" ./waf configure --prefix=/usr --sysconfdir=/etc |
| 80 | ./waf |
| 81 | sudo ./waf install |
| 82 | |
| 83 | Building documentation |
| 84 | ---------------------- |
| 85 | |
| 86 | NDNS tutorials and API documentation can be built using the following commands: |
| 87 | |
| 88 | :: |
| 89 | |
| 90 | # Full set of documentation (tutorials + API) in build/docs |
| 91 | ./waf docs |
| 92 | |
| 93 | # Only tutorials in `build/docs` |
| 94 | ./waf sphinx |
| 95 | |
| 96 | # Only API docs in `build/docs/doxygen` |
| 97 | ./waf doxgyen |
| 98 | |
| 99 | |
| 100 | Manpages are automatically created and installed during the normal build process |
| 101 | (e.g., during ``./waf`` and ``./waf install``), if ``python-sphinx`` module is detected |
| 102 | during ``./waf configure`` stage. By default, manpages are installed into |
| 103 | ``${PREFIX}/share/man`` (where default value for ``PREFIX`` is ``/usr/local``). This |
| 104 | location can be changed during ``./waf configure`` stage using ``--prefix``, |
| 105 | ``--datarootdir``, or ``--mandir`` options. |
| 106 | |
| 107 | For more details, refer to ``./waf --help``. |