Commit 10062f94 authored by Ciarán Ó Rourke's avatar Ciarán Ó Rourke
Browse files

Simplify CentOS8 build

Use repository packages for Catch2 and spdlog. Fix an issue where the
Proxygen OS script is source instead of the Deimos one.

Change log:
* use separate environment lists for CentOS7 and CentOS8
* use Catch2 and spdlog repository packages on CentOS8
* remove yum command from centos8 script
* fix case where deimos/centos8.sh script is not used
* replace cd with pushd to preseerve path
parent 3b98532e
PATH=/home/superdeimos/build/install/phobos/bin:/home/superdeimos/build/install/phobos/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
LD_LIBRARY_PATH=:/home/superdeimos/build/install/phobos/lib:$LD_LIBRARY_PATH
PYTHONPATH=/home/superdeimos/build/install/phobos/lib/python2.7/site-packages:$PYTHONPATH
......@@ -19,6 +19,9 @@ external_dir="${script_dir}/../../external"
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"
# Default options
build_static=true
......@@ -48,62 +51,6 @@ then
fi
#
# Build Catch2
#
print_section "Build Catch2"
catch2_source_dir=${external_dir}/catch2
catch2_build_dir=${build_dir}/catch2
catch2_install_dir=$(install_dir catch2)
if should_build catch2
then
mkdir -p "${catch2_build_dir}"
pushd "${catch2_build_dir}"
cmake "${catch2_source_dir}" \
"${CMAKE_FLAGS[@]}" \
-DCMAKE_INSTALL_PREFIX="${catch2_install_dir}" \
-DBUILD_TESTING=OFF
make "${MAKE_FLAGS[@]}"
make install
popd
fi
export CMAKE_PREFIX_PATH="$(install_dir catch2):${CMAKE_PREFIX_PATH}"
#
# Build spdlog
#
print_section "Build spdlog"
spdlog_source_dir=${external_dir}/spdlog
spdlog_build_dir=${build_dir}/spdlog
spdlog_install_dir=$(install_dir spdlog)
if should_build spdlog
then
mkdir -p "${spdlog_build_dir}"
pushd "${spdlog_build_dir}"
cmake "${spdlog_source_dir}" \
"${CMAKE_FLAGS[@]}" \
-DCMAKE_INSTALL_PREFIX="${spdlog_install_dir}" \
-DSPDLOG_BUILD_TESTS=OFF
make "${MAKE_FLAGS[@]}"
make install
popd
fi
export CMAKE_PREFIX_PATH="$(install_dir spdlog):${CMAKE_PREFIX_PATH}"
#
# Build Deimos
#
......
......@@ -29,6 +29,60 @@ function install_dependencies() {
yum install -y \
cmake3 \
boost169-devel
#
# Build Catch2
#
print_section "Build Catch2"
catch2_source_dir=${external_dir}/catch2
catch2_build_dir=${build_dir}/catch2
catch2_install_dir=$(install_dir catch2)
if should_build catch2
then
mkdir -p "${catch2_build_dir}"
pushd "${catch2_build_dir}"
cmake "${catch2_source_dir}" \
"${CMAKE_FLAGS[@]}" \
-DCMAKE_INSTALL_PREFIX="${catch2_install_dir}" \
-DBUILD_TESTING=OFF
make "${MAKE_FLAGS[@]}"
make install
popd
fi
export CMAKE_PREFIX_PATH="$(install_dir catch2):${CMAKE_PREFIX_PATH}"
#
# Build spdlog
#
print_section "Build spdlog"
spdlog_source_dir=${external_dir}/spdlog
spdlog_build_dir=${build_dir}/spdlog
spdlog_install_dir=$(install_dir spdlog)
if should_build spdlog
then
mkdir -p "${spdlog_build_dir}"
pushd "${spdlog_build_dir}"
cmake "${spdlog_source_dir}" \
"${CMAKE_FLAGS[@]}" \
-DCMAKE_INSTALL_PREFIX="${spdlog_install_dir}" \
-DSPDLOG_BUILD_TESTS=OFF
make "${MAKE_FLAGS[@]}"
make install
popd
fi
export CMAKE_PREFIX_PATH="$(install_dir spdlog):${CMAKE_PREFIX_PATH}"
}
function configure() {
......
......@@ -22,17 +22,19 @@ function install_dependencies() {
dnf config-manager --set-enabled PowerTools
yum install -y \
dnf install -y \
glib2 glib2-devel
yum install -y \
dnf install -y \
python3-pip
python3 -m pip install boto3
yum install -y \
dnf install -y \
cmake \
boost-devel
boost-devel \
catch-devel \
spdlog
}
function configure() {
......
......@@ -215,6 +215,7 @@ then
fi
make install
popd
fi
export CMAKE_PREFIX_PATH="${wangle_install_dir}:${CMAKE_PREFIX_PATH}"
......@@ -232,7 +233,7 @@ proxygen_install_dir=$(install_dir proxygen)
if should_build proxygen
then
mkdir -p "${proxygen_build_dir}"
cd "${proxygen_build_dir}"
pushd "${proxygen_build_dir}"
declare -a PROXYGEN_CMAKE_FLAGS
if should_run_stage proxygen:test
......@@ -263,4 +264,5 @@ then
fi
make install
popd
fi
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