nnoble | 0005b77 | 2014-12-10 16:25:34 -0800 | [diff] [blame^] | 1 | Dependencies |
| 2 | ============ |
| 3 | |
| 4 | grpc has few external dependencies. If needed, they are present in the |
| 5 | third_party directory, if you have cloned the github repository recursively. |
| 6 | If you didn't clone recursively, you can still get them later by running the |
| 7 | following command: |
| 8 | |
| 9 | $ git submodule --init update |
| 10 | |
| 11 | |
| 12 | grpc core currently depends on zlib and OpenSSL 1.0.2beta3, and also requires |
| 13 | libevent2 for the Linux port. |
| 14 | |
| 15 | grpc++'s tests depends on protobuf 3.0.0, gtests and gflags. |
| 16 | |
| 17 | OpenSSL |
| 18 | ------- |
| 19 | |
| 20 | Secure HTTP2 requires to have the TLS extension ALPN (see rfc 7301 and |
| 21 | http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation |
| 22 | relies on OpenSSL's implementation. OpenSSL 1.0.2beta3 is the first version |
| 23 | of OpenSSL that has ALPN support, and this explains our dependency on it. |
| 24 | |
| 25 | |
| 26 | Compiling |
| 27 | ========= |
| 28 | |
| 29 | Currently, you will need to manually install OpenSSL-1.0.2beta3 prior |
| 30 | attempting to compile grpc. To avoid clobbering any system OpenSSL, it is |
| 31 | preferable to install it in a separate directory. Running binaries however |
| 32 | will require the appropriate LD_LIBRARY_PATH variable set up, as shown later. |
| 33 | |
| 34 | To 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 | |
| 42 | After that step, you can compile grpc: |
| 43 | |
| 44 | $ ssl=/usr/local/openssl-alpn |
| 45 | $ CPPFLAGS=-I$ssl/include LDFLAGS=-L$ssl/lib make |
| 46 | |
| 47 | This will compile both grpc and grpc++. |
| 48 | |
| 49 | |
| 50 | Testing |
| 51 | ======= |
| 52 | |
| 53 | At the moment, C++ tests aren't fully available yet. If you want to run tests |
| 54 | on 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 | |
| 60 | Installing |
| 61 | ========== |
| 62 | |
| 63 | Once everything is compiled, you should be able to install grpc and grpc++ |
| 64 | libraries and headers: |
| 65 | |
| 66 | $ sudo make install |