红联Linux门户
Linux帮助

在linux中编译grpc

发布时间:2017-04-24 11:22:25来源:linux网站作者:dchao
环境:
centos_7_x86_x64
 
一、下载
1)下载grpc源代码
grpc-1.2.0.zip(https://github.com/grpc/grpc/archive/v1.2.0.zip)
2)下载grpc依赖库:
1)benchmark-master.zip(https://github.com/google/benchmark/archive/master.zip)
2)boringssl-2924.tar.gz(https://boringssl.googlesource.com/boringssl/+archive/2924.tar.gz)
3)gflags-master.zip(https://github.com/gflags/gflags/archive/master.zip)
4)googletest-master.zip(https://github.com/google/googletest/archive/master.zip)
5)protobuf-master.zip(https://github.com/google/protobuf/archive/master.zip)
6)thrift-master.zip(https://github.com/apache/thrift/archive/master.zip)
7)zlib-master.zip(https://github.com/madler/zlib/archive/master.zip)
注意必须使用boringssl库必须使用boringssl-2924.tar.gz这个版本,其他版本可能都不兼容。
将依赖库解压至third_party下的子目录内,与库名一一对应,最后的目录大致如图所示。
在linux中编译grpc
 
二、安装
#安装gcc和g++
yum install -y gcc gcc-c++
#安装automake
yum install -y automake libtool libsysfs-dev
 
三、编译
修改grpc-1.2.0/Makefile文件(主要是LIBBORINGSSL_SRC变量),增加一行内容:
在linux中编译grpc
然后使用make命令,即可编译成功。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/30256.html