安装grpc

安装过程依照 官网指南,以下内容为进一步解释

1.将 MY_INSTALL_DIR 环境变量设置为当前用户的主目录下的 .local 子目录路径。export 命令用于将环境变量添加到当前会话的环境中,使其对于后续执行的命令和子进程都可用。

bash 复制代码
 export MY_INSTALL_DIR=$HOME/.local   

2.在设立的那个宏所在地址递归创建新的文件夹,(原因是说方便删除)

bash 复制代码
mkdir -p $MY_INSTALL_DIR
bash 复制代码
export PATH="$MY_INSTALL_DIR/bin:$PATH

4.检查是否安装

bash 复制代码
sudo apt install -y cmake
sudo apt install -y build-essential autoconf libtool pkg-config

5.难主要在下载这个,随机下看什么时候网好

bash 复制代码
git clone --recurse-submodules -b v1.53.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc
  1. 设置cmake
bash 复制代码
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 4                #开启几个线程编译
make install             #安装
popd
相关推荐
浪客川2 天前
【百例RUST - 009】容器 Vector
开发语言·rpc·rust
oyzz1202 天前
spring loC&DI 详解
java·spring·rpc
天上的光4 天前
云计算——RPC中间件
网络协议·rpc·云计算
绿豆人5 天前
RPC项目学习2
网络协议·学习·rpc
恋喵大鲤鱼5 天前
认识 RPC 的不同模式
rpc
PassionY6 天前
Unity NGO 系列教程(五):如何构建多人联机区域触发系统
unity·rpc·ngo·网络触发器·serverrpc·networkvariable·authority
csgo打的菜又爱玩6 天前
2.Flink RPC通信流程解析
大数据·rpc·flink
试试勇气7 天前
C++实现json-rpc框架
网络协议·rpc·json
码云数智-大飞10 天前
解耦的艺术:.NET 中依赖注入(DI)的核心原理与实战
网络·网络协议·rpc