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 | |
| 9 | ndn-cxx uses continuous integration and has been tested on the following |
| 10 | platforms: |
| 11 | |
| 12 | - Ubuntu 12.04 (64-bit and 32-bit) |
| 13 | - Ubuntu 13.10 (64-bit and 32-bit) |
| 14 | - OS X 10.8 |
| 15 | - OS X 10.9 |
| 16 | |
| 17 | ndn-cxx is known to work on the following platforms, although they are not officially |
| 18 | supported: |
| 19 | |
| 20 | - Ubuntu 14.04 |
| 21 | - Fedora >= 20 |
| 22 | - FreeBSD >= 10.0 |
| 23 | - Raspberry Pi |
| 24 | |
| 25 | Prerequisites |
| 26 | ------------- |
| 27 | |
| 28 | Required: |
| 29 | ~~~~~~~~~ |
| 30 | |
| 31 | - ``python`` >= 2.6 |
| 32 | - ``libcrypto`` |
| 33 | - ``libsqlite3`` |
| 34 | - ``libcrypto++`` |
| 35 | - ``pkg-config`` |
| 36 | - Boost libraries >= 1.48 |
| 37 | - OSX Security framework (on OSX platform only) |
| 38 | |
| 39 | Following are the detailed steps for each platform to install the compiler, all necessary |
| 40 | development tools and libraries, and ndn-cxx prerequisites. |
| 41 | |
| 42 | - OS X |
| 43 | |
| 44 | Install Xcode. In Xcode Preferences > Downloads, install "Command |
| 45 | Line Tools". |
| 46 | |
| 47 | If using MacPorts, dependencies can be installed using the following |
| 48 | commands:: |
| 49 | |
| 50 | sudo port install pkgconfig boost sqlite3 libcryptopp |
| 51 | |
| 52 | - Ubuntu 12.04, Ubuntu 13.10 |
| 53 | |
| 54 | In a terminal, enter:: |
| 55 | |
| 56 | sudo apt-get install build-essential |
| 57 | sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev |
| 58 | |
| 59 | # For Ubuntu 12.04 |
| 60 | sudo apt-get install libboost1.48-all-dev |
| 61 | |
| 62 | # For Ubuntu 13.10 |
| 63 | sudo apt-get install libboost-all-dev |
| 64 | |
| 65 | - Fedora >=20 |
| 66 | |
| 67 | In a terminal, enter:: |
| 68 | |
| 69 | sudo yum install gcc-g++ git |
| 70 | sudo yum install openssl-devel sqlite-devel cryptopp-devel boost-devel |
| 71 | |
| 72 | Optional: |
| 73 | ~~~~~~~~~ |
| 74 | |
| 75 | To build tutorials, manpages, and API documentation the following |
| 76 | dependencies need to be installed: |
| 77 | |
| 78 | - ``doxygen`` |
| 79 | - ``graphviz`` |
| 80 | - ``python-sphinx`` |
| 81 | |
| 82 | The following lists steps for common platforms to install these |
| 83 | prerequisites: |
| 84 | |
| 85 | - On OS X 10.8 and 10.9 with MacPorts:: |
| 86 | |
| 87 | sudo port install doxygen graphviz py27-sphinx sphinx_select |
| 88 | sudo port select sphinx py27-sphinx |
| 89 | |
| 90 | - On Ubuntu >= 12.04:: |
| 91 | |
| 92 | sudo apt-get install doxygen graphviz python-sphinx |
| 93 | |
| 94 | - On Fedora >= 20:: |
| 95 | |
| 96 | sudp yum install doxygen graphviz python-sphinx |
| 97 | |
| 98 | Build |
| 99 | ----- |
| 100 | |
| 101 | (These are instructions to build ndn-cxx. To do development of ndn-cxx |
| 102 | code and update the build system, see Development.) |
| 103 | |
| 104 | To build in a terminal, change directory to the ndn-cxx root. Enter: |
| 105 | |
| 106 | :: |
| 107 | |
| 108 | ./waf configure |
| 109 | ./waf |
| 110 | sudo ./waf install |
| 111 | |
| 112 | This builds and installs the following items: |
| 113 | |
| 114 | - ``<LIBPATH>/libndn-cxx.a``: static NDN C++ library |
| 115 | - ``<LIBPATH>/pkgconfig/libndn-cxx.pc``: pkgconfig file storing all |
| 116 | neccessary flags to build against the library. For example, if |
| 117 | pkgconfig or pkgconf package is installed and ``PKG_CONFIG_PATH`` is |
| 118 | configured properly (or ``<LIBPATH>/pkgconfig`` is a default path), |
| 119 | ``pkgconfig --libs --clflags libndn-cxx`` will return all necessary |
| 120 | compile and link flags for the library. |
| 121 | - ``<BINPATH>/tlvdump``: a simple tool to dump contents of |
| 122 | TLV-formatted data |
| 123 | - ``<BINPATH>/ndncatchunks3``: a simplified equivalent to ndncatchunks2 |
| 124 | in NDNx package |
| 125 | - ``<BINPATH>/ndnputchunks3``: a simplified equivalent to ndnputchunks2 |
| 126 | in NDNx package |
| 127 | - ``<BINPATH>/ndnsec``: tool to manage NDN keys and certificates |
| 128 | - ``<BINPATH>/ndnsec-*``: convenience scripts for ``ndnsec`` tools |
| 129 | |
| 130 | If configured with tests: ``./waf configure --with-tests``), the above |
| 131 | commands will also produce: |
| 132 | |
| 133 | - ``build/unit-tests``: A unit test binary for the library |
| 134 | |
| 135 | Documentation |
| 136 | ------------- |
| 137 | |
| 138 | ndn-cxx tutorials and API documentation can be built using the following |
| 139 | commands: |
| 140 | |
| 141 | :: |
| 142 | |
| 143 | # Full set of documentation (tutorials + API) in build/docs |
| 144 | ./waf docs |
| 145 | |
| 146 | # Only tutorials in `build/docs` |
| 147 | ./waf sphinx |
| 148 | |
| 149 | # Only API docs in `build/docs/doxygen` |
| 150 | ./waf doxgyen |
| 151 | |
| 152 | Manpages are automatically created and installed during the normal build |
| 153 | process (e.g., during ``./waf`` and ``./waf install``), if |
| 154 | ``python-sphinx`` module is detected during ``./waf configure`` stage. |
| 155 | By default, manpages are installed into ``${PREFIX}/share/man`` (where |
| 156 | default value for ``PREFIX`` is ``/usr/local``). This location can be |
| 157 | changed during ``./waf configure`` stage using ``--prefix``, |
| 158 | ``--datarootdir``, or ``--mandir`` options. |
| 159 | |
| 160 | For more details, refer to ``./waf --help``. |
| 161 | |
| 162 | Development Build |
| 163 | ----------------- |
| 164 | |
| 165 | The following is the suggested configure commands for development build. |
| 166 | |
| 167 | :: |
| 168 | |
| 169 | ./waf configure --debug --with-tests |
| 170 | ./waf |
| 171 | sudo ./waf install |
| 172 | |
| 173 | In the development build all compiler optimizations are disabled by |
| 174 | default and all warnings are treated as error. The default behavior can |
| 175 | be overridden by setting ``CXXFLAGS`` environment variable before |
| 176 | running ``./waf configure``: |
| 177 | |
| 178 | :: |
| 179 | |
| 180 | CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests |
| 181 | ... |