1. Install protobuf 3.3 on Ubuntu 16.04
# Make sure you grab the latest version
1.curl -OL https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
# Unzip
unzip protoc-3.3.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/
# Optional: change owner
sudo chown $USER /usr/local/bin/protoc
sudo chown -R $USER /usr/local/include/google
3. (선택- 이미 설치되어있을 시)
apt-get install -y pkg-config
4.
(선택-이미 설치되어있을 시)
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
5.
$ git clone https://github.com/google/protobuf.git
$ cd protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.
6. grpc 설치
$ cd /usr/local/src/
$ apt-get install build-essential autoconf libtool
$ apt-get install git curl
$ git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc
$ cd grpc/
$ git submodule update --init
$ make
$ make install
$ which protoc
$ cd examples/cpp/helloworld/
$ make
(make 빌드가 잘 안되면 make clean 후 make)
7. 소스 실행
Run the server, which will listen on port 50051:
$ ./greeter_server
Run the client (in a different terminal):
$ ./greeter_client
'BackEnd FrontEnd > GRPC' 카테고리의 다른 글
intelliJ/eclipse grpc import (0) | 2018.07.11 |
---|---|
protoc 지우기(ubuntu) & protobuf 다시 설치 3-> 2 (0) | 2018.07.05 |