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