2016-03-24 11:47:34 +00:00
|
|
|
#!/bin/sh -xve
|
2017-09-25 21:01:49 +00:00
|
|
|
export NPROC=`sysctl -n hw.ncpu`
|
2016-03-24 11:47:34 +00:00
|
|
|
|
|
|
|
if [ x"$1"x = x"--deps"x ]; then
|
|
|
|
sudo ./install-deps.sh
|
|
|
|
fi
|
2016-11-20 21:17:15 +00:00
|
|
|
|
|
|
|
if [ x"$CEPH_DEV"x != xx ]; then
|
|
|
|
BUILDOPTS="$BUILDOPTS V=1 VERBOSE=1"
|
|
|
|
CXX_FLAGS_DEBUG="-DCEPH_DEV"
|
|
|
|
C_FLAGS_DEBUG="-DCEPH_DEV"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# To test with a new release Clang, use with cmake:
|
|
|
|
# -D CMAKE_CXX_COMPILER="/usr/local/bin/clang++-devel" \
|
|
|
|
# -D CMAKE_C_COMPILER="/usr/local/bin/clang-devel" \
|
2018-11-25 14:38:54 +00:00
|
|
|
COMPILE_FLAGS="-O0 -g"
|
2019-03-06 22:23:33 +00:00
|
|
|
COMPILE_FLAGS="${COMPILE_FLAGS} -fuse-ld=/usr/local/bin/ld -Wno-unused-command-line-argument"
|
2018-11-25 14:38:54 +00:00
|
|
|
CMAKE_CXX_FLAGS_DEBUG="$CXX_FLAGS_DEBUG $COMPILE_FLAGS"
|
|
|
|
CMAKE_C_FLAGS_DEBUG="$C_FLAGS_DEBUG $COMPILE_FLAGS"
|
|
|
|
|
2018-06-14 12:27:08 +00:00
|
|
|
#
|
|
|
|
# On FreeBSD we need to preinstall all the tools that are required for building
|
|
|
|
# dashboard, because versions fetched are not working on FreeBSD.
|
|
|
|
|
2016-11-20 21:17:15 +00:00
|
|
|
|
2019-08-21 06:27:42 +00:00
|
|
|
[ -z "$BUILD_DIR" ] && BUILD_DIR=build
|
|
|
|
|
2019-07-30 14:56:01 +00:00
|
|
|
echo Keeping the old build
|
2019-08-21 06:27:42 +00:00
|
|
|
if [ -d ${BUILD_DIR}.old ]; then
|
|
|
|
sudo mv ${BUILD_DIR}.old ${BUILD_DIR}.del
|
|
|
|
sudo rm -rf ${BUILD_DIR}.del &
|
2019-07-30 14:56:01 +00:00
|
|
|
fi
|
2019-08-21 06:27:42 +00:00
|
|
|
if [ -d ${BUILD_DIR} ]; then
|
|
|
|
sudo mv ${BUILD_DIR} ${BUILD_DIR}.old
|
2018-06-14 12:27:08 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-21 06:27:42 +00:00
|
|
|
mkdir ${BUILD_DIR}
|
2018-06-14 12:27:08 +00:00
|
|
|
./do_cmake.sh "$*" \
|
|
|
|
-D WITH_CCACHE=ON \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D CMAKE_BUILD_TYPE=Debug \
|
2019-07-30 14:56:01 +00:00
|
|
|
-D CMAKE_CXX_FLAGS_DEBUG="$CMAKE_CXX_FLAGS_DEBUG" \
|
|
|
|
-D CMAKE_C_FLAGS_DEBUG="$CMAKE_C_FLAGS_DEBUG" \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D ENABLE_GIT_VERSION=OFF \
|
2019-02-21 11:17:04 +00:00
|
|
|
-D WITH_RADOSGW_AMQP_ENDPOINT=OFF \
|
2019-10-10 13:27:35 +00:00
|
|
|
-D WITH_RADOSGW_KAFKA_ENDPOINT=OFF \
|
2016-12-02 10:11:57 +00:00
|
|
|
-D WITH_SYSTEM_BOOST=ON \
|
2018-06-14 12:27:08 +00:00
|
|
|
-D WITH_SYSTEM_NPM=ON \
|
2016-10-19 08:58:22 +00:00
|
|
|
-D WITH_LTTNG=OFF \
|
2018-06-14 12:27:08 +00:00
|
|
|
-D WITH_BABELTRACE=OFF \
|
|
|
|
-D WITH_SEASTAR=OFF \
|
2017-04-02 00:08:51 +00:00
|
|
|
-D WITH_FUSE=ON \
|
2017-01-05 11:01:57 +00:00
|
|
|
-D WITH_KRBD=OFF \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D WITH_XFS=OFF \
|
2018-11-28 13:00:57 +00:00
|
|
|
-D WITH_KVS=ON \
|
2017-02-07 22:42:41 +00:00
|
|
|
-D CEPH_MAN_DIR=man \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D WITH_LIBCEPHFS=OFF \
|
|
|
|
-D WITH_CEPHFS=OFF \
|
2017-04-02 00:08:51 +00:00
|
|
|
-D WITH_MGR=YES \
|
2018-06-28 05:28:20 +00:00
|
|
|
-D WITH_RDMA=OFF \
|
2017-11-15 12:57:25 +00:00
|
|
|
-D WITH_SPDK=OFF \
|
2016-09-15 06:16:57 +00:00
|
|
|
2>&1 | tee cmake.log
|
|
|
|
|
2019-07-30 14:56:01 +00:00
|
|
|
echo -n "start building: "; date
|
|
|
|
printenv
|
|
|
|
|
2019-08-21 06:27:42 +00:00
|
|
|
cd ${BUILD_DIR}
|
2019-07-30 14:56:01 +00:00
|
|
|
gmake -j$CPUS V=1 VERBOSE=1
|
|
|
|
gmake tests
|
|
|
|
echo -n "start testing: "; date ;
|
|
|
|
ctest -j $CPUS || RETEST=1
|
|
|
|
|
|
|
|
echo "Testing result, retest: = " $RETEST
|
|
|
|
|
|
|
|
if [ $RETEST -eq 1 ]; then
|
|
|
|
# make sure no leftovers are there
|
|
|
|
killall ceph-osd || true
|
|
|
|
killall ceph-mgr || true
|
|
|
|
killall ceph-mds || true
|
|
|
|
killall ceph-mon || true
|
|
|
|
# clean up after testing
|
|
|
|
rm -rf td/* /tmp/td src/test/td/* || true
|
|
|
|
rm -rf /tmp/ceph-asok.* || true
|
|
|
|
rm -rf /tmp/cores.* || true
|
|
|
|
rm -rf /tmp/*.core || true
|
|
|
|
|
|
|
|
ctest --output-on-failure --rerun-failed
|
|
|
|
fi
|
|
|
|
|
|
|
|
STATUS=$?
|
|
|
|
|
|
|
|
# cleanup after the fact
|
|
|
|
rm -rf /tmp/tmp* /tmp/foo /tmp/pip* /tmp/big* /tmp/pymp* $TMPDIR || true
|
|
|
|
|
|
|
|
echo -n "Ended: "; date
|
2017-04-02 00:08:51 +00:00
|
|
|
|
2019-07-30 14:56:01 +00:00
|
|
|
return $STATUS
|
2016-03-24 11:47:34 +00:00
|
|
|
|