From eb7c79720de66cc7b74ac0c6a1ce1d44ee670cd5 Mon Sep 17 00:00:00 2001 From: "Nichols A. Romero" Date: Thu, 18 Apr 2019 13:00:24 -0500 Subject: 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. --- var/spack/repos/builtin/packages/qmcpack/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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)) -- cgit v1.2.3-70-g09d2