Skip to content

CI

CI #316

Workflow file for this run

name: CI
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 5'
jobs:
build:
strategy:
matrix:
compiler: [{cc: gcc-11, cxx: g++-11}, {cc: clang-15, cxx: clang++-15}]
arpackng: [3.6.0, 3.7.0, 3.8.0, master]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Update apt-get cache
run: sudo apt-get update
- name: Install Ubuntu dependencies
run: >
sudo apt-get install
g++-11
gfortran-11
clang-15
libomp-15-dev
libopenblas-dev
libboost-dev
libeigen3-dev
libarmadillo-dev
libgmp-dev
openmpi-bin
openmpi-common
openmpi-doc
libopenmpi-dev
libblas-dev
liblapack-dev
libfftw3-dev
hdf5-tools
libhdf5-serial-dev
- name: Install dependencies needed to build docs
if: startsWith(matrix.compiler.cxx, 'clang') &&
matrix.arpackng == 'master'
run: |
sudo apt-get install doxygen libjs-mathjax
pip3 install -U sphinx breathe myst-parser
- name: Build and install ARPACK-NG
env:
# To fix compilation of versions 3.6.0 and 3.7.0 with gfortran 11
FFLAGS: -fallow-argument-mismatch
run: |
git clone --branch ${{ matrix.arpackng }} \
https://github.com/opencollab/arpack-ng.git arpack-ng
pushd arpack-ng
cmake . -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/arpack-ng.installed \
-DBUILD_SHARED_LIBS=ON \
-DMPI=ON
make -j2
ctest --output-on-failure
make install
popd
- name: Install Blaze
run: |
git clone https://bitbucket.org/blaze-lib/blaze.git blaze
pushd blaze
cmake . -DCMAKE_INSTALL_PREFIX=$HOME/blaze.installed \
-DBLAZE_SHARED_MEMORY_PARALLELIZATION=OFF
make install
popd
- name: Build and install TRIQS 3.0.x
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: |
git clone https://github.com/TRIQS/triqs.git triqs --branch 3.0.x
rm triqs/c++/triqs/mc_tools/random_generator.cpp
mkdir triqs.build && pushd triqs.build
cmake ../triqs \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/triqs.installed \
-DPythonSupport=OFF \
-DBuild_Documentation=OFF \
-DBuild_Tests=OFF
make -j2 install VERBOSE=1
popd
- name: Build and install nda
run: |
git clone https://github.com/TRIQS/nda.git nda --branch 1.2.x
mkdir nda.build && pushd nda.build
cmake ../nda \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/nda.installed \
-DBUILD_SHARED_LIBS=ON \
-DPythonSupport=OFF \
-DBuild_Documentation=OFF \
-DBuild_Tests=OFF
make -j2 install VERBOSE=1
popd
- name: Install xtl, xtensor and xtensor-blas
run: |
git clone https://github.com/xtensor-stack/xtl.git xtl
pushd xtl
cmake . -DCMAKE_INSTALL_PREFIX=$HOME/xtensor.installed
make install
popd
git clone https://github.com/xtensor-stack/xtensor.git xtensor
mkdir xtensor.build && pushd xtensor.build
cmake ../xtensor \
-DCMAKE_INSTALL_PREFIX=$HOME/xtensor.installed \
-Dxtl_DIR=$HOME/xtensor.installed
make install
popd
git clone https://github.com/xtensor-stack/xtensor-blas.git xtensor-blas
mkdir xtensor-blas.build && pushd xtensor-blas.build
cmake ../xtensor-blas \
-DCMAKE_INSTALL_PREFIX=$HOME/xtensor.installed \
-Dxtensor_DIR=$HOME/xtensor.installed
make install
popd
- name: Build ezARPACK
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
ARPACKNG_VERSION: ${{ matrix.arpackng }}
run: |
if [[ "${CXX}" == clang* && "${ARPACKNG_VERSION}" == master ]]; then
CMAKE_CXX_FLAGS="-Wno-ignored-attributes"
DOCS_CMAKE_ARGS="-DDocumentation=ON \
-DMathJax_ROOT=/usr/share/javascript/mathjax"
else
CMAKE_CXX_FLAGS="-Wno-ignored-attributes"
DOCS_CMAKE_ARGS="-DDocumentation=OFF"
fi
mkdir ezARPACK.build && pushd ezARPACK.build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(readlink -f ../ezARPACK.installed) \
-DARPACK_NG_ROOT=$HOME/arpack-ng.installed \
-Dblaze_ROOT=$HOME/blaze.installed \
-DTRIQS_ROOT=$HOME/triqs.installed \
-Dnda_ROOT=$HOME/nda.installed \
-Dxtensor_ROOT=$HOME/xtensor.installed \
-Dxtensor-blas_ROOT=$HOME/xtensor.installed \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
${DOCS_CMAKE_ARGS}
make -j2 VERBOSE=1
make install
popd
- name: Test ezARPACK
run: |
sudo sh -c 'echo -e "\nrmaps_base_oversubscribe = 1" >> \
/etc/openmpi/openmpi-mca-params.conf'
source $HOME/triqs.installed/share/triqsvars.sh
source $HOME/nda.installed/share/nda/ndavars.sh
pushd ezARPACK.build
ctest --output-on-failure
popd
- name: Prepare documentation for deployment
if: startsWith(matrix.compiler.cxx, 'clang') &&
matrix.arpackng == 'master'
run: |
pushd ezARPACK.installed/share/doc/ezARPACK/sphinx
find . -name "*.html" -type f -exec sed -i \
's/\/usr\/share\/javascript\/mathjax/\/ezARPACK\/mathjax/g' {} \;
cp -r /usr/share/javascript/mathjax mathjax
popd
- name: Deploy documentation
if: github.ref == 'refs/heads/master' &&
startsWith(matrix.compiler.cxx, 'clang') &&
matrix.arpackng == 'master'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
folder: ezARPACK.installed/share/doc/ezARPACK/sphinx