From 0a655d918d558ef97881db2760668b8d1e3b4bc1 Mon Sep 17 00:00:00 2001 From: Haoyang Liu Date: Fri, 2 Apr 2021 23:44:53 +0800 Subject: [PATCH] [TravisCI] Add support for centos:7 (#304) * CI: add support for centos:7 * add wrapper for centos builds --- .travis.yml | 31 +++++--------------------- CHANGES | 2 ++ scripts/travis_centos.sh | 47 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 25 deletions(-) create mode 100755 scripts/travis_centos.sh diff --git a/.travis.yml b/.travis.yml index 913943f5d..9cdfda866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,33 +73,14 @@ jobs: sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \ && \ sudo docker start -a mobydick - # centos: "recent" systems with ICB + # centos: "stable" systems with ICB and MPICH - stage: centos dist: bionic - script: | - sudo docker pull centos \ - && \ - sudo docker create --name mobydick centos /bin/bash -c \ - "dnf install -y dnf-plugins-core epel-release && \ - dnf upgrade -y && \ - dnf config-manager --set-enabled powertools && \ - dnf install -y git make gcc gcc-gfortran gcc-c++ environment-modules && \ - dnf install -y cmake && \ - dnf install -y mpich-devel && \ - dnf --enablerepo=\"epel\" install -y openblas-devel lapack-devel && \ - . /etc/profile.d/modules.sh && \ - module avail && module load mpi && module list && \ - cd /tmp && \ - cd arpack-ng && \ - git status && \ - git log -2 && \ - mkdir -p build && cd build && \ - cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON .. && \ - make all && make test" \ - && \ - sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \ - && \ - sudo docker start -a mobydick + script: ./scripts/travis_centos.sh :7 + # centos: "latest" systems with ICB and MPICH + - stage: centos + dist: bionic + script: ./scripts/travis_centos.sh :latest # fedora (released fedora with openmpi) - stage: fedora name: "Fedora latest with openmpi" diff --git a/CHANGES b/CHANGES index 8c03629f7..53752a215 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ arpack-ng - 3.9.0 [ Haoyang Liu ] * CMake: minimum required version changed to 3.0 * CMake: add C99 standard checking + * CI: Support for centos7 added. + * CI: Add `scripts/travis_centos.sh` for centos builds [ Robert Schütz ] * use CMAKE_INSTALL_FULL_ in arpack.pc diff --git a/scripts/travis_centos.sh b/scripts/travis_centos.sh new file mode 100755 index 000000000..8271da9d6 --- /dev/null +++ b/scripts/travis_centos.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# usage: ./travis_centos.sh [:7|:8|:latest|:stream] +# +## -e : Make sure all errors cause the script to fail +## -x be verbose; write what we are doing, as we do it +set -ex + +# centos-stream should be pulled from quay.io +# note: a RedHad account is required after 2021.06, +# see https://quay.io/repository/centos/centos?tab=tags +if [ $1 = ":stream" ]; then + prefix="quay.io/centos/" +fi + +if [ $1 = ":7" ]; then # for 7 + pm="yum" + cmake="cmake3" +else # for 8+, stream + pm="dnf" + cmake="cmake" + cmd_powertools="dnf config-manager --set-enabled powertools &&" +fi + +sudo docker pull "${prefix}centos$1" \ +&& \ +sudo docker create --name mobydick ${prefix}centos$1 /bin/bash -c \ +"$pm install -y ${pm}-plugins-core epel-release && \ + $pm upgrade -y && \ + $cmd_powertools \ + $pm install -y git make gcc gcc-gfortran gcc-c++ environment-modules && \ + $pm install -y $cmake && \ + $pm install -y mpich-devel && \ + $pm --enablerepo=\"epel\" install -y openblas-devel lapack-devel && \ + . /etc/profile.d/modules.sh && \ + module avail && module load mpi && module list && \ + cd /tmp && \ + cd arpack-ng && \ + git status && \ + git log -2 && \ + mkdir -p build && cd build && \ + $cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON .. && \ + make all && make test" \ +&& \ +sudo docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp \ +&& \ +sudo docker start -a mobydick +