diff options
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/package.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 9defe6ed5e..ef61b312fe 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -63,6 +63,8 @@ class Hdf5(AutotoolsPackage): variant('szip', default=False, description='Enable szip support') variant('threadsafe', default=False, description='Enable thread-safe capabilities') + variant('pic', default=True, + description='Produce position-independent code (for shared libs)') depends_on('mpi', when='+mpi') depends_on('szip', when='+szip') @@ -121,6 +123,11 @@ class Hdf5(AutotoolsPackage): if spec.satisfies('@:1.8.16'): extra_args.append('--enable-fortran2003') + if '+pic' in spec: + extra_args.append('CFLAGS={0}'.format(self.compiler.pic_flag)) + extra_args.append('CXXFLAGS={0}'.format(self.compiler.pic_flag)) + extra_args.append('FFLAGS={0}'.format(self.compiler.pic_flag)) + if '+mpi' in spec: # The HDF5 configure script warns if cxx and mpi are enabled # together. There doesn't seem to be a real reason for this, except |