Skip to content

Latest commit

 

History

History
76 lines (67 loc) · 2.93 KB

BUILD-mytopling.md

File metadata and controls

76 lines (67 loc) · 2.93 KB

This guide was tested on Alibaba Cloud Linux 3.2104 LTS 64 bit.

0. Prerequisite

Install required packages.

sudo yum config-manager --set-enabled powertools
sudo yum install -y liburing-devel
sudo yum install -y openssl-devel \
                    ncurses-devel \
                    libtirpc-devel \
                    rpcgen \
                    bison \
                    libudev-devel
# ubuntu/debian
sudo apt install -y g++-12 gcc-12 perl libaio-dev liburing-dev bison flex byacc libudev-dev libtirpc-dev libldap-dev libcurlpp-dev libcurl4-openssl-dev pkgconf libpkgconf-dev zlib1g-dev libgrpc-dev doxygen libsasl2-dev libsnappy-dev libnfs-dev make cmake git libncurses-dev

1. First build ToplingDB

  cd /path/to/topling # you should create this dir
  git clone https://github.com/topling/toplingdb.git
  cd toplingdb
  git submodule update --init --recursive
  make -j`nproc` DEBUG_LEVEL=0 shared_lib
  sudo make install-shared \
       PREFIX=/path/to/install/dir \
       LIBDIR=/path/to/install/dir/lib64

PREFIX and LIBDIR are optional for make install-shared:

PREFIX default: /usr/local
LIBDIR default: ${PREFIX}/lib

2. Build MyTopling

Now we have compiled ToplingDB and topling-zip, MyTopling requires these two on compiling and running.

Please make sure repository toplingdb and mytopling are cloned to same parent dir(/path/to/topling).

2.1. Compile time dependencies(include dirs)

include dirs are auto added in mytopling build.sh.

 /path/to/toplingdb
 /path/to/toplingdb/include
 /path/to/toplingdb/sideplugin/rockside/src
 /path/to/toplingdb/sideplugin/topling-zip/src

2.2. Link and Run time dependencies(lib dirs)

You should have installed ToplingDB libs to LIBDIR above.

2.3. Calling cmake for release build

  cd /path/to/topling
  git clone https://github.com/topling/mytopling.git
  cd mytopling
  git submodule update --init --recursive
  export CXX=g++ # optional, for example you want to use clang++ or other CXX
  export CC=gcc  # optional, for example you want to use clang or other CC
  export CXX_HOME=/usr # optional, if you want to use an alternative CXX
  bash build.sh -DTOPLING_LIB_DIR=/path/to/LIBDIR \
                -DCMAKE_INSTALL_PREFIX=/path/to/mytopling/install/dir

2.4. Calling make

MyTopling requires some libs generated by in compiling MyTopling, so we need to add such lib dirs to LD_LIBRARY_PATH.

  cd build-rls
  export LD_LIBRARY_PATH=`pwd`/lib:`pwd`/lib/plugin:plugin_output_directory
  make -j`nproc`
  sudo make install

3. Enjoy MyTopling

Now you can run MyTopling Server: start_mysqld.sh

To explore more feature of MyTopling Server, read and modify mytopling.json.

Reference: ToplingDB SidePlugin Manual