INSTALL 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. These instructions only cover building grpc C and C++ libraries under
  2. typical unix systems. If you need more information, please try grpc's
  3. wiki pages:
  4. https://github.com/google/grpc/wiki
  5. *************************
  6. * If you are in a hurry *
  7. *************************
  8. A typical unix installation won't require any more steps than running:
  9. $ make
  10. # make install
  11. You don't need anything else than GNU Make, gcc and autotools. Under a Debian
  12. or Ubuntu system, this should boil down to the following packages:
  13. # apt-get install build-essential autoconf libtool
  14. Building the python wrapper requires the following:
  15. # apt-get install python-all-dev python-virtualenv
  16. *******************************
  17. * More detailled instructions *
  18. *******************************
  19. Setting up dependencies
  20. =======================
  21. Dependencies to compile the libraries
  22. -------------------------------------
  23. grpc libraries have few external dependencies. If you need to compile and
  24. install them, they are present in the third_party directory if you have
  25. cloned the github repository recursively. If you didn't clone recursively,
  26. you can still get them later by running the following command:
  27. $ git submodule update --init
  28. Note that the Makefile makes it much easier for you to compile from sources
  29. if you were to clone recursively our git repository: it will automatically
  30. compile zlib and OpenSSL, which are core requirements for grpc. Note this
  31. creates grpc libraries that will have zlib and OpenSSL built-in inside of them,
  32. which significantly increases the libraries' size.
  33. In order to decrease that size, you can manually install zlib and OpenSSL on
  34. your system, so that the Makefile can use them instead.
  35. Under a Debian or Ubuntu system, one can acquire the development package
  36. for zlib this way:
  37. # apt-get install zlib1g-dev
  38. To the best of our knowledge, no distribution has an OpenSSL package that
  39. supports ALPN yet, so you would still have to depend on installing from source
  40. for that particular dependency if you want to reduce the libraries' size.
  41. The recommended version of OpenSSL that provides ALPN support is available
  42. at this URL:
  43. https://www.openssl.org/source/openssl-1.0.2.tar.gz
  44. Dependencies to compile and run the tests
  45. -----------------------------------------
  46. Compiling and running grpc plain-C tests dont't require any more dependency.
  47. Compiling and running grpc C++ tests depend on protobuf 3.0.0, gtest and
  48. gflags. Although gflags is provided in third_party, you will need to manually
  49. install that dependency on your system to run these tests.
  50. Under a Debian or Ubuntu system, you can install the gtests and gflags packages
  51. using apt-get:
  52. # apt-get install libgflags-dev libgtest-dev
  53. However, protobuf 3.0.0 isn't in a debian package yet, but the Makefile will
  54. automatically try and compile the one present in third_party if you cloned the
  55. repository recursively, and that it detects your system is lacking it.
  56. Compiling and installing protobuf 3.0.0 requires a few more dependencies in
  57. itself, notably the autoconf suite. If you have apt-get, you can install
  58. these dependencies this way:
  59. # apt-get install autoconf libtool
  60. If you want to run the tests using one of the sanitized configurations, you
  61. will need clang and its instrumented libc++:
  62. # apt-get install clang libc++-dev
  63. A word on OpenSSL
  64. -----------------
  65. Secure HTTP2 requires the TLS extension ALPN (see rfc 7301 and
  66. http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation
  67. relies on OpenSSL's implementation. OpenSSL 1.0.2 is the first released version
  68. of OpenSSL that has ALPN support, and this explains our dependency on it.
  69. Note that the Makefile supports compiling only the unsecure elements of grpc,
  70. and if you do not have OpenSSL and do not want it, you can still proceed
  71. with installing only the elements you require. However, we strongly recommend
  72. the use of encryption for all network traffic, and discourage the use of grpc
  73. without TLS.
  74. Compiling
  75. =========
  76. If you have all the dependencies mentioned above, you should simply be able
  77. to go ahead and run "make" to compile grpc's C and C++ libraries:
  78. $ make
  79. Testing
  80. =======
  81. To build and run the tests, you can run the command:
  82. $ make test
  83. If you want to be able to run them in parallel, and get better output, you can
  84. also use the python tool we have written:
  85. $ ./tools/run_tests/run_tests.py
  86. Installing
  87. ==========
  88. Once everything is compiled, you should be able to install grpc C and C++
  89. libraries and headers:
  90. # make install