Ubuntu 16.04 编译 Grpc

执行命令如下:

export MY_INSTALL_DIR=$HOME/.local
mkdir -p $MY_INSTALL_DIR
export PATH="$MY_INSTALL_DIR/bin:$PATH"

wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.19.6/cmake-3.19.6-Linux-x86_64.sh
sh cmake-linux.sh -- --skip-license --prefix=$MY_INSTALL_DIR
rm cmake-linux.sh
cmake --version

sudo apt-get update
sudo apt-get upgrade

sudo apt install -y build-essential autoconf libtool pkg-config

sudo apt-get install git
git  --version

git clone --recurse-submodules -b v1.43.0 https://github.com/grpc/grpc

cd grpc
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON \
      -DgRPC_BUILD_TESTS=OFF \
      -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR \
      ../..
make -j
make install
popd

 

官方参考文档: https://grpc.io/docs/languages/cpp/quickstart/

 

上一篇:Ubuntu卸载Anaconda步骤


下一篇:Linux在sudo apt-get update或install时出现archive.ubuntu.com连接失败 [IP: 91.189.91.39 80]的错误解决方案