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 | 2a8e627 | 2014-03-17 19:36:50 -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 | |
| 55 | Build |
| 56 | ----- |
| 57 | |
Alexander Afanasyev | 2a8e627 | 2014-03-17 19:36:50 -0700 | [diff] [blame] | 58 | (These are instructions to build ndn-cpp-dev. To do development of ndn-cpp-dev |
| 59 | code and update the build system, see Development.) |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 60 | |
Alexander Afanasyev | 2a8e627 | 2014-03-17 19:36:50 -0700 | [diff] [blame] | 61 | 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] | 62 | |
| 63 | ./waf configure |
| 64 | ./waf |
| 65 | sudo ./waf install |
| 66 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 67 | This builds and installs the following items: |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 68 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 69 | * `<LIBPATH>/libndn-cpp-dev.a`: static NDN C++ library |
| 70 | * `<LIBPATH>/pkgconfig/libndn-cpp-dev.pc`: pkgconfig file storing all neccessary flags |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 71 | 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^] | 72 | installed and `PKG_CONFIG_PATH` is configured properly (or `<LIBPATH>/pkgconfig` is a |
| 73 | default path), `pkgconfig --libs --clflags libndn-cpp-dev` will return all necessary |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 74 | compile and link flags for the library. |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 75 | * `<BINPATH>/tlvdump`: a simple tool to dump contents of TLV-formatted data |
| 76 | * `<BINPATH>/ndncatchunks3`: a simplified equivalent to ndncatchunks2 in NDNx package |
| 77 | * `<BINPATH>/ndnputchunks3`: a simplified equivalent to ndnputchunks2 in NDNx package |
| 78 | * `<BINPATH>/ndnsec`: tool to manage NDN keys and certificates |
| 79 | * `<BINPATH>/ndnsec-*`: convenience scripts for `ndnsec` tools |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 80 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 81 | If configured with tests: `./waf configure --with-tests`), the above commands will |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 82 | also produce: |
| 83 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 84 | * `build/unit-tests`: A unit test binary for the library |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 85 | |
| 86 | Documentation |
| 87 | ------------- |
| 88 | |
| 89 | To make documentation, enter: |
| 90 | |
| 91 | ./waf doxygen |
| 92 | |
| 93 | This will produce doxygen API code documentation in: |
| 94 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 95 | * `build/doc/html` |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 96 | |
| 97 | Development Prerequisites |
| 98 | ------------------------- |
| 99 | |
Alexander Afanasyev | 2a8e627 | 2014-03-17 19:36:50 -0700 | [diff] [blame] | 100 | These steps are only needed 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] | 101 | First follow the Prerequisites above for your platforms. |
| 102 | |
| 103 | * Mac OS X 10.7.3, Mac OS X 10.8.4, Mac OS X 10.9 |
| 104 | |
| 105 | Install MacPorts from http://www.macports.org/install.php |
| 106 | In a terminal, enter: |
| 107 | |
| 108 | sudo port install doxygen |
| 109 | |
| 110 | * Ubuntu 12.04 (64 bit and 32 bit), Ubuntu 13.04 (64 bit) |
| 111 | |
| 112 | In a terminal, enter: |
| 113 | |
| 114 | sudo apt-get install doxygen |
| 115 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 116 | Development Build |
| 117 | ----------------- |
Alexander Afanasyev | 553d0c8 | 2014-01-28 19:19:39 -0800 | [diff] [blame] | 118 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame^] | 119 | The following is the suggested configure commands for development build. |
| 120 | |
| 121 | ./waf configure --debug --with-tests |
| 122 | ./waf |
| 123 | sudo ./waf install |
| 124 | |
| 125 | In the development build all compiler optimizations are disabled by default and all warnings are treated as error. |
| 126 | The default behavior can be overridden by setting CXXFLAGS environment variable before running `./waf configure`: |
| 127 | |
| 128 | CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests |
| 129 | ... |