Skip to content

Commit

Permalink
Upgrade base image to Focal
Browse files Browse the repository at this point in the history
GitHub is sunsetting Bionic.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
  • Loading branch information
nicolasbock committed Apr 10, 2023
1 parent 3f62c85 commit ba2e04b
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 76 deletions.
44 changes: 14 additions & 30 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ env:
jobs:
lint:
name: Lint sources
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Prepare container
run: ./scripts/prepare-container-bionic.sh
run: ./scripts/prepare-container-focal.sh
- run: bundle install
- run: bundle exec danger || true
- run: BML_OPENMP=no EMACS=emacs27 ./build.sh --debug check_indent
Expand All @@ -42,12 +42,12 @@ jobs:
docs:
name: Build docs
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Prepare container
run: ./scripts/prepare-container-bionic.sh
run: ./scripts/prepare-container-focal.sh
- name: Build docs
run: ./build.sh --debug docs

Expand Down Expand Up @@ -90,27 +90,11 @@ jobs:

build:
name: Build and test the library (${{ matrix.JOBNAME }})
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- JOBNAME: gcc-4.8 C single real
TEST_SCRIPT: ./scripts/ci-gcc-4.8-C-single-real.sh
- JOBNAME: gcc-4.8 C double real
TEST_SCRIPT: ./scripts/ci-gcc-4.8-C-double-real.sh
- JOBNAME: gcc-4.8 C single complex
TEST_SCRIPT: ./scripts/ci-gcc-4.8-C-single-complex.sh
- JOBNAME: gcc-4.8 C double complex
TEST_SCRIPT: ./scripts/ci-gcc-4.8-C-double-complex.sh
- JOBNAME: gcc-4.8 Fortran single real
TEST_SCRIPT: ./scripts/ci-gcc-4.8-Fortran-single-real.sh
- JOBNAME: gcc-4.8 Fortran double real
TEST_SCRIPT: ./scripts/ci-gcc-4.8-Fortran-double-real.sh
- JOBNAME: gcc-4.8 Fortran single complex
TEST_SCRIPT: ./scripts/ci-gcc-4.8-Fortran-single-complex.sh
- JOBNAME: gcc-4.8 Fortran double complex
TEST_SCRIPT: ./scripts/ci-gcc-4.8-Fortran-double-complex.sh
- JOBNAME: gcc-11 C single real
TEST_SCRIPT: ./scripts/ci-gcc-11-C-single-real.sh
- JOBNAME: gcc-11 C double real
Expand Down Expand Up @@ -147,21 +131,21 @@ jobs:
TEST_SCRIPT: ./scripts/ci-MPI-single-complex.sh
- JOBNAME: MPI double complex
TEST_SCRIPT: ./scripts/ci-MPI-double-complex.sh
- JOBNAME: clang-12 / gfortran-11 C single real
TEST_SCRIPT: ./scripts/ci-clang-12-gfortran-11-C-single-real.sh
- JOBNAME: clang-12 / gfortran-11 C double real
TEST_SCRIPT: ./scripts/ci-clang-12-gfortran-11-C-double-real.sh
- JOBNAME: clang-12 / gfortran-11 C single complex
TEST_SCRIPT: ./scripts/ci-clang-12-gfortran-11-C-single-complex.sh
- JOBNAME: clang-12 / gfortran-11 C double complex
TEST_SCRIPT: ./scripts/ci-clang-12-gfortran-11-C-double-complex.sh
- JOBNAME: clang-16 / gfortran-11 C single real
TEST_SCRIPT: ./scripts/ci-clang-16-gfortran-11-C-single-real.sh
- JOBNAME: clang-16 / gfortran-11 C double real
TEST_SCRIPT: ./scripts/ci-clang-16-gfortran-11-C-double-real.sh
- JOBNAME: clang-16 / gfortran-11 C single complex
TEST_SCRIPT: ./scripts/ci-clang-16-gfortran-11-C-single-complex.sh
- JOBNAME: clang-16 / gfortran-11 C double complex
TEST_SCRIPT: ./scripts/ci-clang-16-gfortran-11-C-double-complex.sh
steps:
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare container
run: ./scripts/prepare-container-bionic.sh
run: ./scripts/prepare-container-focal.sh
- name: Build and test library
env:
BLAS_VENDOR: ${{ matrix.BLAS_VENDOR || env.BLAS_VENDOR }}
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ compile - Compile the sources
install - Install the compiled sources
testing - Run the test suite
docs - Generate the API documentation
indent - Check the indentation of the sources
indent - Indent sources
check_indent - Check the indentation of the sources
tags - Create tags file for vim and emacs
dist - Generate a tar file (this only works with git)
Expand Down Expand Up @@ -315,9 +315,9 @@ testing() {
cd "${TOP_DIR}"
}

check_indent() {
indent() {
cd "${TOP_DIR}"
"${TOP_DIR}/scripts/indent.sh" 2>&1 | tee -a "${LOG_FILE}"
"${TOP_DIR}/scripts/indent.sh" "$@" 2>&1 | tee -a "${LOG_FILE}"
check_pipe_error
}

Expand Down Expand Up @@ -399,10 +399,10 @@ if [[ $# -gt 0 ]]; then
docs
;;
"indent")
check_indent
indent
;;
"check_indent")
check_indent
indent check
;;
"tags")
tags
Expand Down
1 change: 1 addition & 0 deletions scripts/ci-MPI-double-complex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export BML_MPI=${BML_MPI:-yes}
export TESTING_EXTRA_ARGS=${TESTING_EXTRA_ARGS:-"-R MPI-C-.*-double_complex"}
export BML_SCALAPACK=${BML_SCALAPACK:-yes}
export SCALAPACK_LIBRARIES=${SCALAPACK_LIBRARIES:=scalapack-openmpi.so}
export BML_MPIEXEC_PREFLAGS=--oversubscribe

[[ -f ${basedir}/scripts/ci-defaults.sh ]] && . ${basedir}/scripts/ci-defaults.sh

Expand Down
1 change: 1 addition & 0 deletions scripts/ci-MPI-double-real.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export BML_MPI=${BML_MPI:-yes}
export TESTING_EXTRA_ARGS=${TESTING_EXTRA_ARGS:-"-R MPI-C-.*-double_real"}
export BML_SCALAPACK=${BML_SCALAPACK:-yes}
export SCALAPACK_LIBRARIES=${SCALAPACK_LIBRARIES:=scalapack-openmpi.so}
export BML_MPIEXEC_PREFLAGS=--oversubscribe

[[ -f ${basedir}/scripts/ci-defaults.sh ]] && . ${basedir}/scripts/ci-defaults.sh

Expand Down
1 change: 1 addition & 0 deletions scripts/ci-MPI-single-complex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export BML_MPI=${BML_MPI:-yes}
export TESTING_EXTRA_ARGS=${TESTING_EXTRA_ARGS:-"-R MPI-C-.*-single_complex"}
export BML_SCALAPACK=${BML_SCALAPACK:-yes}
export SCALAPACK_LIBRARIES=${SCALAPACK_LIBRARIES:=scalapack-openmpi.so}
export BML_MPIEXEC_PREFLAGS=--oversubscribe

[[ -f ${basedir}/scripts/ci-defaults.sh ]] && . ${basedir}/scripts/ci-defaults.sh

Expand Down
1 change: 1 addition & 0 deletions scripts/ci-MPI-single-real.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export BML_MPI=${BML_MPI:-yes}
export TESTING_EXTRA_ARGS=${TESTING_EXTRA_ARGS:-"-R MPI-C-.*-single_real"}
export BML_SCALAPACK=${BML_SCALAPACK:-yes}
export SCALAPACK_LIBRARIES=${SCALAPACK_LIBRARIES:=scalapack-openmpi.so}
export BML_MPIEXEC_PREFLAGS=--oversubscribe

[[ -f ${basedir}/scripts/ci-defaults.sh ]] && . ${basedir}/scripts/ci-defaults.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e -u -x

basedir=$(readlink --canonicalize $(dirname $0)/..)

export CC=${CC:-clang-12}
export CXX=${CXX:-clang++-12}
export CC=${CC:-clang-16}
export CXX=${CXX:-clang++-16}
export FC=${FC:-gfortran-11}
export BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-no}
export BML_OPENMP=${BML_OPENMP:-no}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e -u -x

basedir=$(readlink --canonicalize $(dirname $0)/..)

export CC=${CC:-clang-12}
export CXX=${CXX:-clang++-12}
export CC=${CC:-clang-16}
export CXX=${CXX:-clang++-16}
export FC=${FC:-gfortran-11}
export BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-no}
export BML_OPENMP=${BML_OPENMP:-no}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e -u -x

basedir=$(readlink --canonicalize $(dirname $0)/..)

export CC=${CC:-clang-12}
export CXX=${CXX:-clang++-12}
export CC=${CC:-clang-16}
export CXX=${CXX:-clang++-16}
export FC=${FC:-gfortran-11}
export BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-no}
export BML_OPENMP=${BML_OPENMP:-no}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e -u -x

basedir=$(readlink --canonicalize $(dirname $0)/..)

export CC=${CC:-clang-12}
export CXX=${CXX:-clang++-12}
export CC=${CC:-clang-16}
export CXX=${CXX:-clang++-16}
export FC=${FC:-gfortran-11}
export BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-no}
export BML_OPENMP=${BML_OPENMP:-no}
Expand Down
17 changes: 16 additions & 1 deletion scripts/indent.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

: ${EMACS:=$(command -v emacs)}
: ${INDENT_ARGS:="-gnu -nut -i4 -bli0 -cli4 -ppi0 -cbi0 -npcs -bfda"}
: ${INDENT_ARGS:="-gnu -nut -i4 -bli0 -cli4 -ppi0 -cbi0 -npcs -bfda -par"}

declare -a SH_FILES
declare -a C_FILES
Expand All @@ -15,6 +15,14 @@ EOF
exit 1
fi

check_only=0

if (( $# > 0 )); then
if [[ $1 == 'check' ]]; then
check_only=1
shift
fi
fi
if (( $# > 0 )); then
while (( $# > 0 )); do
case "${1##*.}" in
Expand Down Expand Up @@ -81,9 +89,16 @@ if (( ${#FAILED_FILES[@]} > 0 )); then
if [[ ${file} =~ .sh$ ]]; then
echo "bashate ${file}"
bashate "${file}"
if (( check_only == 0 )); then
mv "${file}" "${file}.backup"
bashat "${file}.backup" > "${file}"
fi
else
echo "diff -Naur ${file} ${file}.indented"
diff -Naur "${file}" "${file}".indented
if (( check_only == 0 )); then
mv "${file}.indented" "${file}"
fi
fi
done
echo
Expand Down
48 changes: 36 additions & 12 deletions scripts/prepare-container-focal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,43 @@ deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main
# 12
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main
# deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main
# 13
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main
# deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main
# 14
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main
# deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main
# 15
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main
# deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main
# 16
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main
# deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main
EOF
${SUDO} cat > /etc/apt/trusted.gpg.d/llvm.gpg < <(wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor)
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | ${SUDO} tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc

cat <<EOF | ${SUDO} tee /etc/apt/sources.list.d/toolchain.list
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main
# deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main
if ! apt-cache policy | grep --quiet toolchain; then
cat <<EOF | ${SUDO} tee /etc/apt/sources.list.d/toolchain.list
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main
# deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main
EOF
gpg --keyserver keyserver.ubuntu.com \
--recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F
${SUDO} cat > /etc/apt/trusted.gpg.d/toolchain.gpg < <(gpg --export 60C317803A41BA51845E371A1E9377A2BA9EF27F)
gpg --keyserver keyserver.ubuntu.com \
--recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F
gpg --armor --export 60C317803A41BA51845E371A1E9377A2BA9EF27F | ${SUDO} tee /etc/apt/trusted.gpg.d/toolchain.asc
fi

cat <<EOF | ${SUDO} tee /etc/apt/sources.list.d/emacs.list
deb http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal main
# deb-src http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal main
EOF
gpg --keyserver keyserver.ubuntu.com \
--recv-keys 873503A090750CDAEB0754D93FF0E01EEAAFC9CD
${SUDO} cat > /etc/apt/trusted.gpg.d/emacs.gpg < <(gpg --export 873503A090750CDAEB0754D93FF0E01EEAAFC9CD)
gpg --armor --export 873503A090750CDAEB0754D93FF0E01EEAAFC9CD | ${SUDO} tee /etc/apt/trusted.gpg.d/emacs.asc

apt-key list

for i in $(seq 5); do
echo "Attempt ${i} to update apt"
${SUDO} apt-get update && break
done

Expand All @@ -61,15 +76,12 @@ ${SUDO} apt-get install --assume-yes --no-install-recommends \
bundler \
cmake cmake-data \
emacs27 \
clang-12 llvm-12-dev libomp-12-dev \
gcc-9 g++-9 gfortran-9 \
gcc-10 g++-10 gfortran-10 \
gcc-11 g++-11 gfortran-11 \
git-core \
indent \
less \
libblas-dev liblapack-dev \
libscalapack-openmpi-dev \
libopenblas-dev \
mpi-default-dev \
openmpi-bin \
openssh-client \
Expand All @@ -79,4 +91,16 @@ ${SUDO} apt-get install --assume-yes --no-install-recommends \
valgrind \
vim

${SUDO} apt-get remove --purge 'libomp*' || echo "no previous clang installation found"

dpkg -l 'libomp*'

${SUDO} apt-get install --assume-yes --no-install-recommends \
clang-16 llvm-16-dev libomp-16-dev

${SUDO} apt-get install --assume-yes --no-install-recommends \
gcc-9 g++-9 gfortran-9 \
gcc-10 g++-10 gfortran-10 \
gcc-11 g++-11 gfortran-11

${SUDO} pip install --system bashate
Loading

0 comments on commit ba2e04b

Please sign in to comment.