diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86edea78f9f..276795c252d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -494,16 +494,23 @@ 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: | + echo "PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV + - 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 @@ -522,6 +529,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: diff --git a/meson.build b/meson.build index 211bdc3921c..416be2eaf2a 100644 --- a/meson.build +++ b/meson.build @@ -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