]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | #!/usr/bin/env bash |
2 | set -ex | |
3 | ||
7c673cae FG |
4 | ############################################ |
5 | # Helper functions | |
6 | ############################################ | |
494da23a | 7 | source $(dirname $0)/../ceph-helpers-root.sh |
7c673cae | 8 | |
7c673cae FG |
9 | ############################################ |
10 | # Install required tools | |
11 | ############################################ | |
12 | echo "Install required tools" | |
11fdf7f2 | 13 | install git cmake |
7c673cae FG |
14 | |
15 | CURRENT_PATH=`pwd` | |
16 | ||
17 | ############################################ | |
18 | # Compile&Start RocksDB | |
19 | ############################################ | |
20 | # install prerequisites | |
21 | # for rocksdb | |
494da23a TL |
22 | case $(distro_id) in |
23 | ubuntu|debian|devuan) | |
11fdf7f2 | 24 | install g++ libsnappy-dev zlib1g-dev libbz2-dev libradospp-dev |
7c673cae | 25 | ;; |
494da23a | 26 | centos|fedora|rhel) |
11fdf7f2 | 27 | install gcc-c++.x86_64 snappy-devel zlib zlib-devel bzip2 bzip2-devel libradospp-devel.x86_64 |
7c673cae | 28 | ;; |
494da23a TL |
29 | opensuse*|suse|sles) |
30 | install gcc-c++ snappy-devel zlib-devel libbz2-devel libradospp-devel | |
31 | ;; | |
7c673cae | 32 | *) |
494da23a | 33 | echo "$(distro_id) is unknown, $@ will have to be installed manually." |
7c673cae FG |
34 | ;; |
35 | esac | |
36 | ||
37 | # # gflags | |
38 | # sudo yum install gflags-devel | |
39 | # | |
40 | # wget https://github.com/schuhschuh/gflags/archive/master.zip | |
41 | # unzip master.zip | |
42 | # cd gflags-master | |
43 | # mkdir build && cd build | |
44 | # export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1 | |
45 | # make && make install | |
46 | ||
47 | # # snappy-devel | |
48 | ||
49 | ||
50 | echo "Compile rocksdb" | |
51 | if [ -e rocksdb ]; then | |
52 | rm -fr rocksdb | |
53 | fi | |
224ce89b | 54 | git clone https://github.com/facebook/rocksdb.git --depth 1 |
7c673cae FG |
55 | |
56 | # compile code | |
57 | cd rocksdb | |
11fdf7f2 TL |
58 | mkdir build && cd build && cmake -DWITH_LIBRADOS=ON -DWITH_SNAPPY=ON -DWITH_GFLAGS=OFF -DFAIL_ON_WARNINGS=OFF .. |
59 | make rocksdb_env_librados_test -j8 | |
7c673cae FG |
60 | |
61 | echo "Copy ceph.conf" | |
62 | # prepare ceph.conf | |
63 | mkdir -p ../ceph/src/ | |
64 | if [ -f "/etc/ceph/ceph.conf" ]; then | |
65 | cp /etc/ceph/ceph.conf ../ceph/src/ | |
66 | elif [ -f "/etc/ceph/ceph/ceph.conf" ]; then | |
67 | cp /etc/ceph/ceph/ceph.conf ../ceph/src/ | |
68 | else | |
69 | echo "/etc/ceph/ceph/ceph.conf doesn't exist" | |
70 | fi | |
71 | ||
72 | echo "Run EnvLibrados test" | |
73 | # run test | |
74 | if [ -f "../ceph/src/ceph.conf" ] | |
75 | then | |
76 | cp env_librados_test ~/cephtest/archive | |
77 | ./env_librados_test | |
78 | else | |
79 | echo "../ceph/src/ceph.conf doesn't exist" | |
80 | fi | |
81 | cd ${CURRENT_PATH} |