1. 安裝3.13以上的cmake
apt remove cmake
wget https://cmake.org/files/v3.17/cmake-3.17.2.tar.gz
tar zxvf cmake-3.17.2.tar.gz
cd cmake-3.17.2
./configure
sudo make && make install
2. 安裝openssl
apt remove openssl
wget https://www.openssl.org/source/openssl-1.1.1b.tar.gz
tar -xvf openssl-1.1.1b.tar.gz
cd openssl-1.1.1b
./config --prefix=/usr/local --openssldir=/usr/local/openssl
make && make install
vim ~/.bashrc
export PATH=/usr/local/openssl/bin:PATH
export OPENSSL_ROOT_DIR=/usr/local/openssl
export OPENSSL_LIBRARIES=/usr/local/openssl/lib
source ~/.bashrc
3. 安裝grpc工具
sudo apt install -y build-essential autoconf libtool pkg-config
4. 下載grpc
git clone --recurse-submodules -b v1.28.1 https://github.com/grpc/grpc
5. 安裝grpc的c-ares依賴
cd grpc/third_party/cares/cares
mkdir build
cd build
cmake ..
make && make install
6. 安裝grpc的benchmarks依賴
cd grpc/third_party/benchmarks
mkdir build
cd build
cmake ..
make && make install
7. 安裝grpc的protobuf依賴
cd grpc/third_party/protobuf
git submodule update --init --recursive
cd cmake
mkdir build
cd build
cmake ..
make && make install
8.安裝grpc
cd grpc
mkdir build
cd build
cmake ..
make && make install