From 7c6e6f3abe6cae8b1461345a5ec400b5c6d818f9 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Wed, 9 Mar 2022 13:20:48 -0500 Subject: [PATCH] CI: Test also without OpenMP and pthreads (#2245) This adds an additional build configuration to the Ubuntu workflow which builds code without OpenMP and pthreads and runs tests. Notably, modules using nprocs parameter should accept nprocs > 1 even when they are not able to parallelize due to a missing dependency. This check tests that behavior. Other selected optional dependencies can be added in the future. The current goal is to test code without dependencies which don't influence the primary actions the code performs. --- .../workflows/build_ubuntu-20.04_without_x.sh | 54 +++++++++++++++++++ .github/workflows/ubuntu.yml | 16 ++++-- 2 files changed, 66 insertions(+), 4 deletions(-) create mode 100755 .github/workflows/build_ubuntu-20.04_without_x.sh diff --git a/.github/workflows/build_ubuntu-20.04_without_x.sh b/.github/workflows/build_ubuntu-20.04_without_x.sh new file mode 100755 index 00000000000..5df3a0b7e33 --- /dev/null +++ b/.github/workflows/build_ubuntu-20.04_without_x.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +# The make step requires something like: +# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PREFIX/lib" +# further steps additionally require: +# export PATH="$PATH:$PREFIX/bin" + +# fail on non-zero return code from a subprocess +set -e + +# print commands +set -x + +if [ -z "$1" ]; then + echo "Usage: $0 PREFIX" + exit 1 +fi + +# Adding -Werror to make's CFLAGS is a workaround for configuring with +# an old version of configure, which issues compiler warnings and +# errors out. This may be removed with upgraded configure.in file. +makecmd="make" +if [[ "$#" -eq 2 ]]; then + makecmd="make CFLAGS='$CFLAGS $2' CXXFLAGS='$CXXFLAGS $2'" +fi + +# non-existent variables as an errors +set -u + +export INSTALL_PREFIX=$1 + +./configure \ + --prefix="$INSTALL_PREFIX/" \ + --enable-largefile \ + --with-cxx \ + --with-zstd \ + --with-bzlib \ + --with-blas \ + --with-lapack \ + --with-readline \ + --without-openmp \ + --with-pdal \ + --without-pthread \ + --with-tiff \ + --with-freetype \ + --with-freetype-includes="/usr/include/freetype2/" \ + --with-proj-share=/usr/share/proj \ + --with-geos \ + --with-sqlite \ + --with-fftw \ + --with-netcdf + +eval $makecmd +make install diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d2b9ea872ef..1fb98429afb 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,13 +7,21 @@ on: jobs: build-and-test: - name: ${{ matrix.os }} tests + name: ${{ matrix.name }} tests runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-20.04 + include: + - name: "20.04" + os: ubuntu-20.04 + config: ubuntu-20.04 + # This is without optional things but it still keeps things useful, + # so, e.g., without OpenMP, but with PDAL. Code or tests should be written + # so that test pass even when these optional things are not present. + - name: "minimum config" + os: ubuntu-20.04 + config: ubuntu-20.04_without_x fail-fast: false steps: @@ -39,7 +47,7 @@ jobs: echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV - name: Build - run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install + run: .github/workflows/build_${{ matrix.config }}.sh $HOME/install - name: Add the bin directory to PATH run: |