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