#If you are in a hurry
For language-specific installation instructions for gRPC runtime, please refer to these documents
- C++: Currently to install gRPC for C++, you need to build from source as described below.
- C#: NuGet package
Grpc
- Go:
go get google.golang.org/grpc
- Java
- Node:
npm install grpc
- Objective-C
- PHP:
pecl install grpc
- Python:
pip install grpcio
- Ruby:
gem install grpc
#Pre-requisites
##Linux
$ [sudo] apt-get install build-essential autoconf libtool
##Mac OSX
For a Mac system, git is not available by default. You will first need to install Xcode from the Mac AppStore and then run the following command from a terminal:
$ [sudo] xcode-select --install
##Protoc
By default gRPC uses protocol buffers,
you will need the protoc
compiler to generate stub server and client code.
If you compile gRPC from source, as described below, the Makefile will
automatically try and compile the protoc
in third_party if you cloned the
repository recursively and it detects that you don't already have it
installed.
#Build from Source
For developers who are interested to contribute, here is how to compile the gRPC C Core library.
$ git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc
$ cd grpc
$ git submodule update --init
$ make
$ [sudo] make install
##Windows
There are several ways to build under Windows, of varying complexity depending on experience with the tools involved.
###msys2
This approach requires having msys2 installed.
- The Makefile (and source code) should support msys2's mingw32 and mingw64 compilers. Building with msys2's native compiler is also possible, but difficult.
- The Makefile is expecting the Windows versions of OpenSSL (see
https://slproweb.com/products/Win32OpenSSL.html). It's also possible to build
the Windows version of OpenSSL from scratch. The output should be
libeay32
andssleay32
. - If you are not installing the above files under msys2's path, you may specify
it, for instance, in the following way:
CPPFLAGS=”-I/c/OpenSSL-Win32/include” LDFLAGS=”-L/c/OpenSSL-Win32/lib” make static_c
- protobuf3 must be installed on the msys2 path.
###Cmake (experimental)
- Install CMake.
- Run it over grpc's CMakeLists.txt to generate "projects" for your compiler.
- Build with your compiler of choice. The generated build files should have the protobuf3 dependency baked in.