brpc & braft build

ubuntu build brpc

brpc有如下依赖:gflags, protobuf, leveldb

安装依赖

# git g++ make ...
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev
# snappy
sudo apt-get install -y libsnappy-dev
# install cmake and gtest, put gtest in usr conf
sudo apt-get install -y cmake libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -

使用config_brpc.sh编译brpc

# 1. clone brpc
git clone https://github.com/apache/brpc.git
# 2. cd brpc
cd /brpc
# 3. 编译brpc 但是这里并没有成功放到/usr 下
sh config_brpc.sh --headers=/usr/include --libs=/usr/lib
# 4. 在/brpc/output中 找到静态库和动态库以及inclue
# --- ls ---
# torres@ubuntu:~/Desktop/braft/brpc/output$ ls
# bin  include  lib
# ----------
# 5. copy 这三个文件夹到/usr下
# 5.1 手动copy
sudo nautilus
# 5.2 
sudo cp -r bin /usr/bin
sudo cp -r lib /usr/lib
sudo cp -r include /usr/include

demo测试

cd example/echo_c++
make
./echo_server &
./echo_client

ubuntu build braft

# clone braft
git clone https://github.com/baidu/braft.git
# Compile braft with cmake
mkdir bld && cd bld && cmake .. && make

example

braft/example at master · baidu/braft (github.com)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tototototorres

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值