forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved macOS support via autoconf; GitHub CI
This patch modifies the autoconf configuration to provide better support on Mac OS and other BSD-based systems. Macros are included for the following operations: * Detect if `sigsetjmp` (BSD) or `__sigsetjmp` (glibc; Linux) is available. * Test the size of jmp_buf and sigjmp_buf The "sensible" Linux defaults are still present, but autoconf should now populate these variables when used. A MacOS CI test for GitHub actions has also been included, but this probably needs additional work.
- Loading branch information
1 parent
c886ae7
commit a53af30
Showing
5 changed files
with
143 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: 'Build-.testing-prerequisites' | ||
description: 'Build pre-requisites for .testing including FMS and a symmetric MOM6 executable' | ||
inputs: | ||
build_symmetric: | ||
description: 'If true, will build the symmetric MOM6 executable' | ||
required: false | ||
default: 'true' | ||
install_python: | ||
description: 'If true, will install the local python env needed for .testing' | ||
required: false | ||
default: 'true' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Git info | ||
shell: bash | ||
run: | | ||
echo "::group::Git commit info" | ||
echo "git log:" | ||
git log | head -60 | ||
echo "::endgroup::" | ||
- name: Env | ||
shell: bash | ||
run: | | ||
echo "::group::Environment" | ||
env | ||
echo "::endgroup::" | ||
- name: Install needed packages for compiling | ||
shell: bash | ||
run: | | ||
echo "::group::Install packages" | ||
brew update | ||
brew install automake | ||
brew install gfortran | ||
brew install netcdf | ||
brew install mpich | ||
echo "::endgroup::" | ||
- name: Compile FMS library | ||
shell: bash | ||
run: | | ||
echo "::group::Compile FMS library" | ||
cd .testing | ||
make deps/lib/libFMS.a -s -j | ||
echo "::endgroup::" | ||
- name: Store compiler flags used in Makefile | ||
shell: bash | ||
run: | | ||
echo "::group::config.mk" | ||
cd .testing | ||
echo "FCFLAGS_DEBUG=-g -O0 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds" >> config.mk | ||
echo "FCFLAGS_REPRO=-g -O2 -fbacktrace" >> config.mk | ||
echo "FCFLAGS_INIT=-finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk | ||
cat config.mk | ||
echo "::endgroup::" | ||
- name: Compile MOM6 in symmetric memory mode | ||
shell: bash | ||
run: | | ||
echo "::group::Compile MOM6 in symmetric memory mode" | ||
cd .testing | ||
test ${{ inputs.build_symmetric }} == true && make build/symmetric/MOM6 -j | ||
echo "::endgroup::" | ||
- name: Install local python venv for generating input data | ||
shell: bash | ||
run: | | ||
echo "::group::Create local python env for input data generation" | ||
cd .testing | ||
test ${{ inputs.install_python }} == true && make work/local-env | ||
echo "::endgroup::" | ||
- name: Set flags | ||
shell: bash | ||
run: | | ||
echo "TIMEFORMAT=... completed in %lR (user: %lU, sys: %lS)" >> $GITHUB_ENV |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: MacOS Stencil related verification | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-macos-symmetric-layout-rotation: | ||
|
||
runs-on: macOS-latest | ||
|
||
# TODO: Move these to the macos config file? | ||
env: | ||
CC: gcc-11 | ||
FC: gfortran-11 | ||
|
||
defaults: | ||
run: | ||
working-directory: .testing | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: ./.github/actions/macos-setup | ||
|
||
- name: Compile MOM6 in asymmetric memory mode | ||
run: make build/asymmetric/MOM6 -j | ||
|
||
- name: Create validation data | ||
run: make run.symmetric -k -s | ||
|
||
- name: Run tests | ||
run: make test.grid test.layout test.rotate -k -s |
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
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
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