Began porting the mapping system
This commit is contained in:
@@ -1,66 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Build and run all six sandboxes with each Linux compiler/library/linker pair.
|
||||
set -eu
|
||||
|
||||
project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
meson_bin=${MESON_BIN:-meson}
|
||||
meson_dir=$(CDPATH= cd -- "$(dirname -- "$meson_bin")" && pwd)
|
||||
profile=${MFEM_MATRIX_PROFILE:-portable}
|
||||
profile=${MFEM_MATRIX_PROFILE:-minimal}
|
||||
jobs=${MFEM_JOBS:-4}
|
||||
mode=${SERIF_BUILDTYPE:-debug}
|
||||
|
||||
compiler_family() {
|
||||
"$1" --version 2>&1 | sed -n '1p'
|
||||
}
|
||||
|
||||
require_clang() {
|
||||
version=$(compiler_family "$1")
|
||||
case "$version" in
|
||||
*clang*|*Clang*) ;;
|
||||
*) echo "error: $1 is not a Clang compiler: $version" >&2; exit 2 ;;
|
||||
# GCC/libc++ requires a recent GCC and Linux headers at /usr/include/c++/v1.
|
||||
# Set SERIF_TOOLCHAINS to a space-separated subset to test selected toolchains.
|
||||
for toolchain in ${SERIF_TOOLCHAINS:-gcc gcc-libcxx clang-libstdcxx clang-libcxx}; do
|
||||
case "$toolchain" in
|
||||
gcc) compiler=gcc; library= ;;
|
||||
gcc-libcxx) compiler=gcc; library=gcc-libcxx ;;
|
||||
clang-libstdcxx) compiler=clang; library=libstdcxx ;;
|
||||
clang-libcxx) compiler=clang; library=libcxx ;;
|
||||
*) echo "Unknown toolchain: $toolchain" >&2; exit 2 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
require_gnu() {
|
||||
version=$(compiler_family "$1")
|
||||
case "$version" in
|
||||
*gcc*|*GCC*|*"Free Software Foundation"*) ;;
|
||||
*) echo "error: $1 is not a GNU compiler: $version" >&2; exit 2 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
run_configuration() {
|
||||
name=$1
|
||||
c_compiler=$2
|
||||
cxx_compiler=$3
|
||||
mode=$4
|
||||
build_dir="$project_root/build-$name"
|
||||
|
||||
if test -f "$build_dir/meson-private/coredata.dat"; then
|
||||
wipe_flag=--wipe
|
||||
else
|
||||
wipe_flag=
|
||||
fi
|
||||
env PATH="$meson_dir:$PATH" CC="$c_compiler" CXX="$cxx_compiler" \
|
||||
"$meson_bin" setup $wipe_flag "$build_dir" "$project_root" \
|
||||
--buildtype="$mode" \
|
||||
-Dallow_preinstalled=false \
|
||||
-Dfeature_profile="$profile" \
|
||||
-Dbuild_examples=true \
|
||||
-Dbuild_tests=true \
|
||||
-Dbuild_python=false \
|
||||
-Djobs="$jobs"
|
||||
env PATH="$meson_dir:$PATH" "$meson_bin" compile -C "$build_dir"
|
||||
env PATH="$meson_dir:$PATH" "$meson_bin" test -C "$build_dir" --print-errorlogs
|
||||
}
|
||||
|
||||
clang_cc=${CLANG_CC:-clang}
|
||||
clang_cxx=${CLANG_CXX:-clang++}
|
||||
gcc_cc=${GNU_CC:-gcc}
|
||||
gcc_cxx=${GNU_CXX:-g++}
|
||||
|
||||
require_clang "$clang_cxx"
|
||||
require_gnu "$gcc_cxx"
|
||||
|
||||
run_configuration clang-debug "$clang_cc" "$clang_cxx" debug
|
||||
run_configuration clang-release "$clang_cc" "$clang_cxx" release
|
||||
run_configuration gcc-debug "$gcc_cc" "$gcc_cxx" debug
|
||||
run_configuration gcc-release "$gcc_cc" "$gcc_cxx" release
|
||||
for linker in ${SERIF_LINKERS:-ld lld}; do
|
||||
case "$linker" in ld|lld) ;; *) echo "Unknown linker: $linker" >&2; exit 2 ;; esac
|
||||
build_dir="$project_root/build/matrix/$toolchain-$linker"
|
||||
set -- "$build_dir" "$project_root" \
|
||||
"--native-file=$project_root/native/$compiler.ini" \
|
||||
"--native-file=$project_root/native/$linker.ini" \
|
||||
"--buildtype=$mode" -Dallow_preinstalled=false \
|
||||
"-Dfeature_profile=$profile" -Dbuild_tests=true "-Djobs=$jobs"
|
||||
if test -n "$library"; then
|
||||
set -- "$@" "--native-file=$project_root/native/$library.ini"
|
||||
fi
|
||||
if test -n "${SERIF_SANDBOX_EXPECTED_ERRORS:-}"; then
|
||||
set -- "$@" "-Dsandbox_expected_errors=$SERIF_SANDBOX_EXPECTED_ERRORS"
|
||||
fi
|
||||
if test -f "$build_dir/meson-private/coredata.dat"; then
|
||||
set -- --reconfigure "$@"
|
||||
fi
|
||||
"$meson_bin" setup "$@"
|
||||
"$meson_bin" compile -C "$build_dir" -j "$jobs"
|
||||
"$meson_bin" test -C "$build_dir" --print-errorlogs
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user