blob: a9b0b58aa6e0db3888dd00985c4b0ca4b9c0907a [file] [log] [blame]
nnoble0005b772014-12-10 16:25:34 -08001Dependencies
2============
3
4grpc has few external dependencies. If needed, they are present in the
5third_party directory, if you have cloned the github repository recursively.
6If you didn't clone recursively, you can still get them later by running the
7following command:
8
vpaie99270d2014-12-11 19:35:04 -08009$ git submodule update --init
nnoble0005b772014-12-10 16:25:34 -080010
nnoble69ac39f2014-12-12 15:43:38 -080011Note that the Makefile makes it much easier for you to compile from sources
12if you were to clone recursively our git repository.
13
nnoble0005b772014-12-10 16:25:34 -080014
Nicolas Noble7ce706b2015-01-13 16:17:08 -080015grpc core currently depends on zlib and OpenSSL 1.0.2beta3.
nnoble0005b772014-12-10 16:25:34 -080016
17grpc++'s tests depends on protobuf 3.0.0, gtests and gflags.
18
19OpenSSL
20-------
21
22Secure HTTP2 requires to have the TLS extension ALPN (see rfc 7301 and
23http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation
24relies on OpenSSL's implementation. OpenSSL 1.0.2beta3 is the first version
25of OpenSSL that has ALPN support, and this explains our dependency on it.
26
nnoble69ac39f2014-12-12 15:43:38 -080027Note that the Makefile supports compiling only the unsecure elements of grpc,
28and if you do not have OpenSSL and do not want it, you can still proceed
29with installing only the elements you require. However, it is recommended
30to encrypt your network traffic, therefore we urge you to not use the unsecure
31version of grpc if possible.
32
nnoble0005b772014-12-10 16:25:34 -080033
34Compiling
35=========
36
nnoble69ac39f2014-12-12 15:43:38 -080037If you have all the dependencies in the third_party subfolder, you should
38simply be able to go ahead and run "make" to compile grpc. The other targets
39that you might find interesting are "buildtests" and "test".
nnoble0005b772014-12-10 16:25:34 -080040
nnoble69ac39f2014-12-12 15:43:38 -080041If you didn't clone from git, and thus are unable to get the required
42dependencies, you can manually download and unpack the necessary packages,
43and let the Makefile build them itself.
nnoble0005b772014-12-10 16:25:34 -080044
nnoble69ac39f2014-12-12 15:43:38 -080045You may also install the dependencies yourself, from the sources, or from
46your distribution's package manager.
nnoble0005b772014-12-10 16:25:34 -080047
Nicolas Noble7ce706b2015-01-13 16:17:08 -080048The only development package needed for grpc is zlib.
nnoble69ac39f2014-12-12 15:43:38 -080049The development packages needed for grpc++'s tests are gtests, and gflags.
nnoble0005b772014-12-10 16:25:34 -080050
nnoble69ac39f2014-12-12 15:43:38 -080051To the best of our knowledge, no distribution has an OpenSSL package that
52supports ALPN yet, so you would still have to depend on installing from source
53for that particular dependency.
nnoble0005b772014-12-10 16:25:34 -080054
nnoble69ac39f2014-12-12 15:43:38 -080055The recommended version of OpenSSL that provides ALPN support is available
56at this URL:
nnoble0005b772014-12-10 16:25:34 -080057
nnoble69ac39f2014-12-12 15:43:38 -080058 https://www.openssl.org/source/openssl-1.0.2-beta3.tar.gz
59
60If you want to let the Makefile build them automatically for you, please
61extract them in the third_party folder. You will need to rename the extracted
62folder the following way:
63
64 openssl-1.0.2-beta3 --> openssl
nnoble0005b772014-12-10 16:25:34 -080065
66
67Testing
68=======
69
70At the moment, C++ tests aren't fully available yet. If you want to run tests
71on the C core of grpc, you can do the following:
72
nnoble69ac39f2014-12-12 15:43:38 -080073$ make buildtests_c
74$ make test_c
nnoble0005b772014-12-10 16:25:34 -080075
76
77Installing
78==========
79
80Once everything is compiled, you should be able to install grpc and grpc++
81libraries and headers:
82
83$ sudo make install