hdf5: drop support for libtool files (#21900)

This commit is contained in:
Sergey Kosukhin 2021-02-25 21:41:41 +01:00 committed by GitHub
parent 0754d101d2
commit 177117745f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,11 @@ class Hdf5(AutotoolsPackage):
test_requires_compiler = True test_requires_compiler = True
# We rely on the *.la files to be removed and, therefore, do not try to make
# sure that they are correct. The following is a precaution against someone
# blindly changing the value to True, either here or in the baseclass.
install_libtool_archives = False
version('develop', branch='develop') version('develop', branch='develop')
version('1.12.0', sha256='a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a') version('1.12.0', sha256='a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a')
@ -229,40 +234,28 @@ def fortran_check(self):
msg = 'cannot build a Fortran variant without a Fortran compiler' msg = 'cannot build a Fortran variant without a Fortran compiler'
raise RuntimeError(msg) raise RuntimeError(msg)
def with_or_without_szip(self, activated):
return '--{0}-szlib'.format('with' if activated else 'without')
def configure_args(self): def configure_args(self):
# Always enable this option. This does not actually enable any # Always enable this option. This does not actually enable any
# features: it only *allows* the user to specify certain # features: it only *allows* the user to specify certain
# combinations of other arguments. Enabling it just skips a # combinations of other arguments. Enabling it just skips a
# sanity check in configure, so this doesn't merit a variant. # sanity check in configure, so this doesn't merit a variant.
extra_args = ['--enable-unsupported'] extra_args = ['--enable-unsupported',
extra_args += ['--enable-symbols=yes'] '--enable-symbols=yes',
'--with-zlib']
extra_args += self.enable_or_disable('threadsafe') extra_args += self.enable_or_disable('threadsafe')
extra_args += self.enable_or_disable('cxx') extra_args += self.enable_or_disable('cxx')
extra_args += self.enable_or_disable('hl') extra_args += self.enable_or_disable('hl')
extra_args += self.enable_or_disable('fortran') extra_args += self.enable_or_disable('fortran')
extra_args += self.enable_or_disable('java') extra_args += self.enable_or_disable('java')
extra_args += self.with_or_without('szip')
api = self.spec.variants['api'].value api = self.spec.variants['api'].value
if api != 'none': if api != 'none':
extra_args.append('--with-default-api-version=' + api) extra_args.append('--with-default-api-version=' + api)
if '+szip' in self.spec:
szip_spec = self.spec['szip']
# The configure script of HDF5 accepts a comma-separated tuple of
# two paths: the first one points to the directory with include
# files, the second one points to the directory with library files.
# If the second path is not specified, the configure script assumes
# that it equals to prefix/lib. However, the correct directory
# might be prefix/lib64. It is not a problem when the building is
# done with Spack's compiler wrapper but it makes the Libtool
# files (*.la) invalid, which makes it problematic to use the
# installed library outside of Spack environment.
extra_args.append('--with-szlib=%s,%s' %
(szip_spec.headers.directories[0],
szip_spec.libs.directories[0]))
else:
extra_args.append('--without-szlib')
if self.spec.satisfies('@1.10:'): if self.spec.satisfies('@1.10:'):
if '+debug' in self.spec: if '+debug' in self.spec:
extra_args.append('--enable-build-mode=debug') extra_args.append('--enable-build-mode=debug')
@ -308,8 +301,6 @@ def configure_args(self):
if '+fortran' in self.spec: if '+fortran' in self.spec:
extra_args.append('FC=%s' % self.spec['mpi'].mpifc) extra_args.append('FC=%s' % self.spec['mpi'].mpifc)
extra_args.append('--with-zlib=%s' % self.spec['zlib'].prefix)
return extra_args return extra_args
@run_after('configure') @run_after('configure')