blob: 31f279739faf2e0d00c8117a0b387125535bb8df [file] [log] [blame]
Jeff Thompson9b282e02013-08-09 17:13:38 -07001NDN-CPP: A Named Data Networking client library for C++ and C
Jeff Thompson057d3182013-08-09 17:02:25 -07002-------------------------------------------------------------
3
4Prerequisites
5-------------
Jeff Thompson18f43e12013-11-21 12:45:12 -08006(These are prerequisites to build NDN-CPP. To do development of NDN-CPP code and update the build system, see Development.)
Jeff Thompson057d3182013-08-09 17:02:25 -07007
Jeff Thompsonc2da8c72013-10-10 16:30:25 -07008Required: libcrypto
9Optional: libsqlite3 (for key storage)
10Optional: OSX Security framework (for key storage)
11
12Following are the detailed steps for each platform to install the prerequisites.
13
14* Ubuntu 12.04
Jeff Thompson18f43e12013-11-21 12:45:12 -080015In a terminal, enter:
Jeff Thompsonc2da8c72013-10-10 16:30:25 -070016sudo apt-get install build-essential
17sudo apt-get install libssl-dev
Jeff Thompson057d3182013-08-09 17:02:25 -070018
Jeff Thompson1fd73652013-10-23 16:42:03 -070019* Windows Cygwin
20Cygwin is tested on Windows 7 64-bit with the "Devel" packages selected to install at the top level of the
21cygwin installer. This includes libcrypto and libsqlite3.
22
Jeff Thompson18f43e12013-11-21 12:45:12 -080023* Mac OS X 10.7.3, Mac OS X 10.8.4
24Install Xcode.
25In Xcode Preferences > Downloads, install "Command Line Tools".
26
27* Mac OS X 10.9
28Install Xcode. (Xcode on OS X 10.9 seems to already have the Command Line Tools.)
Jeff Thompson1fd73652013-10-23 16:42:03 -070029
Jeff Thompson057d3182013-08-09 17:02:25 -070030Build
31-----
Jeff Thompson18f43e12013-11-21 12:45:12 -080032(These are instructions to build NDN-CPP. To do development of NDN-CPP code and update the build system, see Development.)
Jeff Thompson057d3182013-08-09 17:02:25 -070033
Jeff Thompson18f43e12013-11-21 12:45:12 -080034To build in a terminal, change directory to the NDN-CPP root. Enter:
Jeff Thompson057d3182013-08-09 17:02:25 -070035
36./configure
37make
Jeff Thompsonc2da8c72013-10-10 16:30:25 -070038make install
Jeff Thompson057d3182013-08-09 17:02:25 -070039
Jeff Thompson2f951cf2013-08-11 16:04:09 -070040To make documentation, enter:
41make doxygen-doc
42
Jeff Thompson057d3182013-08-09 17:02:25 -070043Files
44-----
45
46This makes the following libraries:
47
48.libs/libndn-c.a: The core C code for encoding and communication.
Jeff Thompsonc2da8c72013-10-10 16:30:25 -070049.libs/libndn-cpp.a: The C++ library API. (If linking to libndn-cpp, don't link to libndn-c since it is included.)
Jeff Thompson057d3182013-08-09 17:02:25 -070050
51This makes the following test files:
52
53bin/test-get-async: Connect to one of the NDN testbed hubs, express an interest and display the received data.
Jeff Thompson13527ab2013-11-21 11:17:09 -080054bin/test-publish-async: Connect to the local NDN hub, accept interests with prefix /testecho and echo back a data packet.
Jeff Thompson057d3182013-08-09 17:02:25 -070055bin/test-encode-decode-interest: Encode and decode an interest, testing interest selectors and the name URI.
56bin/test-encode-decode-data: Encode and decode a data packet, including signing the data packet.
Jeff Thompsonc2da8c72013-10-10 16:30:25 -070057bin/test-encode-decode-forwarding-entry: Encode and decode a data packet, including signing the data packet.
Jeff Thompson057d3182013-08-09 17:02:25 -070058
Jeff Thompson2f951cf2013-08-11 16:04:09 -070059Running make doxygen-doc puts code documentation in:
60doc/html
61
Jeff Thompson057d3182013-08-09 17:02:25 -070062Supported platforms
63-------------------
64
Jeff Thompson9b282e02013-08-09 17:13:38 -070065NDN-CPP is tested on the following platforms:
Jeff Thompson057d3182013-08-09 17:02:25 -070066Ubuntu 12.04 (gcc 4.6.3)
67Mac OS X 10.8.4 (clang 4.2)
68Mac OS X 10.8.4 (gcc 4.2)
69
Jeff Thompson18f43e12013-11-21 12:45:12 -080070Development
71-----------
72These steps are only needed to do development of NDN-CPP code and update the build system.
73First follow the prerequisites above for your platforms.
Jeff Thompson057d3182013-08-09 17:02:25 -070074
Jeff Thompson18f43e12013-11-21 12:45:12 -080075* Mac OS X 10.8.4
76Install MacPorts from http://www.macports.org/install.php
77In a terminal, enter:
78sudo port install automake
79sudo port install autoconf
80sudo port install libtool
81aclocal --print
82
83"aclocal --print" shows the directory for m4 macros. Download the the following into there (use sudo):
84# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_cxx_compile_stdcxx_11.m4
85# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prog_doxygen.m4
86# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_check_openssl.m4
87# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_lib_sqlite3.m4
88# http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prefix_config_h.m4
89
90Now you can add source code files and update Makefile.am.
91After updating, change directory to the NDN-CPP root and enter the following to build the Makefile:
92./autogen.sh