Skip to content

Commit

Permalink
[TravisCI] Add support for centos:7 (#304)
Browse files Browse the repository at this point in the history
* CI: add support for centos:7
* add wrapper for centos builds
  • Loading branch information
RyanBernX authored Apr 2, 2021
1 parent 51b299c commit 0a655d9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 25 deletions.
31 changes: 6 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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_<dir> in arpack.pc
Expand Down
47 changes: 47 additions & 0 deletions scripts/travis_centos.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0a655d9

Please sign in to comment.