mfem: Fix support for SUNDIALS and PETSc features (#19326)

* mfem: specify PETSC_DIR, link correct sundials libraries

* fix: only use PETSC_DIR directly for static builds

* fix: only use sundials nvecmpiplusx for MFEM 4.2+
This commit is contained in:
Josh Essman 2020-10-20 16:26:34 -05:00 committed by GitHub
parent fa9ad0a3da
commit cee5c2e755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -474,10 +474,14 @@ def find_optional_library(name, prefix):
ld_flags_from_library_list(spec[sun_spec].libs)]
if '+petsc' in spec:
options += [
'PETSC_OPT=%s' % spec['petsc'].headers.cpp_flags,
'PETSC_LIB=%s' %
ld_flags_from_library_list(spec['petsc'].libs)]
if '+shared' in spec:
options += [
'PETSC_OPT=%s' % spec['petsc'].headers.cpp_flags,
'PETSC_LIB=%s' %
ld_flags_from_library_list(spec['petsc'].libs)]
else:
options += [
'PETSC_DIR=%s' % spec['petsc'].prefix]
if '+pumi' in spec:
pumi_libs = ['pumi', 'crv', 'ma', 'mds', 'apf', 'pcu', 'gmi',
@ -676,9 +680,12 @@ def suitesparse_components(self):
@property
def sundials_components(self):
"""Return the SUNDIALS components needed by MFEM."""
sun_comps = 'arkode,cvode,nvecserial,kinsol'
sun_comps = 'arkode,cvodes,nvecserial,kinsol'
if '+mpi' in self.spec:
sun_comps += ',nvecparhyp,nvecparallel'
if self.spec.satisfies('@4.2:'):
sun_comps += ',nvecparallel,nvecmpiplusx'
else:
sun_comps += ',nvecparhyp,nvecparallel'
return sun_comps
@property