Alexander Afanasyev | abaab52 | 2014-04-30 20:42:11 -0700 | [diff] [blame] | 1 | .. _Getting Started with ndn-cxx: |
| 2 | |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 3 | Getting started with ndn-cxx |
| 4 | ============================ |
| 5 | |
| 6 | Supported platforms |
| 7 | ------------------- |
| 8 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 9 | ndn-cxx uses continuous integration and has been tested on the following platforms: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 10 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 11 | - Ubuntu 16.04 (amd64) |
| 12 | - Ubuntu 18.04 (amd64, armhf, i386) |
Alexander Afanasyev | cf8ffd4 | 2019-12-29 17:58:53 -0800 | [diff] [blame] | 13 | - Ubuntu 19.10 (amd64) |
Eric Newberry | 935d7fe | 2017-10-29 15:09:36 -0700 | [diff] [blame] | 14 | - macOS 10.13 |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 15 | - macOS 10.14 |
Alexander Afanasyev | cf8ffd4 | 2019-12-29 17:58:53 -0800 | [diff] [blame] | 16 | - macOS 10.15 |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 17 | - CentOS 8 |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 18 | |
| 19 | ndn-cxx is known to work on the following platforms, although they are not officially |
| 20 | supported: |
| 21 | |
Davide Pesavento | 7c4ad51 | 2018-04-28 15:20:11 -0400 | [diff] [blame] | 22 | - Debian >= 9 |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 23 | - Fedora >= 29 |
Ivan Yeo | ba1a4a9 | 2015-01-11 00:45:57 -0800 | [diff] [blame] | 24 | - Gentoo Linux |
Davide Pesavento | 7c4ad51 | 2018-04-28 15:20:11 -0400 | [diff] [blame] | 25 | - Raspbian >= 2017-08-16 |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 26 | - FreeBSD >= 11.3 |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 27 | |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 28 | Prerequisites |
| 29 | ------------- |
| 30 | |
| 31 | Required: |
| 32 | ~~~~~~~~~ |
| 33 | |
Davide Pesavento | ca660f1 | 2018-06-16 14:01:51 -0400 | [diff] [blame] | 34 | - GCC >= 5.3, or clang >= 3.6 |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 35 | - Python >= 3.5 |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 36 | - ``pkg-config`` |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 37 | - Boost >= 1.58 |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 38 | - OpenSSL >= 1.0.2 |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 39 | - SQLite 3.x |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 40 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 41 | Following are the detailed steps for each platform to install the compiler and all necessary |
| 42 | development tools and libraries that are required to build ndn-cxx from source. |
| 43 | |
| 44 | - Ubuntu |
| 45 | |
| 46 | In a terminal, enter:: |
| 47 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 48 | sudo apt install g++ pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 49 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 50 | - CentOS and Fedora |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 51 | |
| 52 | In a terminal, enter:: |
| 53 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 54 | sudo dnf install gcc-c++ pkgconf-pkg-config python3 boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 55 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 56 | - macOS |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 57 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 58 | * Install either Xcode (from the App Store) or the Command Line Tools |
| 59 | (with ``xcode-select --install``) |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 60 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 61 | * If using Homebrew (recommended), enter the following in a terminal:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 62 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 63 | brew install boost openssl pkg-config |
Alexander Afanasyev | 67cb75c | 2016-06-15 12:34:58 -0700 | [diff] [blame] | 64 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 65 | .. note:: |
Alexander Afanasyev | 67cb75c | 2016-06-15 12:34:58 -0700 | [diff] [blame] | 66 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 67 | If a major OS upgrade is performed after installing the dependencies |
| 68 | with Homebrew, remember to reinstall all packages. |
Alexander Afanasyev | 67cb75c | 2016-06-15 12:34:58 -0700 | [diff] [blame] | 69 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 70 | - FreeBSD |
| 71 | |
| 72 | In a terminal, enter:: |
| 73 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 74 | sudo pkg install pkgconf python3 boost-libs openssl sqlite3 |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 75 | |
| 76 | Optional: |
| 77 | ~~~~~~~~~ |
| 78 | |
| 79 | To build tutorials, manpages, and API documentation the following |
| 80 | dependencies need to be installed: |
| 81 | |
| 82 | - ``doxygen`` |
| 83 | - ``graphviz`` |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 84 | - ``sphinx`` |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 85 | - ``sphinxcontrib-doxylink`` |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 86 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 87 | The following lists the steps to install these prerequisites on various common platforms. |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 88 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 89 | - On Ubuntu:: |
Alexander Afanasyev | 9b0e114 | 2014-05-08 00:17:34 -0700 | [diff] [blame] | 90 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 91 | sudo apt install doxygen graphviz python3-pip |
| 92 | sudo pip3 install sphinx sphinxcontrib-doxylink |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 93 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 94 | - On CentOS and Fedora:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 95 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 96 | sudo dnf config-manager --enable PowerTools # on CentOS only |
| 97 | sudo dnf install doxygen graphviz python3-pip |
| 98 | pip3 install --user sphinx sphinxcontrib-doxylink |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 99 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 100 | - On macOS:: |
| 101 | |
| 102 | brew install doxygen graphviz |
| 103 | sudo pip install sphinx sphinxcontrib-doxylink |
| 104 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 105 | - On FreeBSD:: |
| 106 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 107 | sudo pkg install doxygen graphviz py37-sphinx |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 108 | |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 109 | |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 110 | .. _build: |
| 111 | |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 112 | Build |
| 113 | ----- |
| 114 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 115 | .. note:: |
| 116 | These are instructions for regular builds of ndn-cxx (release mode). |
| 117 | To do development of ndn-cxx code itself, see "Development build" below. |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 118 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 119 | To build in a terminal, change directory to the ndn-cxx root, then enter:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 120 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 121 | ./waf configure # on CentOS, add --without-pch |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 122 | ./waf |
| 123 | sudo ./waf install |
| 124 | |
Spyridon Mastorakis | 5ebfda6 | 2015-07-21 20:57:40 -0700 | [diff] [blame] | 125 | By default, only the shared version of ndn-cxx library is built. To build the static library, |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 126 | use ``--enable-static`` option for ``./waf configure`` command:: |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 127 | |
Spyridon Mastorakis | 5ebfda6 | 2015-07-21 20:57:40 -0700 | [diff] [blame] | 128 | ./waf configure --enable-static |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 129 | |
Spyridon Mastorakis | 5ebfda6 | 2015-07-21 20:57:40 -0700 | [diff] [blame] | 130 | To disable build of the shared library and build only the static library, use additional |
| 131 | ``--disable-shared`` option. Note that at least one version of the library needs to be |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 132 | enabled. |
| 133 | |
| 134 | :: |
| 135 | |
Spyridon Mastorakis | 5ebfda6 | 2015-07-21 20:57:40 -0700 | [diff] [blame] | 136 | ./waf configure --enable-static --disable-shared |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 137 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 138 | After the shared library is installed, on Linux it is also necessary to run:: |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 139 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 140 | sudo ldconfig |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 141 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 142 | .. note:: |
| 143 | When the library is installed in a non-standard path (in general: not in ``/usr/lib`` |
| 144 | or ``/usr/local/lib``; on some Linux distros including Fedora: not in ``/usr/lib``), |
| 145 | additional actions may be necessary. |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 146 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 147 | The installation path should be added to ``/etc/ld.so.conf`` (or in |
| 148 | ``/etc/ld.so.conf.d``) **before** running ``sudo ldconfig``. For example:: |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 149 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 150 | echo /usr/local/lib | sudo tee /etc/ld.so.conf.d/ndn-cxx.conf |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 151 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 152 | Alternatively, the ``LD_LIBRARY_PATH`` environment variable can be set to point to |
| 153 | the installation directory of the shared library:: |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 154 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 155 | export LD_LIBRARY_PATH=/usr/local/lib |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 156 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 157 | The ``./waf install`` command installs the following files: |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 158 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 159 | - ``<LIBPATH>/libndn-cxx.a``: static NDN C++ library (if enabled). |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 160 | - ``<LIBPATH>/libndn-cxx.so``, ``<LIBPATH>/libndn-cxx.so.<VERSION>`` (on Linux), |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 161 | ``<LIBPATH>/libndn-cxx.dylib``, ``<LIBPATH>/libndn-cxx.<VERSION>.dylib`` (on macOS): |
| 162 | shared NDN C++ library (if enabled). |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 163 | - ``<LIBPATH>/pkgconfig/libndn-cxx.pc``: pkgconfig file storing all |
| 164 | neccessary flags to build against the library. For example, if |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 165 | pkg-config or pkgconf package is installed and ``PKG_CONFIG_PATH`` is |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 166 | configured properly (or ``<LIBPATH>/pkgconfig`` is a default path), |
| 167 | ``pkgconfig --libs --clflags libndn-cxx`` will return all necessary |
| 168 | compile and link flags for the library. |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 169 | - ``<BINPATH>/ndnsec``: tool to manage NDN keys and certificates. |
| 170 | - ``<BINPATH>/ndnsec-*``: convenience aliases for ``ndnsec`` tools. |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 171 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 172 | If configured with tests (``./waf configure --with-tests``), the above |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 173 | commands will also produce: |
| 174 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 175 | - ``build/unit-tests``: a unit test binary for the library. |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 176 | |
Junxiao Shi | e04bd83 | 2014-11-29 23:02:38 -0700 | [diff] [blame] | 177 | 1.5GB available memory per CPU core is necessary for efficient compilation. |
| 178 | On a multi-core machine with less than 1.5GB available memory per CPU core, |
| 179 | limit the objects being compiled in parallel with ``./waf -jN`` where N is the amount |
| 180 | of available memory divided by 1.5GB (eg. ``./waf -j1`` for 1.5GB memory), |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 181 | which should usually avoid memory thrashing and result in faster compilation. |
Junxiao Shi | e04bd83 | 2014-11-29 23:02:38 -0700 | [diff] [blame] | 182 | |
Alexander Afanasyev | c8bcd45 | 2014-05-12 17:58:47 -0700 | [diff] [blame] | 183 | Build with examples |
| 184 | ------------------- |
| 185 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 186 | By default, examples in ``examples/`` are not built. To enable them, use the |
| 187 | ``--with-examples`` configure option:: |
Alexander Afanasyev | c8bcd45 | 2014-05-12 17:58:47 -0700 | [diff] [blame] | 188 | |
| 189 | ./waf configure --with-examples |
| 190 | ./waf |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 191 | sudo ./waf install |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 192 | sudo ldconfig # on Linux only |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 193 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 194 | To run examples:: |
Alexander Afanasyev | c8bcd45 | 2014-05-12 17:58:47 -0700 | [diff] [blame] | 195 | |
| 196 | # trivial producer app |
| 197 | ./build/examples/producer |
| 198 | |
| 199 | # trivial consumer app |
| 200 | ./build/examples/consumer |
| 201 | |
| 202 | # trivial consumer app with timers |
| 203 | ./build/examples/consumer-with-timer |
| 204 | |
| 205 | If you want to test out a sample application, just create a ``.cpp`` file in ``examples/`` |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 206 | folder and it will be compiled on the next run on ``./waf``. For example:: |
Alexander Afanasyev | c8bcd45 | 2014-05-12 17:58:47 -0700 | [diff] [blame] | 207 | |
| 208 | cp examples/consumer.cpp examples/my-new-consumer-app.cpp |
| 209 | ./waf |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 210 | sudo ./waf install |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 211 | sudo ldconfig # on Linux only |
Alexander Afanasyev | c8bcd45 | 2014-05-12 17:58:47 -0700 | [diff] [blame] | 212 | ./build/examples/my-new-consumer-app |
| 213 | |
Alexander Afanasyev | 9b0e114 | 2014-05-08 00:17:34 -0700 | [diff] [blame] | 214 | Debug symbols |
| 215 | ~~~~~~~~~~~~~ |
| 216 | |
| 217 | The default compiler flags enable debug symbols to be included in binaries (i.e., ``-g`` |
| 218 | flag for ``./waf configure`` and ``-g3`` for ``./waf configure --debug``). This |
| 219 | potentially allows more meaningful debugging information if your application crashes. |
| 220 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 221 | The default build flags can easily be overridden:: |
Alexander Afanasyev | 9b0e114 | 2014-05-08 00:17:34 -0700 | [diff] [blame] | 222 | |
| 223 | CXXFLAGS="-O2" ./waf configure --prefix=/usr --sysconfdir=/etc |
| 224 | ./waf |
| 225 | sudo ./waf install |
| 226 | |
Alexander Afanasyev | 7ed2943 | 2015-06-05 18:01:16 -0700 | [diff] [blame] | 227 | |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 228 | Documentation |
| 229 | ------------- |
| 230 | |
| 231 | ndn-cxx tutorials and API documentation can be built using the following |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 232 | commands:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 233 | |
| 234 | # Full set of documentation (tutorials + API) in build/docs |
| 235 | ./waf docs |
| 236 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 237 | # Only tutorials in build/docs |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 238 | ./waf sphinx |
| 239 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 240 | # Only API docs in build/docs/doxygen |
Sepehr Abdous | 4fc6db2 | 2018-08-22 15:26:06 -0700 | [diff] [blame] | 241 | ./waf doxygen |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 242 | |
| 243 | Manpages are automatically created and installed during the normal build |
| 244 | process (e.g., during ``./waf`` and ``./waf install``), if |
| 245 | ``python-sphinx`` module is detected during ``./waf configure`` stage. |
| 246 | By default, manpages are installed into ``${PREFIX}/share/man`` (where |
| 247 | default value for ``PREFIX`` is ``/usr/local``). This location can be |
| 248 | changed during ``./waf configure`` stage using ``--prefix``, |
| 249 | ``--datarootdir``, or ``--mandir`` options. |
| 250 | |
| 251 | For more details, refer to ``./waf --help``. |
| 252 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 253 | |
| 254 | Development build |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 255 | ----------------- |
| 256 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 257 | The following is the suggested configure command for development builds:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 258 | |
| 259 | ./waf configure --debug --with-tests |
| 260 | ./waf |
| 261 | sudo ./waf install |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 262 | sudo ldconfig # on Linux only |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 263 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 264 | In the development build most compiler optimizations are disabled by |
| 265 | default and all warnings are treated as errors. The default behavior can |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 266 | be overridden by setting ``CXXFLAGS`` environment variable before |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 267 | running ``./waf configure``:: |
Alexander Afanasyev | c5452c5 | 2014-04-29 17:21:51 -0700 | [diff] [blame] | 268 | |
| 269 | CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests |
| 270 | ... |
Alexander Afanasyev | 5946ed1 | 2015-01-19 23:41:39 -0800 | [diff] [blame] | 271 | |
Alexander Afanasyev | 5946ed1 | 2015-01-19 23:41:39 -0800 | [diff] [blame] | 272 | |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 273 | Customizing the compiler |
| 274 | ------------------------ |
| 275 | |
| 276 | To choose a custom C++ compiler for building ndn-cxx, set the ``CXX`` environment |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 277 | variable to point to the compiler binary. For example, to build with clang on |
Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 278 | Linux, use the following:: |
Alexander Afanasyev | 5946ed1 | 2015-01-19 23:41:39 -0800 | [diff] [blame] | 279 | |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 280 | CXX=clang++ ./waf configure |