4 ############################################
6 ############################################
7 source $
(dirname $0)/..
/ceph-helpers-root.sh
9 ############################################
10 # Install required tools
11 ############################################
12 echo "Install required tools"
16 ############################################
17 # Compile&Start RocksDB
18 ############################################
19 # install prerequisites
23 install git g
++ libsnappy-dev zlib1g-dev libbz2-dev libradospp-dev
24 case $
(distro_version
) in
26 install_cmake3_on_xenial
36 # centos needs PowerTools repo for snappy-devel
37 test -x /usr
/bin
/dnf
&& sudo dnf config-manager
--set-enabled PowerTools || true
40 # RHEL needs CRB repo for snappy-devel
41 sudo subscription-manager repos
--enable "codeready-builder-for-rhel-8-x86_64-rpms"
44 install git gcc-c
++.x86_64 snappy-devel zlib zlib-devel
bzip2 bzip2-devel libradospp-devel.x86_64 cmake
47 install git gcc-c
++ snappy-devel zlib-devel libbz2-devel libradospp-devel
50 echo "$(distro_id) is unknown, $@ will have to be installed manually."
55 # sudo yum install gflags-devel
57 # wget https://github.com/schuhschuh/gflags/archive/master.zip
60 # mkdir build && cd build
61 # export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
62 # make && make install
67 echo "Compile rocksdb"
68 if [ -e rocksdb
]; then
71 git clone https
://github.com
/facebook
/rocksdb.git
--depth 1
75 if type cmake3
> /dev
/null
2>&1 ; then
81 [ -z "$BUILD_DIR" ] && BUILD_DIR
=build
82 mkdir
${BUILD_DIR} && cd ${BUILD_DIR} && ${CMAKE} -DCMAKE_BUILD_TYPE=Debug
-DWITH_TESTS=ON
-DWITH_LIBRADOS=ON
-DWITH_SNAPPY=ON
-DWITH_GFLAGS=OFF
-DFAIL_ON_WARNINGS=OFF ..
83 make rocksdb_env_librados_test
-j8
88 if [ -f "/etc/ceph/ceph.conf" ]; then
89 cp /etc
/ceph
/ceph.conf ..
/ceph
/src
/
90 elif [ -f "/etc/ceph/ceph/ceph.conf" ]; then
91 cp /etc
/ceph
/ceph
/ceph.conf ..
/ceph
/src
/
93 echo "/etc/ceph/ceph/ceph.conf doesn't exist"
96 echo "Run EnvLibrados test"
98 if [ -f "../ceph/src/ceph.conf" ]
100 cp env_librados_test ~
/cephtest
/archive
103 echo "../ceph/src/ceph.conf doesn't exist"