Skip to content
Snippets Groups Projects
Unverified Commit ac4d0c3a authored by TZ's avatar TZ Committed by GitHub
Browse files

Quantum-Espresso: qe-6.5 fails to detect MKL for FFT (#15276)

* Quantum-Espresso: qe-6.5 fails to detect MKL for FFT

qe-6.5 fails to detect MKL for FFT if BLAS_LIBS is set due to
an unfortunate upsteam change in their autoconf/configure:
- qe-6.5/install/m4/x_ac_qe_blas.m4 only sets 'have_blas'
  but no 'have_mkl' if BLAS_LIBS is set (which seems to be o.k.)
- however, qe-6.5/install/m4/x_ac_qe_fft.m4 in 6.5 unfortunately
  relies on x_ac_qe_blas.m4 to detect MKL and set 'have_mkl'
- qe-5.4 up to 6.4.1 had a different logic and worked fine with
  BLAS_LIBS being set
However, MKL is correctly picked up by qe-6.5 for BLAS and FFT if
MKLROOT is set (which SPACK does automatically for ^intel-mkl).
Thus, do not set BLAS_LIBS when compiling qe-6.5 with intel-mkl.

* replace all '^intel-mkl' by '^mkl' to match other packages which also provide MKL

e.g. intel-parallel-studio+mkl as mentioned by @adamjstewart in #15276
parent 501fdc75
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ class QuantumEspresso(Package):
# Conflicts
# MKL with 64-bit integers not supported.
conflicts(
'^intel-mkl+ilp64',
'^mkl+ilp64',
msg='Quantum ESPRESSO does not support MKL 64-bit integer variant'
)
......@@ -211,7 +211,7 @@ def install(self, spec, prefix):
# you need to pass it in the FFTW_INCLUDE and FFT_LIBS directory.
# QE supports an internal FFTW2, but only an external FFTW3 interface.
if '^intel-mkl' in spec:
if '^mkl' in spec:
# A seperate FFT library is not needed when linking against MKL
options.append(
'FFTW_INCLUDE={0}'.format(join_path(env['MKLROOT'],
......@@ -230,10 +230,21 @@ def install(self, spec, prefix):
# appear twice in in link line but this is harmless
lapack_blas = spec['lapack'].libs + spec['blas'].libs
options.append('BLAS_LIBS={0}'.format(lapack_blas.ld_flags))
# qe-6.5 fails to detect MKL for FFT if BLAS_LIBS is set due to
# an unfortunate upsteam change in their autoconf/configure:
# - qe-6.5/install/m4/x_ac_qe_blas.m4 only sets 'have_blas'
# but no 'have_mkl' if BLAS_LIBS is set (which seems to be o.k.)
# - however, qe-6.5/install/m4/x_ac_qe_fft.m4 in 6.5 unfortunately
# relies on x_ac_qe_blas.m4 to detect MKL and set 'have_mkl'
# - qe-5.4 up to 6.4.1 had a different logic and worked fine with
# BLAS_LIBS being set
# However, MKL is correctly picked up by qe-6.5 for BLAS and FFT if
# MKLROOT is set (which SPACK does automatically for ^mkl)
if not ('quantum-espresso@6.5' in spec and '^mkl' in spec):
options.append('BLAS_LIBS={0}'.format(lapack_blas.ld_flags))
if '+scalapack' in spec:
scalapack_option = 'intel' if '^intel-mkl' in spec else 'yes'
scalapack_option = 'intel' if '^mkl' in spec else 'yes'
options.append('--with-scalapack={0}'.format(scalapack_option))
if '+elpa' in spec:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment