Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / do_cmake.sh
1 #!/bin/sh -x
2 git submodule update --init --recursive
3 if test -e build; then
4     echo 'build dir already exists; rm -rf build and re-run'
5     exit 1
6 fi
7
8 ARGS=""
9 if which ccache ; then
10     echo "enabling ccache"
11     ARGS="$ARGS -DWITH_CCACHE=ON"
12 fi
13
14 mkdir build
15 cd build
16 cmake -DBOOST_J=$(nproc) $ARGS "$@" ..
17
18 # minimal config to find plugins
19 cat <<EOF > ceph.conf
20 plugin dir = lib
21 erasure code dir = lib
22 EOF
23
24 # give vstart a (hopefully) unique mon port to start with
25 echo $(( RANDOM % 1000 + 40000 )) > .ceph_port
26
27 echo done.