summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py
index d59db3d4f6..28287c48ee 100644
--- a/var/spack/repos/builtin/packages/mfem/package.py
+++ b/var/spack/repos/builtin/packages/mfem/package.py
@@ -474,10 +474,14 @@ class Mfem(Package):
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 @@ class Mfem(Package):
@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