blob: 20e27c1b805499d880d7805631ea72f9f5884769 [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
15grpc core currently depends on zlib and OpenSSL 1.0.2beta3, and also requires
16libevent2 for the Linux port.
17
18grpc++'s tests depends on protobuf 3.0.0, gtests and gflags.
19
20OpenSSL
21-------
22
23Secure HTTP2 requires to have the TLS extension ALPN (see rfc 7301 and
24http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation
25relies on OpenSSL's implementation. OpenSSL 1.0.2beta3 is the first version
26of OpenSSL that has ALPN support, and this explains our dependency on it.
27
nnoble69ac39f2014-12-12 15:43:38 -080028Note that the Makefile supports compiling only the unsecure elements of grpc,
29and if you do not have OpenSSL and do not want it, you can still proceed
30with installing only the elements you require. However, it is recommended
31to encrypt your network traffic, therefore we urge you to not use the unsecure
32version of grpc if possible.
33
nnoble0005b772014-12-10 16:25:34 -080034
35Compiling
36=========
37
nnoble69ac39f2014-12-12 15:43:38 -080038If you have all the dependencies in the third_party subfolder, you should
39simply be able to go ahead and run "make" to compile grpc. The other targets
40that you might find interesting are "buildtests" and "test".
nnoble0005b772014-12-10 16:25:34 -080041
nnoble69ac39f2014-12-12 15:43:38 -080042If you didn't clone from git, and thus are unable to get the required
43dependencies, you can manually download and unpack the necessary packages,
44and let the Makefile build them itself.
nnoble0005b772014-12-10 16:25:34 -080045
nnoble69ac39f2014-12-12 15:43:38 -080046You may also install the dependencies yourself, from the sources, or from
47your distribution's package manager.
nnoble0005b772014-12-10 16:25:34 -080048
nnoble69ac39f2014-12-12 15:43:38 -080049The development packages needed for grpc are libevent2 under Linux, and zlib.
50The development packages needed for grpc++'s tests are gtests, and gflags.
nnoble0005b772014-12-10 16:25:34 -080051
nnoble69ac39f2014-12-12 15:43:38 -080052To the best of our knowledge, no distribution has an OpenSSL package that
53supports ALPN yet, so you would still have to depend on installing from source
54for that particular dependency.
nnoble0005b772014-12-10 16:25:34 -080055
nnoble69ac39f2014-12-12 15:43:38 -080056The recommended version of OpenSSL that provides ALPN support is available
57at this URL:
nnoble0005b772014-12-10 16:25:34 -080058
nnoble69ac39f2014-12-12 15:43:38 -080059 https://www.openssl.org/source/openssl-1.0.2-beta3.tar.gz
60
61If you want to let the Makefile build them automatically for you, please
62extract them in the third_party folder. You will need to rename the extracted
63folder the following way:
64
65 openssl-1.0.2-beta3 --> openssl
nnoble0005b772014-12-10 16:25:34 -080066
67
68Testing
69=======
70
71At the moment, C++ tests aren't fully available yet. If you want to run tests
72on the C core of grpc, you can do the following:
73
nnoble69ac39f2014-12-12 15:43:38 -080074$ make buildtests_c
75$ make test_c
nnoble0005b772014-12-10 16:25:34 -080076
77
78Installing
79==========
80
81Once everything is compiled, you should be able to install grpc and grpc++
82libraries and headers:
83
84$ sudo make install