blob: f563f56bcc9a4d7c45c975039414f447e8176044 [file] [log] [blame] [view]
Alexander Afanasyev766cea72014-04-24 19:16:42 -07001ndn-cxx: NDN C++ library with eXperimental eXtensions
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07002=====================================================
Alexander Afanasyev553d0c82014-01-28 19:19:39 -08003
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -07004Supported platforms
5-------------------
6
Alexander Afanasyev766cea72014-04-24 19:16:42 -07007ndn-cxx uses continuous integration testing and has been tested on the following platforms:
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -07008
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 Afanasyev553d0c82014-01-28 19:19:39 -080015Prerequisites
16-------------
17
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070018### Required:
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080019
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070020* `python` >= 2.6
21* `libcrypto`
22* `libsqlite3`
23* `libcrypto++`
24* `pkg-config`
25* Boost libraries >= 1.48
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080026* OSX Security framework (on OSX platform only)
27
28Following are the detailed steps for each platform to install the prerequisites.
29
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070030* Mac OS X
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080031
32 Install Xcode.
33 In Xcode Preferences > Downloads, install "Command Line Tools".
34
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080035 If using macports, dependencies can be installed using the following commands:
36
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070037 sudo port install pkgconfig boost sqlite3 libcryptopp
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080038
Alexander Afanasyevdafdc372014-03-03 15:58:44 +000039* Ubuntu 12.04, Ubuntu 13.10
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080040
41 In a terminal, enter:
42
43 sudo apt-get install build-essential
Alexander Afanasyevdafdc372014-03-03 15:58:44 +000044 sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080045
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070046 # For Ubuntu 12.04
47 sudo apt-get install libboost1.48-all-dev
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080048
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070049 # For Ubuntu 13.10
50 sudo apt-get install libboost-all-dev
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080051
Alexander Afanasyev766cea72014-04-24 19:16:42 -070052### Optional:
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -070053
54To build tutorials, manpages, and API documentation the following
55dependencies need to be installed:
56
57* `doxygen`
58* `graphviz`
59* `python-sphinx`
60
61The 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 Afanasyev553d0c82014-01-28 19:19:39 -080073Build
74-----
75
Alexander Afanasyev766cea72014-04-24 19:16:42 -070076(These are instructions to build ndn-cxx. To do development of ndn-cxx
Alexander Afanasyev2a8e6272014-03-17 19:36:50 -070077code and update the build system, see Development.)
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080078
Alexander Afanasyev766cea72014-04-24 19:16:42 -070079To build in a terminal, change directory to the ndn-cxx root. Enter:
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080080
81 ./waf configure
82 ./waf
83 sudo ./waf install
84
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070085This builds and installs the following items:
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080086
Alexander Afanasyev766cea72014-04-24 19:16:42 -070087* `<LIBPATH>/libndn-cxx.a`: static NDN C++ library
88* `<LIBPATH>/pkgconfig/libndn-cxx.pc`: pkgconfig file storing all neccessary flags
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080089 to build against the library. For example, if pkgconfig or pkgconf package is
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070090 installed and `PKG_CONFIG_PATH` is configured properly (or `<LIBPATH>/pkgconfig` is a
Alexander Afanasyev766cea72014-04-24 19:16:42 -070091 default path), `pkgconfig --libs --clflags libndn-cxx` will return all necessary
Alexander Afanasyev553d0c82014-01-28 19:19:39 -080092 compile and link flags for the library.
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070093* `<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 Afanasyev553d0c82014-01-28 19:19:39 -080098
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -070099If configured with tests: `./waf configure --with-tests`), the above commands will
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800100also produce:
101
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -0700102* `build/unit-tests`: A unit test binary for the library
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800103
104Documentation
105-------------
106
Alexander Afanasyev766cea72014-04-24 19:16:42 -0700107ndn-cxx tutorials and API documentation can be built using the following commands:
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800108
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700109 # Full set of documentation (tutorials + API) in build/docs
110 ./waf docs
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800111
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700112 # Only tutorials in `build/docs`
113 ./waf sphinx
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800114
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700115 # Only API docs in `build/docs/doxygen`
116 ./waf doxgyen
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800117
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800118
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700119Manpages 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 Afanasyev553d0c82014-01-28 19:19:39 -0800124
Alexander Afanasyev7c6aeb02014-04-10 19:59:19 -0700125For more details, refer to `./waf --help`.
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800126
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800127
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800128
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800129
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -0700130Development Build
131-----------------
Alexander Afanasyev553d0c82014-01-28 19:19:39 -0800132
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -0700133The following is the suggested configure commands for development build.
134
135 ./waf configure --debug --with-tests
136 ./waf
137 sudo ./waf install
138
Alexander Afanasyev766cea72014-04-24 19:16:42 -0700139In the development build all compiler optimizations are disabled by default and all
140warnings are treated as error. The default behavior can be overridden by setting `CXXFLAGS`
141environment variable before running `./waf configure`:
Alexander Afanasyev5e1288e2014-03-28 11:11:48 -0700142
143 CXXFLAGS="-O1 -g3" ./waf configure --debug --with-tests
144 ...