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

Support CentOS8

Provide scripts for implementing build functions required for building
Proxygen, Phobos, and Deimos on CentOS8

Change log:
* generalise build-common.sh
* implement CentOS8 Proxygen functions
* implement CentOS8 Phobos functions
* implement CentOS8 Deimos functions
parent e2ce407f
......@@ -27,12 +27,10 @@ function process_args() {
image=${1#--image=}
shift
;;
-j) # -j 4
make_threads=${2#-j=}
shift 2
;;
--skip=*)
skip_packages=${1#--skip=}
shift
......@@ -49,7 +47,6 @@ function process_args() {
skip_stages=${1#--skip-stages=*}
shift
;;
--verbose)
verbose=true
shift
......@@ -58,7 +55,6 @@ function process_args() {
verbose=false
shift
;;
--prefix=*)
install_root=${1#--prefix=}
shift
......@@ -71,7 +67,6 @@ function process_args() {
namespaced_install=false
shift
;;
--build-static)
build_static=true
shift
......@@ -80,7 +75,6 @@ function process_args() {
build_static=false
shift
;;
*)
echo >&2 "Unknown argument: $1"
exit 1
......@@ -245,16 +239,16 @@ function os() {
if grep -q "CentOS Linux 7" /etc/os-release
then
echo "centos:7"
return
return
fi
if grep -q "CentOS Linux 8" /etc/os-release
then
echo "centos:8"
return
return
fi
echo "unknown"
echo "unknown OS"
return
}
......@@ -292,47 +286,55 @@ function print_section() {
set_bash_verbosity
# Setup yum and install dev tools
yum_build_dir="${build_dir}/yum"
# TODO: generalise this
case "$(os)" in
centos:7)
# Setup yum and install dev tools
yum_build_dir="${build_dir}/yum"
if should_build system_packages
then
# Setup yum cachedir to point to ${yum_cachedir} and enable caching
mkdir -p "${yum_cachedir}"
yum_build_dir="$(cd "${yum_cachedir}" && pwd)"
if should_build system_packages
then
# Setup yum cachedir to point to ${yum_cachedir} and enable caching
mkdir -p "${yum_cachedir}"
yum_build_dir="$(cd "${yum_cachedir}" && pwd)"
mkdir -p "${yum_cachedir}/cache"
mkdir -p "${yum_cachedir}/cache"
cp /etc/yum.conf "${yum_cachedir}/yum.conf"
yum_config="${yum_cachedir}/yum.conf"
sed -i "s#^cachedir=.*\$#cachedir=${yum_cachedir}/cache#" "${yum_config}"
sed -i "s#^keepcache=0#keepcache=1#" "${yum_config}"
echo "skip_missing_names_on_install=False" >> "${yum_config}"
fi
# Wrap Yum to add custom config flag
function yum() {
command yum --config="${yum_cachedir}/yum.conf" "$@"
}
cp /etc/yum.conf "${yum_cachedir}/yum.conf"
yum_config="${yum_cachedir}/yum.conf"
sed -i "s#^cachedir=.*\$#cachedir=${yum_cachedir}/cache#" "${yum_config}"
sed -i "s#^keepcache=0#keepcache=1#" "${yum_config}"
echo "skip_missing_names_on_install=False" >> "${yum_config}"
fi
if should_build system_packages
then
# Install SCL and install gcc-7
yum install -y \
centos-release-scl
# Wrap Yum to add custom config flag
function yum() {
command yum --config="${yum_cachedir}/yum.conf" "$@"
}
yum install -y \
devtoolset-7-gcc devtoolset-7-gcc-c++
fi
if should_build system_packages
then
# Install SCL and install gcc-7
yum install -y \
centos-release-scl
# Enable gcc-9
# Temporarily disable printing and error checking
set_bash_verbosity false
set +o errexit
source scl_source enable devtoolset-7
set -o errexit
set_bash_verbosity
yum install -y \
devtoolset-7-gcc devtoolset-7-gcc-c++
fi
# Enable gcc-7
# Temporarily disable printing and error checking
set_bash_verbosity false
set +o errexit
source scl_source enable devtoolset-7
set -o errexit
set_bash_verbosity
;;
centos:8)
dnf install -y \
gcc gcc-c++
;;
esac
#
# Common build flags
......
#!/usr/bin/env bash
# Copyright (c) 2020, Irish Centre for High End Computing (ICHEC), NUI Galway
# Authors:
# Pádraig Ó Conbhuí <padraig.oconbhui@ichec.ie>,
# Sophie Wenzel-Teuber <sophie.wenzel-teuber@ichec.ie>,
# Ciarán O'Rourke <ciaran.orourke@ichec.ie>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Install dependencies
#
function install_dependencies() {
# Enable repositories
dnf install -y \
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
yum install -y \
glib2 glib2-devel
yum install -y \
python3-pip
python3 -m pip install boto3
yum install -y \
cmake \
boost-devel
}
function configure() {
echo "no configuration required"
}
#!/usr/bin/env bash
# Copyright (c) 2020, Irish Centre for High End Computing (ICHEC), NUI Galway
# Authors:
# Pádraig Ó Conbhuí <padraig.oconbhui@ichec.ie>,
# Sophie Wenzel-Teuber <sophie.wenzel-teuber@ichec.ie>,
# Ciarán O'Rourke <ciaran.orourke@ichec.ie>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Install dependencies
#
function install_dependencies() {
# Enable repositories
dnf install -y \
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
# Regular packages
dnf install -y \
make \
autoconf automake libtool \
glib2-devel \
jansson-devel \
libattr-devel \
libini_config-devel \
openssl-devel \
protobuf-c-devel \
python2-devel \
sg3_utils-devel \
which \
python3 \
python2-psycopg2 \
python2-pyyaml \
pip2 install clustershell tabulate
# packages for postgresql
dnf install -y \
postgresql-devel \
postgresql-libs \
postgresql-server \
postgresql-contrib
}
function configure() {
# Enable rh-postgresql
# set default python version
alternatives --set python /usr/bin/python2
#
# Set build flags
#
export LIBPQ_CFLAGS=$(pg_config --cflags)
export LIBPQ_LIBS=-lpq
}
function set_environment_variables() {
export PYTHONPATH="${phobos_install_dir}"/lib/python2.7/site-packages:"${PYTHONPATH}"
export LD_LIBRARY_PATH="${phobos_install_dir}"/lib:"${LD_LIBRARY_PATH}"
export PATH="${phobos_install_dir}"/bin:"${phobos_install_dir}"/sbin:${PATH}
}
#!/usr/bin/env bash
# Copyright (c) 2020, Irish Centre for High End Computing (ICHEC), NUI Galway
# Authors:
# Pádraig Ó Conbhuí <padraig.oconbhui@ichec.ie>,
# Sophie Wenzel-Teuber <sophie.wenzel-teuber@ichec.ie>,
# Ciarán O'Rourke <ciaran.orourke@ichec.ie>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Install dependencies
#
function install_dependencies() {
# Enable repositories
dnf install -y \
dnf-plugins-core \
epel-release
dnf config-manager --set-enabled PowerTools
# Regular packages
dnf install -y \
make \
gperf \
perl perl-core \
libevent-devel \
zlib-devel \
openssl-devel openssl-libs \
fmt-devel
dnf install -y \
cmake \
boost-devel \
double-conversion-devel \
gflags gflags-devel glog-devel \
libsodium-devel \
libzstd-devel
}
# Set compilers etc.
function configure() {
echo "no configuration required"
}
function build_dependencies() {
#
# Patch GFlags install
#
print_section "Patching GFlags"
gflags_install_dir="/usr"
if should_build gflags
then
mkdir -p "${gflags_install_dir}"/lib64/cmake/gflags
gflags_config="${gflags_install_dir}"/lib64/cmake/gflags/gflags-config.cmake
cat > "${gflags_config}" <<EOF
# include directory
set (gflags_INCLUDE_DIR "/usr/include")
# gflags library
set (gflags_LIBRARIES "/usr/lib64/libgflags.so")
add_library(gflags-shared SHARED IMPORTED)
set_target_properties(
gflags-shared
PROPERTIES
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES \${gflags_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES \${gflags_LIBRARIES}
)
EOF
fi
CMAKE_PREFIX_PATH="${gflags_install_dir}:${CMAKE_PREFIX_PATH}"
#
# # Gflags sets library to "gflags" instead of /usr/lib64/libgflags.so
# gflags_config_cmake=/usr/lib64/cmake/gflags/gflags-config.cmake
# sed -i 's#set (gflags_LIBRARIES gflags)#set (gflags_LIBRARIES /usr/lib64/libgflags.so.2.1)#' "${gflags_config_cmake}"
}
#!/bin/sh
source ./src/phobos/testdb-setup.sh
script="${BASH_SOURCE[0]:-${(%):-%x}}"
script_dir="$( cd "$( dirname "${script}" )" >/dev/null 2>&1 && pwd )"
source ${script_dir}/src/phobos/testdb-setup.sh
set -x
......@@ -24,4 +28,4 @@ setup_phobos_db
start_phobos $test_dir
set +x
\ No newline at end of file
set +x
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