blob: c0b4bc33857fef961e03899c1b4e3fa878f9f2ff [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
9$ git submodule --init update
10
11
12grpc core currently depends on zlib and OpenSSL 1.0.2beta3, and also requires
13libevent2 for the Linux port.
14
15grpc++'s tests depends on protobuf 3.0.0, gtests and gflags.
16
17OpenSSL
18-------
19
20Secure HTTP2 requires to have the TLS extension ALPN (see rfc 7301 and
21http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation
22relies on OpenSSL's implementation. OpenSSL 1.0.2beta3 is the first version
23of OpenSSL that has ALPN support, and this explains our dependency on it.
24
25
26Compiling
27=========
28
29Currently, you will need to manually install OpenSSL-1.0.2beta3 prior
30attempting to compile grpc. To avoid clobbering any system OpenSSL, it is
31preferable to install it in a separate directory. Running binaries however
32will require the appropriate LD_LIBRARY_PATH variable set up, as shown later.
33
34To compile OpenSSL 1.0.2beta3:
35
36$ cd third_party/openssl
37$ ./config --prefix=/usr/local/openssl-alpn --shared
38$ make
39$ sudo make install
40
41
42After that step, you can compile grpc:
43
44$ ssl=/usr/local/openssl-alpn
45$ CPPFLAGS=-I$ssl/include LDFLAGS=-L$ssl/lib make
46
47This will compile both grpc and grpc++.
48
49
50Testing
51=======
52
53At the moment, C++ tests aren't fully available yet. If you want to run tests
54on the C core of grpc, you can do the following:
55
56$ CPPFLAGS=-I$ssl/include LDFLAGS=-L$ssl/lib make buildtests_c
57$ LD_LIBRARY_PATH=$ssl/lib make test_c
58
59
60Installing
61==========
62
63Once everything is compiled, you should be able to install grpc and grpc++
64libraries and headers:
65
66$ sudo make install