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