当前位置:网站首页>Phxpaxos installation and compilation process
Phxpaxos installation and compilation process
2022-07-23 11:37:00 【Chongya HHH】
phxpaxos Install the compilation process
One 、 Preface
This blog records the work of Tencent wechat team phxpaxos Install the compilation process , Record some pits in the compilation process .
github link :
phxpaxos github link
Compilation manual of official documents :
Compiler manual
However , The official compilation manual has a long history , Therefore, some problems may be encountered when operating according to its process , Here is a summary of my own installation process , And compile and install in a way different from the compilation manual .
Two 、 setup script
1. Pull the code
Use of official documents
git clone --recursive https://github.com/tencent-wechat/phxpaxos.git
To pull the code , In this way, we can put submodule Pull together , However, due to the size of the connection buffer or the connection timeout , There may be no way to pull it down again , So you can try : First
git clone https://github.com/tencent-wechat/phxpaxos.git
Pull without submodule Code for , Then enter ./phxpaxos Under the table of contents ,
git submodule init
git submodule update
Pull submodule, If a update You don't succeed ( The connection failed or only part of it was pulled submodule), You can use it several times git submodule update Until all the submodule Update complete .
2. compile submodules( Dependency Library )
Direct operation
../phxpaxos/third_party/autoinstall.sh
Why not follow the official compilation manual
phxpaxos rely on leveldb、protobuf etc. module, This part of the code is ../phxpaxos/third_party in , Directory as follows :
The official manual compiles different modules , It's a little bit of a hassle , And not flexible enough , So we use ../phxpaxos/third_party/autoinstall.sh To install and compile . Why not recommend following the manual , Two examples :
1. In the installation leveldb At that time, the official manual has the following operations :
mkdir lib Build a lib Catalog , then
cd lib;ln -s ../libleveldb.a libleveldb.aBuild a soft chain ,PhxPaxos adopt lib This directory addresses static libraries .
But actually libleveldb.a Maybe not in third_party/leveldb Under the table of contents , But in third_party/leveldb/out-static Under the table of contents , And in the ../phxpaxos/third_party/autoinstall.sh Will judge by itself and link 
2. In the installation protobuf At that time, the official manual has the following operations :
Get into
third_party/protobufCatalog , function./autogen.sh
protobuf rely on gmock, So in ./autogen.sh Will download and install gmock, But the graphic link is blocked by the wall , After climbing the ladder 404.
And in the ../phxpaxos/third_party/autoinstall.sh Will try to reuse first third_party In the directory gmock(gmock It's also phxpaxos Of submodule), And then it runs again protobuf Of ./autogen.sh, So there will be no problem .
A possible pit
a. glog aclocal-1.14 non-existent

View the current version first 
If the version is not 1.14 Then proceed with the following operations in sequence :
Find a suitable Directory , Such as /usr/local/, then
autoconf compile
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xvzf autoconf-2.69.tar.gz
cd autoconf-2.69; ./configure
make && make install
cd ..
automake compile
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar xvzf automake-1.14.tar.gz; cd automake-1.14
./configure
make && make install
Rerun ../phxpaxos/third_party/autoinstall.sh that will do .
b. glog ‘./test-driver’ not found

modify ../phxpaxos/third_party/autoinstall.sh Script 
stay install_glog() Function to add :
automake --add-missing
aclocal-1.14
Rerun ../phxpaxos/third_party/autoinstall.sh Then you can download the missing file and work normally .
c. protobuf Can't find AC_PROG_LIBTOOL

Due to the installation of multiple versions aclocal( Re installed 1.14), Lead to aclocal scanning configure.ac The path is wrong when all macros in are defined and expanded .aclocal Go to the default installation directory /usr/share/aclocal Search below for all .m4 The file cannot find the defined macro , However, due to the installation of multiple aclocal, Probably aclocal directory does not exist , The actual directory is /usr/local/share/aclocal etc. , That's what happened aclocal Can't find m4 File status , You need to make a copy of .m4 File to /usr/local/share/aclocal, Therefore, you need to execute the following commands
cp /usr/share/aclocal/*.m4 /usr/local/share/aclocal/
Rerun ../phxpaxos/third_party/autoinstall.sh It can be executed normally .
3. compile PhxPaxos Static library
go back to phxpaxos root directory
cd phxpaxos/
./autoinstall.sh
make && make install // By default -O2 Compile optimization parameters , To compile debug edition , The order is make debug=y
If you only need to use libphxpaxos.a Development , Then the compilation is finished . And if you want to use our glog Log plug-in module , Or you want to try compiling sample Catalog , Or for phxsql Use , You also need to compile libphxpaxos_plugin.a, This static library depends on glog.
4. compile PhxPaxos Plugin Static library
cd phxpaxos/plugin
make && make install
Compile successfully, check the upper layer lib Whether the static library is successfully generated under the directory libphxpaxos_plugin.a
3、 ... and 、example-phxecho
compile phxecho
cd ../phxpaxos/sample/phxecho
make
mkdir log
Run the test
// Start three processes
./phxecho 127.0.0.1:1000 127.0.0.1:1000,127.0.0.1:1001,127.0.0.1:1002
./phxecho 127.0.0.1:1001 127.0.0.1:1000,127.0.0.1:1001,127.0.0.1:1002
./phxecho 127.0.0.1:1002 127.0.0.1:1000,127.0.0.1:1001,127.0.0.1:1002



The input content will be seen and recorded by all processes .
边栏推荐
- 自定义MVC的使用&增删改查
- Web component - the lifecycle of a custom element
- NFT数字藏品系统开发:音乐和NFT的结合
- Usage of some, every, find, FindIndex
- The 6th "Blue Hat Cup" National College Students' Cyber Security Skills Competition - preliminary writeup
- NFT数字藏品系统开发:徐悲鸿美术馆通过数字藏品平台亮相
- 数字藏品开发/数字藏品系统开发解决方案
- Use require.context to complete batch import of local pictures
- Php+ code cloud code hook automatically updates online code
- The difference between slice() and slice()
猜你喜欢

MySQL索引&&执行计划

动态设置卡片的主题色

NFT数字藏品系统开发:深圳晚报《美好时光遨游记》数字藏品上线秒磬

Genesis provided a loan of US $2.36 billion to Sanya capital

Typescript introduction

Niuke question brushing record -- MySQL

再见if-else

Pywinauto+ an application (learn to lesson 9) -- blocked

Eth transfer times reached a one month high

基于el-table的树形表格及js-xlsx实现下载excel功能(二)
随机推荐
Rogue goto statements in C language
利用动态规划解决最长增长子序列问题
Usage of some, every, find, FindIndex
Pywinauto+ an application (learn to lesson 9) -- blocked
Man in the middle attacks ARP Spoofing and its linkage with beef XSS
Fed Brad: last week's employment report showed that the U.S. economy is robust and can withstand higher interest rates
解决手动查询Oracle数据库时间格式不正确的问题(DATE类型)
The tree form based on El table and JS xlsx realize the function of downloading excel (II)
NFT数字藏品系统开发:徐悲鸿美术馆通过数字藏品平台亮相
kubesphere HA install (二)
第六届“蓝帽杯”全国大学生网络安全技能大赛-初赛Writeup
自定义公式输入框
quartz2.2简单调度Job
PHP文件上传中fileinfo出现的安全问题
Simple implementation of rectangular area block
General Query & paging code
通用查询&分页代码
忽略埋点记录的ResizeObserver - loop limit exceeded
Setting optimization and use of MySQL and SQL Server
Common errors in C language debugging -- brief answer