-#!/bin/bash
+#!/usr/bin/env bash
#
# Ceph distributed storage system
#
fi
}
+function detect_ceph_dev_pkgs() {
+ local cmake_opts
+ local boost_root=/opt/ceph
+ if test -f $boost_root/include/boost/config.hpp; then
+ cmake_opts+=" -DWITH_SYSTEM_BOOST=ON -DBOOST_ROOT=$boost_root"
+ else
+ cmake_opts+=" -DBOOST_J=$(get_processors)"
+ fi
+ echo "$cmake_opts"
+}
+
function run() {
local install_cmd
local which_pkg="which"
fi
if test -f ./install-deps.sh ; then
- $DRY_RUN ./install-deps.sh || return 1
+ export WITH_SEASTAR=1
+ export FOR_MAKE_CHECK=1
+ $DRY_RUN source ./install-deps.sh || return 1
trap clean_up_after_myself EXIT
fi
BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS}
test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS"
CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
-
- if type python2 > /dev/null 2>&1 ; then
- # gtest-parallel requires Python 2
- CMAKE_PYTHON_OPTS="-DWITH_GTEST_PARALLEL=ON"
- else
- CMAKE_PYTHON_OPTS="-DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3 -DWITH_GTEST_PARALLEL=OFF"
- fi
-
- CMAKE_BUILD_OPTS=""
-
+ CMAKE_BUILD_OPTS="-DWITH_GTEST_PARALLEL=ON -DWITH_FIO=ON -DWITH_SEASTAR=ON"
+ CMAKE_BUILD_OPTS+=$(detect_ceph_dev_pkgs)
cat <<EOM
Note that the binaries produced by this script do not contain correct time
and git version information, which may make them unsuitable for debugging
EOM
save_ccache_conf
# remove the entropy generated by the date/time embedded in the build
- CMAKE_BUILD_OPTS="$CMAKE_BUILD_OPTS -DENABLE_GIT_VERSION=OFF"
+ CMAKE_BUILD_OPTS+=" -DENABLE_GIT_VERSION=OFF"
$DRY_RUN export SOURCE_DATE_EPOCH="946684800"
$DRY_RUN ccache -o sloppiness=time_macros
$DRY_RUN ccache -o run_second_cpp=true
echo "Current ccache max_size setting:"
ccache -p | grep max_size
fi
- $DRY_RUN ccache -z # Reset the ccache statistics
+ $DRY_RUN ccache -sz # Reset the ccache statistics and show the current configuration
- $DRY_RUN ./do_cmake.sh $CMAKE_BUILD_OPTS $CMAKE_PYTHON_OPTS $@ || return 1
+ $DRY_RUN ./do_cmake.sh $CMAKE_BUILD_OPTS $@ || return 1
$DRY_RUN cd build
$DRY_RUN make $BUILD_MAKEOPTS tests || return 1
return 1
fi
+ # increase the aio-max-nr, which is by default 65536. we could reach this
+ # limit while running seastar tests and bluestore tests.
+ $DRY_RUN sudo sysctl -q -w fs.aio-max-nr=$((65536 * 16))
+
if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
- rm -f ${TMPDIR:-/tmp}/ceph-asok.*
+ rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
return 1
fi
}