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