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 all 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]
build-type: [RelWithDebugInfo]
env:
FC: gfortran
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 (testing scripts only)
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
#
# 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=${{ matrix.build-type}} \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since there is only one value for the build-type in the matrix now, should we remove it and have the following here?

Suggested change
-DCMAKE_BUILD_TYPE=${{ matrix.build-type}} \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \

-DRTE_ENABLE_SP=OFF \
-DBUILD_TESTING=ON
cmake --build build
#
# Run examples, tests and checks
#
- name: Run examples, tests and checks
working-directory: build
run: ctest
124 changes: 25 additions & 99 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,120 +9,46 @@ on:

defaults:
run:
# Enable Conda environment by using the login shell:
shell: bash -leo pipefail {0}
shell: bash -eo pipefail {0}

jobs:
CI:
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

env:
FC: gfortran-${{ matrix.gfortran-version }}
FFLAGS: "-m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan"
FFLAGS: -std=f2008 -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 }}
runs-on: ubuntu-24.04
steps:
#
# Check out repository under $GITHUB_WORKSPACE
#
- name: Check out code
- name: Check out
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 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
#
- name: Adjust 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 \
sudo apt-get update
sudo apt-get install --no-install-recommends --assume-yes \
libnetcdff-dev \
python3-dask \
python3-h5netcdf \
python3-numpy \
python3-scipy \
python3-xarray
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DRTE_ENABLE_SP="$(test '${{ matrix.fpmodel }}' = SP && echo ON || echo OFF)" \
-DKERNEL_MODE=${{ matrix.rte-kernels }} \
-DBUILD_TESTING=ON
cmake --build build
#
# Run examples, tests and checks
#
- name: Run examples, tests and checks
working-directory: build
run: ctest
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build
- name: Install
run: sudo cmake --install build
2 changes: 1 addition & 1 deletion .github/workflows/doc-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
# Deploy documentation
#
- name: Deploy API Documentation
uses: JamesIves/github-pages-deploy-action@v4.7.2
uses: JamesIves/github-pages-deploy-action@v4.7.3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
branch: gh-pages
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
9 changes: 1 addition & 8 deletions rte-kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ if(BUILD_SHARED_LIBS)
endif()

target_compile_definitions(
rtekernels
PRIVATE $<$<BOOL:${RTE_ENABLE_SP}>:RTE_USE_SP>
rtekernels
$<$<BOOL:${RTE_BOOL}>:RTE_BOOL>
rtekernels
$<$<BOOL:${RTE_PRECISION}>:RTE_PRECISION>
rtekernels
$<$<BOOL:${RTE_EPSILON}>:RTE_EPSILON>
rtekernels PRIVATE $<$<BOOL:${RTE_ENABLE_SP}>:RTE_USE_SP>
)

target_include_directories(rtekernels PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
Expand Down
Loading