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

ci(netcdf): add netcdf-fortran dependency to extended (parallel) test #1451

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,27 @@ jobs:
uses: mamba-org/setup-micromamba@v1
with:
environment-file: modflow6/environment.yml
create-args: >-
netcdf-fortran
init-shell: >-
bash
powershell
cache-environment: true
cache-downloads: true

- name: Update PKG_CONFIG_PATH
working-directory: modflow6
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "PKG_CONFIG_PATH=/home/runner/micromamba/envs/modflow6/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be done platform-independently via CONDA_PREFIX env var or environment-path output

elif [ "$RUNNER_OS" == "macOS" ]; then
echo "PKG_CONFIG_PATH=/Users/runner/micromamba/envs/modflow6/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
fi

- name: Build modflow6
working-directory: modflow6
run: |
meson setup builddir -Ddebug=false -Dparallel=true --prefix=$(pwd) --libdir=bin
meson setup builddir -Ddebug=false -Dextended=true --prefix=$(pwd) --libdir=bin
meson install -C builddir
meson test --verbose --no-rebuild -C builddir

Expand All @@ -522,6 +533,20 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0 get_exes.py

- name: Confirm netcdf license logged
working-directory: modflow6/autotest
env:
REPOS_PATH: ${{ github.workspace }}
run: |
pytest test_gwf_chd01.py --keep temp
if grep -Fx " NetCDF, network Common Data Form software library" temp/test_mf6model[chd01]0/mfsim.lst
then
echo "NetCDF license logging confirmed."
else
echo "NetCDF license logging not found."
exit 1
fi

- name: Test programs (parallel)
working-directory: modflow6/autotest
env:
Expand Down
12 changes: 5 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,16 @@ if is_extended_build

# find netcdf
if build_machine.system() != 'windows'
netcdf = dependency('netcdf', language : 'fortran', required : false)
netcdf = dependency('netcdf', language : 'fortran', required : true)
else
# For CI testing only; Windows not yet supported
nc_dir = meson.project_source_root() / '..' / 'ncf' / 'netcdf-fortran-4.6.1' / 'fortran'
netcdf = fc.find_library('netcdff', dirs: [ nc_dir ], required : false, static : false)
netcdf = fc.find_library('netcdff', dirs: [ nc_dir ], required : true, static : false)
#nc_incdir = include_directories([ nc_dir ])
endif
if netcdf.found()
with_netcdf = true
extra_cmp_args += [ '-D__WITH_NETCDF__' ]
dependencies += [ netcdf ]
endif
extra_cmp_args += [ '-D__WITH_NETCDF__' ]
dependencies += [ netcdf ]
with_netcdf = true
else
with_netcdf = false
with_petsc = false
Expand Down