ubuntu 安装grpc

概述

– 资料

ubuntu下安装配置grpc_ubuntu安装grpc_hsy12342611的博客-CSDN博客

安装

–准备环境(安装gcc那些)

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

– 安装protobuf

– 安装cares库

https://github.com/c-ares/c-ares/releases

tar -zxvf c-ares-cares-1_19_0.tar.gz

mkdir build

cd build

cmake …

make

sudo make install


ps: 头文件默认安装在: /usr/local/include

lib文件默认安装在: /usr/local/lib

详细细节查看 make install 时候的日志

– 安装grpc

gRPC下载编译和安装——Linux/Windows_grpc安装linux_real沛林的博客-CSDN博客

gRPC编译和安装——Linux版_grpc linux安装编译_ooMelloo的博客-CSDN博客

  • 下载:

    • git链接: https://github.com/grpc/grpc

      git clone https://github.com/grpc/grpc.git

      cd grpc

      git submodule update --init

      git submodule update --init --recursive //确保库下载完全


      ps:上面的若确认以及下载完成,就不用继续后面的动作了

      cd third_party

      git submodule update --init --recursive

      • 如果速度慢,手动到third_party 下载如下:

        git clone https://github.com/abseil/abseil-cpp.git

        git clone https://github.com/google/benchmark

        git clone https://github.com/google/bloaty.git

        git clone https://github.com/google/boringssl.git

        git clone https://github.com/c-ares/c-ares.git

        git clone https://github.com/envoyproxy/data-plane-api.git

        git clone https://github.com/googleapis/googleapis.git

        git clone https://github.com/google/googletest.git

        git clone https://github.com/census-instrumentation/opencensus-proto.git

        git clone https://github.com/protocolbuffers/protobuf.git

        git clone https://github.com/google/re2.git

        git clone https://github.com/cncf/xds.git

        git clone https://github.com/madler/zlib

    • gitee链接:git clone https://github.com/grpc/grpc

      git clone https://gitee.com/mirrors/grpc-framework grpc

      cd grpc

      cat .gitmodules // 查看文件里的submodule, 将GitHub改成Gitee

      git submodule update --init

  • 编译

    cd grpc

    mkdir build

    cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local … // 指定安装路径 , 通常不需要,其默认安装在/usr/local/include和lib中

    make -j2

    sudo make install

  • 32
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值