update fortran-yaml (#63) #369
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: Build and test | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
jobs: | |
gfortran: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
version: [9, 10, 11, 12, 13] | |
os: [ubuntu-latest] | |
include: | |
#- version: 4.8 | |
# os: ubuntu-18.04 | |
# cmake_args: -DFABM_USE_IEEE_ARITHMETIC=OFF | |
#- version: 5 | |
# os: ubuntu-18.04 | |
#- version: 6 | |
# os: ubuntu-18.04 | |
- version: 7 | |
os: ubuntu-20.04 | |
- version: 8 | |
os: ubuntu-20.04 | |
cmake_args: -DFABM_USE_CONTIGUOUS=OFF | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
FFLAGS: -fcheck=all | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.7" | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pyyaml | |
- name: Install compiler | |
run: | | |
sudo apt-get update | |
sudo apt-get install gfortran-${{ matrix.version }} | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run all test cases with host emulators | |
run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} | |
- name: Run all test cases with pyfabm | |
run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} | |
ifort: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
include: | |
- version: "2021.1.2.62" | |
url_dir: "https://registrationcenter-download.intel.com/akdlm/irc_nas/17508" | |
- version: "2022.2.1.16992" | |
url_dir: "https://registrationcenter-download.intel.com/akdlm/irc_nas/18998" | |
- version: "2023.2.0.49254" | |
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/237236c4-434b-4576-96ac-020ceeb22619" | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
FFLAGS: -check all | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.7" | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pyyaml | |
- name: Install compiler | |
run: | | |
wget --no-verbose ${{ matrix.url_dir }}/l_fortran-compiler_p_${{ matrix.version }}_offline.sh | |
/bin/sh l_fortran-compiler_p_${{ matrix.version }}_offline.sh -a --silent --cli --install-dir ${HOME}/intel --eula accept | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run all test cases with host emulators | |
run: | | |
source ${HOME}/intel/setvars.sh | |
python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifort | |
- name: Run all test cases with pyfabm | |
run: | | |
source ${HOME}/intel/setvars.sh | |
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifort | |
env: | |
FFLAGS: ${{ env.FFLAGS }} -fp-model precise -fp-model source | |
ifx: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
include: | |
- version: "2023.2.0.49254" | |
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/237236c4-434b-4576-96ac-020ceeb22619" | |
#- version: "2024.0.2.28" | |
# url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/41df6814-ec4b-4698-a14d-421ee2b02aa7" | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
FFLAGS: -check all,nouninit,nocontiguous | |
# nouninit because https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-missing-clang-rt-msan-to-link-Fortran-program-in-debug-build/m-p/1536555 | |
# nocontiguous because spurious errors occur when assigning null() to contiguous pointers | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.7" | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pyyaml | |
- name: Install compiler | |
run: | | |
wget --no-verbose ${{ matrix.url_dir }}/l_fortran-compiler_p_${{ matrix.version }}_offline.sh | |
/bin/sh l_fortran-compiler_p_${{ matrix.version }}_offline.sh -a --silent --cli --install-dir ${HOME}/intel --eula accept | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run all test cases with host emulators | |
run: | | |
source ${HOME}/intel/setvars.sh | |
python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifx | |
- name: Run all test cases with pyfabm | |
run: | | |
source ${HOME}/intel/setvars.sh | |
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifx | |
env: | |
FFLAGS: ${{ env.FFLAGS }} -fp-model=precise | |
nvfortran: | |
# for available versions, see https://developer.nvidia.com/nvidia-hpc-sdk-releases | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
include: | |
- version: "20.9" # released 2020-10 | |
exe: nvhpc_2020_209_Linux_x86_64_cuda_11.0 | |
- version: "22.9" # released 2022-10 | |
exe: nvhpc_2022_229_Linux_x86_64_cuda_11.7 | |
- version: "23.7" # released 2023-07 | |
exe: nvhpc_2023_237_Linux_x86_64_cuda_12.2 | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
FFLAGS: -Mbounds -Mchkptr | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.7" | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pyyaml | |
- name: Install compiler | |
run: | | |
wget --no-verbose https://developer.download.nvidia.com/hpc-sdk/${{ matrix.version }}/${{ matrix.exe }}.tar.gz | |
tar xpzf ${{ matrix.exe }}.tar.gz | |
rm ${{ matrix.exe }}.tar.gz | |
${{ matrix.exe }}/install | |
env: | |
NVHPC_SILENT: true | |
NVHPC_INSTALL_DIR: /home/runner/nvhpc | |
NVHPC_INSTALL_TYPE: single | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run all test cases with host emulators | |
run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran | |
- name: Run all test cases with pyfabm | |
run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran | |
aocc: | |
# for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/aocc/package.py | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
include: | |
- version: "3.2.0" # released 2021-12-02 | |
pyfabm_cmake_args: -DCMAKE_Fortran_FLAGS_DEBUG= # skip -g as that triggers segfault | |
url_dir: https://download.amd.com/developer/eula/aocc-compiler | |
- version: "4.0.0" # released 2022-11-10 | |
url_dir: https://download.amd.com/developer/eula/aocc-compiler | |
- version: "4.1.0" # released 2023-08-04 | |
url_dir: https://download.amd.com/developer/eula/aocc/aocc-4-1 | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.7" | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pyyaml | |
- name: Install compiler | |
run: | | |
cd /home/runner | |
wget --no-verbose ${{ matrix.url_dir }}/aocc-compiler-${{ matrix.version }}.tar | |
tar xpf aocc-compiler-${{ matrix.version }}.tar | |
rm aocc-compiler-${{ matrix.version }}.tar | |
./aocc-compiler-${{ matrix.version }}/install.sh | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run all test cases with host emulators | |
run: | | |
source /home/runner/setenv_AOCC.sh | |
python3 util/developers/run_all_testcases.py harness --show_logs --compiler flang | |
- name: Run all test cases with pyfabm | |
run: | | |
source /home/runner/setenv_AOCC.sh | |
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler flang ${{ matrix.pyfabm_cmake_args }} | |
pyfabm: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
fail-fast: false | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: python -m pip install --upgrade pip build | |
- name: Build distribution | |
run: python -m build | |
- name: Install | |
run: python -m pip install . | |
- name: Test | |
run: | | |
python -c "import pyfabm;print('pyfabm version =', getattr(pyfabm, '__version__', None))" | |
for f in testcases/*.yaml; do fabm_describe_model $f; done | |
for f in testcases/*.yaml; do fabm_complete_yaml --add_missing $f; done | |
fabm0d: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install NetCDF | |
run: | | |
sudo apt-get update | |
sudo apt-get install libnetcdff-dev | |
- name: Clone FABM | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Clone GOTM | |
uses: actions/checkout@v4 | |
with: | |
repository: gotm-model/code | |
ref: v6.0 | |
path: gotm | |
submodules: recursive | |
- name: Build | |
run: | | |
cmake -S src/drivers/0d -B build -DGOTM_BASE=gotm | |
cmake --build build --target install | |
stat ~/local/fabm/0d/bin/fabm0d | |
cmake: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
cmake-version: ["3.13"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone FABM | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download and extract cmake | |
run: | | |
wget --no-verbose https://cmake.org/files/v${{ matrix.cmake-version }}/cmake-${{ matrix.cmake-version }}.0-Linux-x86_64.tar.gz | |
tar -xvf cmake-${{ matrix.cmake-version }}.0-Linux-x86_64.tar.gz | |
- name: Build | |
run: | | |
cmake-${{ matrix.cmake-version }}.0-Linux-x86_64/bin/cmake -S . -B build | |
cmake-${{ matrix.cmake-version }}.0-Linux-x86_64/bin/cmake --build build --target install |