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