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