Skip to content

Commit decc705

Browse files
authored
fix(meson.build): separate parallel/extended dependencies (#1926)
Separate logic for parallel and extended builds. Previously a netcdf dependency was declared even for a parallel-only (not extended) build. This can cause issues if meson detects a netcdf that has been improperly installed or incompletely setup as seems to now be the case on Mac CI runner images
1 parent 8203968 commit decc705

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/actions/test-extended/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ runs:
7474
shell: bash
7575
working-directory: modflow6
7676
run: |
77-
pixi run setup -Dparallel=true builddir
77+
pixi run setup -Dextended=true builddir
7878
pixi run build builddir
7979
pixi run test builddir
8080

meson.build

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,14 @@ endif
100100

101101
# parallel build options
102102
is_extended_build = get_option('extended')
103+
is_parallel_build = get_option('parallel') or is_extended_build
103104
is_cray = get_option('cray')
104105
is_mpich = get_option('mpich')
105106
if is_cray and build_machine.system() != 'linux'
106-
error('cray=true only supported on linux systems')
107+
error('cray only supported on linux systems')
107108
endif
108-
if not is_extended_build
109-
is_extended_build = get_option('parallel')
110-
endif
111-
if is_cray and not is_extended_build
112-
is_extended_build = true
109+
if is_cray and not is_parallel_build
110+
is_parallel_build = true
113111
is_mpich = true
114112
endif
115113
if is_mpich
@@ -119,7 +117,12 @@ if is_mpich
119117
mpifort_name = 'mpichfort'
120118
endif
121119
endif
122-
message('Extended build:', is_extended_build)
120+
121+
if is_extended_build
122+
message('Extended build:', is_extended_build)
123+
elif is_parallel_build
124+
message('Parallel build:', is_parallel_build)
125+
endif
123126

124127
# windows options for petsc
125128
petsc_dir_rel = '..' /'petsc'
@@ -140,7 +143,7 @@ dependencies = [ ]
140143
extra_cmp_args = [ ]
141144

142145
# load petsc, mpi, and netcdf dependencies/libraries
143-
if is_extended_build
146+
if is_parallel_build or is_extended_build
144147
# find petsc
145148
if build_machine.system() != 'windows'
146149
petsc = dependency('PETSc', required : true)
@@ -162,7 +165,12 @@ if is_extended_build
162165
endif
163166
extra_cmp_args += [ '-D__WITH_MPI__']
164167
with_mpi = true
168+
else
169+
with_petsc = false
170+
with_mpi = false
171+
endif
165172

173+
if is_extended_build
166174
# find netcdf
167175
if build_machine.system() != 'windows'
168176
netcdff = dependency('netcdf', language : 'fortran', required : false)
@@ -181,8 +189,6 @@ if is_extended_build
181189
endif
182190
else
183191
with_netcdf = false
184-
with_petsc = false
185-
with_mpi = false
186192
endif
187193

188194
# GCC profile options need to be netcdf aware due to HDF5 issue
@@ -208,7 +214,7 @@ compile_args += extra_cmp_args
208214
add_project_arguments(fc.get_supported_arguments(compile_args), language: 'fortran')
209215
add_project_link_arguments(fc.get_supported_arguments(link_args), language: 'fortran')
210216

211-
if is_extended_build and build_machine.system() == 'windows'
217+
if is_parallel_build and build_machine.system() == 'windows'
212218
message('Compiling PETSc Fortran modules')
213219
petsc_incdir = include_directories([petsc_dir_rel / 'include', petsc_compiled_rel / 'include'])
214220
petsc_src = petsc_dir_abs / 'src'

0 commit comments

Comments
 (0)