summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2018-06-11 18:42:13 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2018-06-11 11:42:13 -0500
commit004e9b8948c44417997f0f0af94884436dcf5a4e (patch)
treeb020f677aae9362c40b5b7df19a0fb64003d08b9
parentd943754e923a2c63017fa42519cabcef7dfca4aa (diff)
downloadspack-004e9b8948c44417997f0f0af94884436dcf5a4e.tar.gz
spack-004e9b8948c44417997f0f0af94884436dcf5a4e.tar.bz2
spack-004e9b8948c44417997f0f0af94884436dcf5a4e.tar.xz
spack-004e9b8948c44417997f0f0af94884436dcf5a4e.zip
Fixed compilation of quantum-espresso (#8439)
The patch to select ELPA API needs to be applied to version 6.2.0 too. The link line of hdf5 is computed incorrectly from the configuration part of the build-system. To fix this the relevant file (make.inc) is patched.
-rw-r--r--var/spack/repos/builtin/packages/quantum-espresso/package.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py
index 96bdda65e2..a90eaf4b9d 100644
--- a/var/spack/repos/builtin/packages/quantum-espresso/package.py
+++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py
@@ -82,8 +82,8 @@ class QuantumEspresso(Package):
depends_on('elpa~openmp', when='+elpa~openmp')
depends_on('hdf5', when='+hdf5')
- patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.004')
- patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.003')
+ patch('dspev_drv_elpa.patch', when='@6.1.0:+elpa ^elpa@2016.05.004')
+ patch('dspev_drv_elpa.patch', when='@6.1.0:+elpa ^elpa@2016.05.003')
# We can't ask for scalapack or elpa if we don't want MPI
conflicts(
@@ -165,6 +165,24 @@ class QuantumEspresso(Package):
configure(*options)
+ # Apparently the build system of QE is so broken that:
+ #
+ # 1. The variable reported on stdout as HDF5_LIBS is actually
+ # called HDF5_LIB (singular)
+ # 2. The link flags omit a few `-L` from the line, and this
+ # causes the linker to break
+ #
+ # Below we try to match the entire HDF5_LIB line and substitute
+ # with the list of libraries that needs to be linked.
+ if '+hdf5' in spec:
+ make_inc = join_path(self.stage.source_path, 'make.inc')
+ hdf5_libs = ' '.join(spec['hdf5:hl,fortran'].libs)
+ filter_file(
+ 'HDF5_LIB([\s]*)=([\s\w\-\/.,]*)',
+ 'HDF5_LIB = {0}'.format(hdf5_libs),
+ make_inc
+ )
+
make('all')
if 'platform=darwin' in spec: