Commit 0281365e authored by Sophie Wenzel-Teuber's avatar Sophie Wenzel-Teuber
Browse files

Update and optimise the build scripts

Changelog:
* Remove build of Phobos and Proxygen from Deimos build script - has to be called separately now before building Deimos!
* Update noinstall-headers of Phobos for new Phobos & Deimos version
* Change CMAKE_PREFIX_PATH in Deimos (didn't work before) and add CMAKE_EXPORT_COMPILE_COMMANDS
* run Deimos tests as Cmake targets
* Change PowerTools to powertools
parent 6ab5fc66
......@@ -4,5 +4,5 @@ RUN yum -y update
COPY . /home/superdeimos
RUN cd /home/superdeimos && ./src/phobos/build.sh -j 1
RUN cd /home/superdeimos && ./src/deimos/build.sh -j 4 --skip-stages=test --skip=deimos
# RUN cd /home/superdeimos && ./src/deimos/build.sh -j 4 --only=deimos
RUN cd /home/superdeimos && ./src/proxygen/build.sh -j 4 --skip-stages=test
#RUN cd /home/superdeimos && ./src/deimos/build.sh -j 4
PATH=/home/superdeimos/build/install/phobos/bin:/home/superdeimos/build/install/phobos/sbin:/opt/rh/rh-postgresql95/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PATH=/home/superdeimos/build/install/phobos/sbin:/home/superdeimos/build/install/phobos/bin:/opt/rh/rh-postgresql95/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LD_LIBRARY_PATH=:/home/superdeimos/build/install/phobos/lib:/opt/rh/rh-postgresql95/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib:/opt/rh/devtoolset-7/root/usr/lib64/dyninst:/opt/rh/devtoolset-7/root/usr/lib/dyninst:
PYTHONPATH=/home/superdeimos/build/install/phobos/lib/python2.7/site-packages:/opt/rh/devtoolset-7/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-7/root/usr/lib/python2.7/site-packages
\ No newline at end of file
PYTHONPATH=/home/superdeimos/build/install/phobos/lib/python2.7/site-packages:/opt/rh/devtoolset-7/root/usr/lib64/python2.7/site-packages
......@@ -2,16 +2,17 @@ SUFFIXES = .pb-c.h
protodir=../proto
proto_headers=pho_proto_common.pb-c.h pho_proto_lrs.pb-c.h
noinst_HEADERS=pho_cfg.h pho_comm.h pho_common.h pho_dss.h pho_io.h \
noinst_HEADERS=pho_cfg.h pho_comm.h pho_dss.h pho_io.h \
pho_layout.h pho_ldm.h pho_mapper.h pho_srl_common.h \
pho_srl_lrs.h pho_type_utils.h pho_types.h slist.h \
pho_srl_lrs.h pho_type_utils.h slist.h \
$(proto_headers)
# Required headers:
# - phobos_store.h main program interface
# - phobos_admin.h admin command interface
# - pho_attrs.h access and manipulate object metadata
include_HEADERS=pho_types.h pho_attrs.h phobos_store.h
include_HEADERS=pho_attrs.h phobos_store.h phobos_admin.h \
pho_types.h pho_common.h
$(proto_headers): $(protodir)/gen-proto.stamp
......
......@@ -13,11 +13,8 @@
# Exit on any errors
set -o errexit
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
external_dir="${script_dir}/../../external"
source "${script_dir}/../phobos/build.sh"
source "${script_dir}/../proxygen/build.sh"
# source "${script_dir}/../phobos/build.sh"
# source "${script_dir}/../proxygen/build.sh"
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
external_dir="${script_dir}/../../external"
......@@ -50,6 +47,7 @@ then
install_dependencies
fi
configure
#
# Build Deimos
......@@ -74,7 +72,8 @@ then
-DDEIMOS_BUILD_TESTS=ON )
fi
CMAKE_PREFIX_PATH=$(install_dir proxygen):$(install_dir folly):$(install_dir fmt):$(install_dir fizz):$(install_dir wangle):$(install_dir gflags):"${CMAKE_PREFIX_PATH}"
# CMAKE_PREFIX_PATH=$(install_dir proxygen):$(install_dir folly):$(install_dir fmt):$(install_dir fizz):$(install_dir wangle):$(install_dir gflags):"${CMAKE_PREFIX_PATH}"
CMAKE_PREFIX_PATH=${deimos_install_dir}/..
# Add glib-2.0
CMAKE_C_FLAGS="${CMAKE_C_FLAGS} $(pkg-config glib-2.0 --cflags)"
......@@ -99,7 +98,8 @@ then
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}"
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
make ${MAKE_FLAGS[@]}
fi
......@@ -110,7 +110,7 @@ then
source "${script_dir}"/../phobos/testdb-setup.sh
setup_phobos_scripts
setup_phobos_scripts ${deimos_build_dir}/../phobos/source/
#
# Setup postgres
......@@ -122,15 +122,8 @@ then
start_phobos ${deimos_build_dir}
ls
ls test
pushd test/unit_tests
../tests
popd
pushd test/integration_tests
python3 -m unittest client
popd
#make test ARGS=-V
make test ARGS=-V
make integration_tests
# Shutdown postgres
stop_postgres
......
......@@ -13,6 +13,10 @@
# Install dependencies
#
function cmake() {
command cmake3 "$@"
}
function install_dependencies() {
yum install -y \
glib2 glib2-devel
......@@ -104,5 +108,14 @@ function configure() {
source scl_source enable rh-postgresql95
set -o errexit
set_bash_verbosity
#
# Set build flags and environment variables
#
phobos_install_dir=$(install_dir phobos)
export PATH=${PATH}:${phobos_install_dir}/bin:${phobos_install_dir}/sbin
export LIBPQ_CFLAGS=$(pg_config --cflags)
export LIBPQ_LIBS=-lpq
}
......@@ -20,7 +20,7 @@ function install_dependencies() {
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
dnf config-manager --set-enabled powertools
dnf install -y \
glib2 glib2-devel
......@@ -38,6 +38,6 @@ function install_dependencies() {
}
function configure() {
echo "no configuration required"
phobos_install_dir=$(install_dir phobos)
}
......@@ -84,7 +84,7 @@ then
# Some pre-test installation
#
cp src/tests/phobos.conf /etc/
sed -i '/lrs/ a default_family = dir' /etc/phobos.conf
sed -i '/store/ a default_family = dir' /etc/phobos.conf
#
......@@ -98,6 +98,8 @@ then
source "${script_dir}"/testdb-setup.sh
setup_phobos_scripts ${phobos_build_dir}/source/
# Setup test db dir
phobos_test_dir="${build_dir}"/phobos/test
create_database ${phobos_test_dir}
......
......@@ -21,7 +21,7 @@ function install_dependencies() {
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
dnf config-manager --set-enabled powertools
# Regular packages
dnf install -y \
......
......@@ -17,11 +17,11 @@
setup_phobos_scripts () {
mkdir -p phobos-scripts
cp -r ${external_dir}/phobos/scripts/ phobos-scripts
phobos_script_dir=phobos-scripts/
phobos_source_dir=$1
sed -i 's/\$PHO_LAYOUTLIB_PATH/$PHO_LAYOUTLIB_PATH:$LD_LIBRARY_PATH/' ${phobos_source_dir}src/tests/test_env.sh
sed -i 's/\$PHO_PYTHON_PATH/$PHO_PYTHON_PATH:$PYTHONPATH/' ${phobos_source_dir}src/tests/test_env.sh
export PATH=${phobos_install_dir}/bin:${phobos_install_dir}/sbin:${PATH}
export PYTHONPATH="${phobos_install_dir}"/lib/python2.7/site-packages:"${PYTHONPATH}"
......@@ -55,7 +55,7 @@ setup_phobos_db () {
export PHOBOS_LAYOUT_RAID1_repl_count=1
# Initialize phobos db
su postgres -c "bash ${phobos_script_dir}scripts/phobos_db_local setup_db -s -p phobos"
su postgres -c "bash ${phobos_source_dir}/scripts/phobos_db_local setup_db -s -p phobos"
}
start_phobos () {
......
......@@ -20,7 +20,7 @@ function install_dependencies() {
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
dnf config-manager --set-enabled powertools
# Regular packages
dnf install -y \
......
......@@ -20,7 +20,7 @@ export PYTHONPATH=/home/superdeimos/build/install/phobos/lib/python2.7/site-pack
# call functions for db
setup_phobos_scripts
setup_phobos_scripts ${script_dir}/build/build/phobos/source/
create_database $test_dir
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment