Install gRPC from source in Ubuntu

作者: shaneZhang 分类: 互联网技术 发布时间: 2020-12-29 17:46

Install dependence

sudo apt-get install pkg-config
sudo apt-get install autoconf automake libtool make g++ unzip
sudo apt-get install libgflags-dev libgtest-dev
sudo apt-get install clang libc++-dev

Pull the source codes And install protobuf

git clone https://github.com/grpc/grpc.git
cd grpc
git submodule update --init 
cd third_party/protobuf/
git submodule update --init --recursive  
./autogen.sh 
./configure
make   
sudo make install
sudo ldconfig
which protoc   
protoc --version

Install gPRC

cd ../..
sudo apt-get install cmake                       
mkdir -p cmake/build
cd cmake/build
cmake ../.. -DBUILD_SHARED_LIBS=ON
make
sudo make install

Test the gPRC

cd examples/cpp/helloworld/
make
sudo ./greeter_server
sudo ./greeter_client

本页面支持繁体中文友好显示:Install gRPC from source in Ubuntu

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复