summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorNichols A. Romero <naromero77@users.noreply.github.com>2019-04-18 13:00:24 -0500
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-04-18 20:00:24 +0200
commiteb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5 (patch)
tree3315a4786c166f793d89a3f0912aa7b1043ede83 /var
parentc7725e9ff898b7205560443b564889b94b5303e8 (diff)
downloadspack-eb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5.tar.gz
spack-eb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5.tar.bz2
spack-eb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5.tar.xz
spack-eb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5.zip
QMCPACK CMake fix (#11212)
* cflags and cxxflags from packages.yaml need to be passed into QMCPACK's CMake explictly for now. * You need the ifcore library from the Intel compler to be manually linked in when you linked against a LAPACK provider that is not MKL.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/qmcpack/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py
index e8f88f825f..fdf3ab1539 100644
--- a/var/spack/repos/builtin/packages/qmcpack/package.py
+++ b/var/spack/repos/builtin/packages/qmcpack/package.py
@@ -180,6 +180,26 @@ class Qmcpack(CMakePackage, CudaPackage):
spec = self.spec
args = []
+ # This bit of code is needed in order to pass compiler.yaml flags
+ # into the QMCPACK's CMake. Probably the CMake base class in
+ # the code of Spack should be doing this instead. Otherwise, it
+ # it would need to be done on a per package basis which is
+ # problematic.
+ cflags = spec.compiler_flags['cflags']
+ cxxflags = spec.compiler_flags['cxxflags']
+ args.append('-DCMAKE_C_FLAGS=%s' % ' '.join(cflags))
+ args.append('-DCMAKE_CXX_FLAGS=%s' % ' '.join(cxxflags))
+
+ # This issue appears specifically with the the Intel compiler,
+ # but may be an issue with other compilers as well. The final fix
+ # probably needs to go into QMCPACK's CMake instead of in Spack.
+ # QMCPACK binaries are linked with the C++ compiler, but *may* contain
+ # Fortran libraries such as NETLIB-LAPACK and OpenBLAS on the link
+ # line. For the case of the Intel C++ compiler, we need to manually
+ # add a libray from the Intel Fortran compiler.
+ if '%intel' in spec:
+ args.append('-DQMC_EXTRA_LIBS=-lifcore')
+
if '+mpi' in spec:
mpi = spec['mpi']
args.append('-DCMAKE_C_COMPILER={0}'.format(mpi.mpicc))