Trying to located gfortran #53
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: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches-ignore: | ||
- documentation | ||
workflow_dispatch: | ||
defaults: | ||
run: | ||
# Enable Conda environment by using the login shell: | ||
shell: bash -leo pipefail {0} | ||
jobs: | ||
CI: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, macos-13, windows-2022] | ||
toolchain: | ||
- {compiler: gcc, version: 10} | ||
- {compiler: gcc, version: 11} | ||
- {compiler: gcc, version: 12} | ||
fpmodel: [DP, SP] | ||
env: | ||
FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan -g -DRTE_USE_CBOOL" | ||
RTE_KERNELS: default | ||
RRTMGP_DATA_VERSION: v1.8.2 | ||
FAILURE_THRESHOLD: 7.e-4 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# | ||
# Set up Fortran compilers | ||
# | ||
- uses: fortran-lang/setup-fortran@v1 | ||
id: setup-fortran | ||
with: | ||
compiler: ${{ matrix.toolchain.compiler }} | ||
version: ${{ matrix.toolchain.version }} | ||
# | ||
# Relax failure thresholds for single precision | ||
# | ||
- name: Relax failure threshold for single precision | ||
if: matrix.fpmodel == 'SP' | ||
run: echo "FAILURE_THRESHOLD=3.5e-1" >> $GITHUB_ENV | ||
# | ||
# Check out repository under $GITHUB_WORKSPACE | ||
# | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
# | ||
# Cache Conda packages | ||
# | ||
- name: Cache Conda packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: conda-pkgs-${{ matrix.os }} | ||
# | ||
# Set up Conda | ||
# | ||
- name: Set up Conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-version: latest | ||
activate-environment: rte_rrtmgp_test | ||
environment-file: environment-noplots.yml | ||
python-version: 3.11 | ||
auto-activate-base: false | ||
# Use the cache properly: | ||
use-only-tar-bz2: false | ||
# | ||
# Install dependencies (OS-specific) | ||
# | ||
- name: Install dependencies | ||
run: | | ||
conda install -c conda-forge netcdf-fortran -y | ||
- name: Add gfortran's full path | ||
run: | | ||
GFORTRAN_PATH=$(dirname "$(which gfortran)") | ||
echo "FC=$GFORTRAN_PATH/gfortran" >> $GITHUB_ENV | ||
echo "env.FC=$GFORTRAN_PATH/gfortran" >> $GITHUB_ENV | ||
echo "gfortran: ${{ env.FC }}" | ||
${{ env.FC }} --version | ||
# | ||
# Build libraries, examples, and tests | ||
# | ||
- name: Build libraries and tests | ||
run: | | ||
cmake -S . -B build \ | ||
-DCMAKE_Fortran_COMPILER="${{ env.FC }}" \ | ||
-DCMAKE_Fortran_FLAGS="${{ env.FCFLAGS }}" \ | ||
-DRRTMGP_DATA_VERSION=${{ env.RRTMGP_DATA_VERSION }} \ | ||
-DFP_MODEL=${{ matrix.fpmodel }} \ | ||
-DRTE_KERNEL_MODE=${{ env.RTE_KERNELS }} \ | ||
-DENABLE_TESTS=ON \ | ||
-DFAILURE_THRESHOLD=${{ env.FAILURE_THRESHOLD }} | ||
cmake --build build --config Release -- -j8 | ||
# | ||
# Run examples, tests and checks | ||
# | ||
- name: Run examples, tests and checks | ||
run: | | ||
ctest -V --test-dir build |