From 54f76f7c512dab6e702c37b15469c6185c39cf18 Mon Sep 17 00:00:00 2001 From: "Nichols A. Romero" Date: Sun, 30 Dec 2018 11:29:28 -0600 Subject: Over specifying Quantum Espresso compiler variables causes problems in some corner cases. (#10216) --- .../builtin/packages/quantum-espresso/package.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py index 05ae5c4c38..5442ff0a43 100644 --- a/var/spack/repos/builtin/packages/quantum-espresso/package.py +++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py @@ -109,12 +109,25 @@ class QuantumEspresso(Package): prefix_path = prefix.bin if '@:5.4.0' in spec else prefix options = ['-prefix={0}'.format(prefix_path)] + # QE autoconf compiler variables has some limitations: + # 1. There is no explicit MPICC variable so we must re-purpose + # CC for the case of MPI. + # 2. F90 variable is set to be consistent with MPIF90 wrapper + # 3. If an absolute path for F90 is set, the build system breaks. + # + # Thus, due to 2. and 3. the F90 variable is not explictly set + # because it would be mostly pointless and could lead to erroneous + # behaviour. if '+mpi' in spec: mpi = spec['mpi'] options.append('--enable-parallel=yes') options.append('MPIF90={0}'.format(mpi.mpifc)) + options.append('CC={0}'.format(mpi.mpicc)) else: options.append('--enable-parallel=no') + options.append('CC={0}'.format(env['SPACK_CC'])) + + options.append('F77={0}'.format(env['SPACK_F77'])) if '+openmp' in spec: options.append('--enable-openmp') @@ -178,12 +191,6 @@ class QuantumEspresso(Package): if '+hdf5' in spec: options.append('--with-hdf5={0}'.format(spec['hdf5'].prefix)) - options.extend([ - 'F77={0}'.format(env['SPACK_F77']), - 'F90={0}'.format(env['SPACK_FC']), - 'CC={0}'.format(env['SPACK_CC']) - ]) - configure(*options) # Apparently the build system of QE is so broken that: -- cgit v1.2.3-70-g09d2