Merge branch 'bugfix/GammaCalculator_deriv_template' of github.com:th… #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GCC Tests | |
on: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
# see available versions here: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software | |
gcc-version: [9, 10, 11, 12] | |
dim: [2, 3] | |
mpi: ['FALSE', 'TRUE'] | |
opt: ['FALSE', 'TRUE'] | |
exclude: | |
# No point running 2D test without MPI as the only test is the | |
# Apparent Horizon one which needs MPI | |
- dim: 2 | |
mpi: 'FALSE' | |
include: | |
- debug: 'TRUE' | |
opt: 'FALSE' | |
- debug: 'FALSE' | |
opt: 'TRUE' | |
name: GCC ${{ matrix.gcc-version }}, DIM = ${{ matrix.dim }}, MPI = ${{ matrix.mpi }}, OPT = ${{ matrix.opt }} | |
env: | |
CHOMBO_HOME: ${{ github.workspace }}/Chombo/lib | |
OMP_NUM_THREADS: 1 | |
BUILD_ARGS: DIM=${{ matrix.dim }} MPI=${{ matrix.mpi}} OPT=${{ matrix.opt }} DEBUG=${{ matrix.debug }} | |
steps: | |
- name: Checkout Chombo | |
uses: actions/checkout@v4 | |
with: | |
repository: GRChombo/Chombo | |
path: Chombo | |
- name: Checkout GRChombo | |
uses: actions/checkout@v4 | |
with: | |
path: GRChombo | |
- name: Update package manager database | |
id: update-database | |
continue-on-error: true | |
run: sudo apt-get update | |
# This is quite slow so only do this if the previous command fails | |
- name: Update package repository mirrors if necessary | |
if: steps.update-database.outcome == 'failure' | |
run: | | |
sudo gem install apt-spy2 | |
sudo apt-spy2 fix --commit --launchpad --country=US | |
sudo apt-get update | |
- name: Install common dependencies | |
run: sudo apt-get -y --no-install-recommends install csh libhdf5-dev libblas-dev liblapack-dev libgetopt-complete-perl | |
- name: Install MPI dependencies | |
if: matrix.mpi == 'TRUE' | |
run: sudo apt-get -y --no-install-recommends install libhdf5-openmpi-dev petsc-dev openmpi-bin | |
- name: Set Compilers | |
run: | | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc-version }} 200 | |
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc-version }} 200 | |
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-${{ matrix.gcc-version }} 200 | |
- name: Build Chombo | |
run: | | |
if [[ "${{ matrix.mpi }}" == "TRUE" ]]; then | |
MAKE_DEFS_FILE=$GITHUB_WORKSPACE/GRChombo/InstallNotes/MakeDefsLocalExamples/ubuntu-gcc.Make.defs.local | |
else | |
MAKE_DEFS_FILE=$GITHUB_WORKSPACE/GRChombo/InstallNotes/MakeDefsLocalExamples/ubuntu-gcc-nompi.Make.defs.local | |
fi | |
cp $MAKE_DEFS_FILE $CHOMBO_HOME/mk/Make.defs.local | |
make -j 4 AMRTimeDependent AMRTools BaseTools BoxTools $BUILD_ARGS | |
working-directory: ${{ env.CHOMBO_HOME }} | |
- name: Build GRChombo Tests (3D) | |
if: matrix.DIM == 3 | |
# We don't want to run the 2D apparent horizon finder test here | |
run: | | |
rm -rf Tests/ApparentHorizonFinderTest2D | |
make test -j 4 $BUILD_ARGS | |
working-directory: ${{ github.workspace }}/GRChombo | |
- name: Run GRChombo Tests (3D) | |
if: matrix.DIM == 3 | |
run: make run -j 2 $BUILD_ARGS | |
working-directory: ${{ github.workspace }}/GRChombo | |
- name: Build GRChombo Tests (2D) | |
if: matrix.DIM == 2 | |
run: make test -j 4 $BUILD_ARGS | |
# Only 2D test is apparent horizon finder test | |
working-directory: ${{ github.workspace }}/GRChombo/Tests/ApparentHorizonFinderTest2D | |
- name: Run GRChombo Tests (2D) | |
if: matrix.DIM == 2 | |
run: make run -j 2 $BUILD_ARGS | |
# Only 2D test is apparent horizon finder test | |
working-directory: ${{ github.workspace }}/GRChombo/Tests/ApparentHorizonFinderTest2D |