-
Notifications
You must be signed in to change notification settings - Fork 171
Compile EN
liguoqiang edited this page Jul 14, 2020
·
4 revisions
We use Bazel to resolve dependencies and build BaikalDB automatically. The build has been successful on Ubuntu 16.04 and CentOS 7. More platforms will be supported soon.
-
Install bazel, we recommend version 0.18.1 or earlier. Later versions may be incompatible with the BUILD file.
wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel-0.8.1-installer-linux-x86_64.sh && sudo /bin/bash bazel-0.8.1-installer-linux-x86_64.sh
- Install flex, bison and openssl library: sudo apt-get install flex bison libssl-dev
- Install g++ (v4.8.2 or later): sudo apt-get install g++
- bazel build //:all
-
Install bazel.
wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel-0.8.1-installer-linux-x86_64.sh && sudo /bin/bash bazel-0.8.1-installer-linux-x86_64.sh
- sudo yum install flex bison patch openssl-devel
- sudo yum install gcc-c++ (v4.8.2 or later)
- bazel build //:all
You may brew and enjoy a cup of coffee waiting for the tedious building process
- C++11,GCC4.8以上
- openssl
- zlib
- boost(thread, filesystem, 1.56以上)
- rapidjson
- apache arrow
- gflags
- glog
- snappy
- google re2
- protobuf
- rocksdb
- brpc (开启GLOG, 额外依赖leveldb)
- braft (开启GLOG)
- libmariadb(Baikal-Client需要, 一个高性能异步Mysql连接池)
- tcmalloc, gperf (可选)
上述依赖CMAKE会自动下载编译。如果指定了编译选项-DWITH_SYSTEM_LIBS=ON
,则会使用系统依赖,需要自行手动安装。
选项 | 默认值 | 说明 |
---|---|---|
WITH_BAIKAL_CLIENT | ON | 编译 baikal-client |
DEBUG | OFF | 开启DEBUG |
WITH_SYSTEM_LIBS | OFF | 查找系统目录的库,而不是CMake自动依赖。 |
WITH_DEBUG_SYMBOLS | OFF | 附带debug symbols |
WITH_GPERF | ON | 链接tcmalloc and profiler |
Ubuntu/WSL
sudo apt-get install cmake flex bison libssl-dev
Centos
yum install cmake flex bison
yum install openssl-devel
mkdir buildenv && cd buildenv
cmake .. && make