Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More systematic compiler flags for CI; separate Conda-style builds #360

Merged
merged 28 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aeab922
Conda-compatible CI
RobertPincus Feb 20, 2025
052a41d
Don't specify compiler version
RobertPincus Feb 20, 2025
8644c0a
Consolidate conda installs, remove standards flag
RobertPincus Feb 20, 2025
6bd5916
Multi-line syntax
RobertPincus Feb 20, 2025
c83d91b
Test many gfortran variants only on Linux
RobertPincus Feb 20, 2025
63d5a78
FFLAGS -> CMAKE_Fortran_FLAGS
RobertPincus Feb 21, 2025
25c8c88
Specify FFLAGS to CMake, not via environment
RobertPincus Feb 21, 2025
4158730
Don't keep running conda builds; different debug glaf approach
RobertPincus Feb 21, 2025
8fe45da
Quotes?
RobertPincus Feb 21, 2025
ac2bca0
Spaces????
RobertPincus Feb 21, 2025
30bc8d6
Or no quotes
RobertPincus Feb 21, 2025
f57a7bc
Well phew... Need to specify FFLAGS to CMake?
RobertPincus Feb 21, 2025
8122116
Remove action running on branch
RobertPincus Feb 21, 2025
1cc2ab8
Why is pre-commit failing in Actions but not locally?
RobertPincus Feb 21, 2025
214815e
Update .github/workflows/conda-style-builds.yml
RobertPincus Feb 21, 2025
074471e
Re-enable Lumi CI (#355)
RobertPincus Feb 21, 2025
810ca90
Revert - forgot that Lumi CI is out of date
RobertPincus Feb 21, 2025
c702806
Change handling of Fortran compilation flags (needed only for debugging)
RobertPincus Feb 24, 2025
dba1823
Syntax
RobertPincus Feb 24, 2025
7198a79
Syntax?
RobertPincus Feb 24, 2025
8136091
Refining conda-style builds
RobertPincus Feb 24, 2025
e04068b
What about Release builds?
RobertPincus Feb 24, 2025
2646bf5
Remove Release build - failing on Linux
RobertPincus Feb 24, 2025
adb8844
Update action (#362)
RobertPincus Feb 24, 2025
82b3ef5
Removed unused compile definitions (#361)
makepath-alex Feb 25, 2025
531c63f
Suggestions from @skosukhin
RobertPincus Feb 25, 2025
ecb0f84
Use system ninja, netcdf
RobertPincus Feb 25, 2025
fb48778
ci: simplify
skosukhin Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/conda-style-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Conda-compatible builds

on:
push:
branches:
- main
pull_request:
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-24.04, macos-13, macos-latest, windows-2022]
env:
FC: gfortran
# FFLAGS: "-std=f2008"
CMAKE_BUILD_PARALLEL_LEVEL: 8
VERBOSE:
CTEST_PARALLEL_LEVEL: 8
CTEST_OUTPUT_ON_FAILURE: 1
runs-on: ${{ matrix.os }}
steps:
#
# 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
conda-remove-defaults: true
# Use the cache properly:
use-only-tar-bz2: false
#
# Install compiler and dependencies
#
- name: Install compiler, dependencies
run: |
conda install -c conda-forge "${FC}" netcdf-fortran ninja -y
echo "FC=gfortran" >> "$GITHUB_ENV"
#
# Adjust toolchain
#
- name: Adjust Windows toolchain
if: matrix.os == 'windows-2022'
run: echo "FC=${FC}.exe" >> "$GITHUB_ENV"
#
# Build libraries, examples, and tests
#
- name: Build libraries and tests
run: |
cmake -S . -B build -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=ON
cmake --build build
#
# Run examples, tests and checks
#
- name: Run examples, tests and checks
working-directory: build
run: ctest
69 changes: 14 additions & 55 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, macos-latest, windows-2022]
gfortran-version: [12, 13, 14]
gfortran-from: [system, conda]
rte-kernels: [default, accel]
fpmodel: [DP, SP]
exclude:
- os: ubuntu-24.04
gfortran-from: conda
- os: macos-13
gfortran-from: system
- os: macos-13
gfortran-version: 14
gfortran-from: conda
- os: macos-latest
gfortran-from: system
- os: macos-latest
gfortran-version: 14
gfortran-from: conda
- os: windows-2022
include:
- os: ubuntu-24.04
gfortran-version: 13
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 13
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 13
gfortran-from: conda
fpmodel: SP
- os: windows-2022
gfortran-version: 14
gfortran-from: conda
fpmodel: DP
- os: windows-2022
gfortran-version: 14
gfortran-from: conda
fpmodel: SP
build-type: [Debug, RelWithDebugInfo]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We test RelWithDebugInfo with no extra flags in conda-style-builds.yml. Instead of Debug with extra flags and RelWithDebugInfo without extra flags, I would test only RelWithDebugInfo with extra flags in this workflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor(?) difference is that continuous-integration uses the system gfortran while conda-style-builds uses the conda-installed gfortran.

I was thinking of continuous-integration as a way to run the code with maximum debugging, which motivated Debug builds with extra flags. @skosukhin Do you think we'll be able to isolate any errors introduced with RelWithDebugInfo?

# Add Release config?
# Exclude RelWithDebugInfo/accel combinations?
env:
FC: gfortran-${{ matrix.gfortran-version }}
FFLAGS: "-m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan"
CMAKE_BUILD_PARALLEL_LEVEL: 8
VERBOSE:
CTEST_PARALLEL_LEVEL: 8
CTEST_OUTPUT_ON_FAILURE: 1
runs-on: ${{ matrix.os }}
FC: gfortran-14
runs-on: ubuntu-24.04 # latest?
steps:
#
# Check out repository under $GITHUB_WORKSPACE
Expand All @@ -77,7 +42,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: conda-pkgs-${{ matrix.os }}
key: conda-pkgs
#
# Set up Conda
#
Expand All @@ -89,35 +54,29 @@ jobs:
environment-file: environment-noplots.yml
python-version: 3.11
auto-activate-base: false
conda-remove-defaults: true
# Use the cache properly:
use-only-tar-bz2: false
#
# Install compiler
#
- name: Install compiler
if: matrix.gfortran-from == 'conda'
run: |
conda install -c conda-forge gfortran=${{ matrix.gfortran-version }} -y
echo "FC=gfortran" >> "$GITHUB_ENV"
#
# Install dependencies
#
- name: Install dependencies
run: conda install -c conda-forge netcdf-fortran ninja -y
#
# Adjust toolchain
# Add debug flags
#
- name: Adjust toolchain
if: matrix.os == 'windows-2022'
run: echo "FC=${FC}.exe" >> "$GITHUB_ENV"
- name: Add debug flags
if: matrix.build-type == 'Debug'
run: echo "FFLAGS=-std=f2008 -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan" >> "$GITHUB_ENV"
#
# Build libraries, examples, and tests
#
- name: Build libraries and tests
run: |
cmake -S . -B build -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DRTE_ENABLE_SP="$(test '${{ matrix.fpmodel }}' = SP && echo ON || echo OFF)" \
-DKERNEL_MODE=${{ matrix.rte-kernels }} \
-DBUILD_TESTING=ON
cmake --build build
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
pre-commit:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
Loading