-
Notifications
You must be signed in to change notification settings - Fork 555
Build Guide
Daniel Zhang edited this page Nov 28, 2016
·
1 revision
- automake
- libtool
- curses
- readline
- zlib
- Clone the PhxSQL repository:
git clone https://github.com/tencent-wechat/phxsql.git. - Run the script
build.shunder the root of repository, this would build everything if all goes well. (will take a lone time, don't panic)
If
build.shfailed, you might follow the step-by-step guide below.
git clone --recursive https://github.com/tencent-wechat/phxsql.git.
Use the parameter
--recursiveto fetch third-party librariesglog,leveldbandprotobuf, as well asphxpaxos,phxrpcandcolib. You can also download those libraries by yourself, then place them underthird_party.
-
cd third_party. -
./autoinstall.sh. - You may see
all done.if everything install successfully, then you can skip to Build PhxSQL.
If
autoinstall.shfailed, check which library is failed to be built and try to fix it. You may need to follow guides below to build each library one by one.
Our build guide base on leveldb 1.19, steps may be different if you download other versions.
-
cd third_party/leveldb. -
make, this would buildlibleveldb.aunder theout-staticdirectory. -
mkdir lib, thencd lib;ln -s ../out-static/libleveldb.a libleveldb.ato create a symbolic link, PhxSQL will search the library underlib.
-
cd third_party/protobuf. -
./autogen.sh. (This would download gmock but the link in script has broken, you may need to download by yourself, or copy from phxpaxos:cp -r ../phxpaxos/third_party/gmock gmock. IfautoreconforAC_PROG_LIBTOOLmissing, you should installautomakeandlibtool.) -
./configure CXXFLAGS=-fPIC --prefix=$(pwd),CXXFLAGSand--prefixmust be set correctly. -
make && make install. - Check directories
bin,includeandlibhave been created after build completed successfully.
You can also read the protobuf build guide
-
cd third_party/glog. -
./configure CXXFLAGS=-fPIC --prefix=$(pwd),CXXFLAGSand--prefixmust be set correctly. -
make && make install. - Check directory
libhas been created, andlibglog.aexist underlib.
-
cd third_party/colib. -
make. - Check directory
libhas been created, andlibcolib.aexist underlib.
-
cd third_party/phxpaxos/third_party. - phxpaxos also depend on
glog,leveldbandprotobuf, since we had built them already, it's no need to build them again. -
rm -rf glog leveldb protobufremove these directories. -
ln -s ../../glog glogsymbolic link to the glog directory we already built. -
ln -s ../../leveldb leveldb. -
ln -s ../../protobuf protobuf. -
cd ..back to the root of phxpaxos. -
./autoinstall.sh. -
make && make install. - Check directory
libhas been created, andlibphxpaxos.aexist underlib. -
cd plugin; make && make installbuild the paxos plugin. - Check directory
libhas been created, andlibphxpaxos_plugin.aexist underlib.
-
cd third_party/phxrpc/third_party. - phxrpc depend on
protobuf, since we had built it already, it's no need to build it again. -
rm -rf protobuf. -
ln -s ../../protobuf protobuf. -
cd ..back to the root of phxpaxos. -
make. - Check directory
libhas been created, andlibphxrpc.aexist underlib.
- Download the source code of
perconapercona-server-5.6.31-77.0.tar.gz, Please note that only percona-server-5.6_5.6.31-77.0 could be used. - Decompress it under the root of PhxSQL source, rename it to
percona. -
cdinto the root of PhxSQL source. -
./autoinstall.sh. (If you seeCurses library not foundorCannot find system readline libraries, librariescursesandreadlineare need to be installed) -
make && make install. (will take a lone time, don't panic)