一次失败的尝试:paxosstore示例编译

本文记录了一次尝试编译PaxosStore example的过程,期间遇到了包括库安装、编译错误、头文件缺失、grpc编译问题等系列挑战。尽管参考了相关解决方案,但最终仍未能成功解决问题,这次尝试以失败告终。
摘要由CSDN通过智能技术生成

本来想编译paxosstore的example,没想到最终还是失败了。

git clone https://github.com/Tencent/paxosstore.git
cd paxosstore
git submodule update --init --recursive

然后安装有用的库:

apt install zlib1g-dev libssl-dev  libpcap-dev libelf-dev libicu-dev libreadline-dev libtool  libsysfs-dev \
libsqlite3-dev libbz2-dev libreadline-dev zlib1g-dev liblzma-dev liblzo2-dev   \
libsnappy-dev  liblz4-dev libzstd-dev libgflags-dev  libprotoc-dev

编译:

cd certain
./build.sh example

会报错:network/IOChannel.cpp:127:16: error: ‘writev’ was not declared in this scope

然后在network/IOChannel.cpp添加头文件:

#include<sys/uio.h>

接着报错:error: this statement may fall through [-Werror=implicit-fallthrough=]
解决方法:

export CFLAGS='-Wno-implicit-fallthrough'

然后报错:

./third/protobuf/src/protoc --grpc_out=./ --plugin=protoc-gen-grpc=./third/grpc/bins/opt/grpc_cpp_plugin example/example.proto
./third/grpc/bins/opt/grpc_cpp_plugin: program not found or is not executable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
Makefile:95: recipe for target 'example/example.grpc.pb.cc' failed
make: *** [example/example.grpc.pb.cc] Error 1
make: *** Waiting for unfinished jobs....
rm src/Certain.pb.cc

参考:grpc/run_distrib_test_cmake.sh at master · grpc/grpc

这是因为grpc编译没完成,有错误,解决方法:

mv grpc grpc2
git clone https://github.com/grpc/grpc.git
cd grpc
git submodule update --init
make REQUIRE_CUSTOM_LIBRARIES_opt=1 static
cmake . -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package
make
cp *.a libs/opt/

可能会报错:


g++: error: ./third/grpc/libs/opt/libboringssl.a: No such file or directory
g++: error: ./third/grpc/libs/opt/libgpr.a: No such file or directory
g++: error
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值