petsc: switch hdf5 spec from --with-hdf5-dir to --with-hdf5-lib (#16376)

This way - we can detect and use hdf5:hl,fortran - if enabled, but not require it as a dependency
This commit is contained in:
Satish Balay 2020-04-30 10:40:25 -05:00 committed by GitHub
parent 3a3f871718
commit b2df39ea3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,7 +296,7 @@ def install(self, spec, prefix):
]) ])
# Activates library support if needed # Activates library support if needed
for library in ('cuda', 'metis', 'hdf5', 'hypre', 'parmetis', for library in ('cuda', 'metis', 'hypre', 'parmetis',
'mumps', 'trilinos', 'fftw', 'valgrind'): 'mumps', 'trilinos', 'fftw', 'valgrind'):
options.append( options.append(
'--with-{library}={value}'.format( '--with-{library}={value}'.format(
@ -339,6 +339,16 @@ def install(self, spec, prefix):
else: else:
options.append('--with-suitesparse=0') options.append('--with-suitesparse=0')
# hdf5: configure detection is convoluted for pflotran
if '+hdf5' in spec:
options.extend([
'--with-hdf5-include=%s' % spec['hdf5'].prefix.include,
'--with-hdf5-lib=%s' % spec['hdf5:hl,fortran'].libs.joined(),
'--with-hdf5=1'
])
else:
options.append('--with-hdf5=0')
# zlib: configuring using '--with-zlib-dir=...' has some issues with # zlib: configuring using '--with-zlib-dir=...' has some issues with
# SuiteSparse so specify directly the include path and the libraries. # SuiteSparse so specify directly the include path and the libraries.
if 'zlib' in spec: if 'zlib' in spec: