QMCPACK Oct2019 fix buglets (#13069)

* Support different CMake build types correctly.

* LIBXML2 variables no longer used.

* Fix E501 as part of https://github.com/spack/spack/pull/13069
This commit is contained in:
Nichols A. Romero 2019-10-08 20:46:15 -05:00 committed by Adam J. Stewart
parent 8de453af54
commit 2794e52ddd

View file

@ -33,7 +33,9 @@ class Qmcpack(CMakePackage, CudaPackage):
version('3.1.0', tag='v3.1.0') version('3.1.0', tag='v3.1.0')
# These defaults match those in the QMCPACK manual # These defaults match those in the QMCPACK manual
variant('debug', default=False, description='Build debug version') variant('build_type', default='Release',
description='The build type to build',
values=('Debug', 'Release', 'RelWithDebInfo'))
variant('mpi', default=True, description='Build with MPI support') variant('mpi', default=True, description='Build with MPI support')
variant('phdf5', default=True, description='Build with parallel collective I/O') variant('phdf5', default=True, description='Build with parallel collective I/O')
variant('complex', default=False, variant('complex', default=False,
@ -184,10 +186,14 @@ def cmake_args(self):
# Currently FFTW_HOME and LIBXML2_HOME are used by CMake. # Currently FFTW_HOME and LIBXML2_HOME are used by CMake.
# Any CMake warnings about other variables are benign. # Any CMake warnings about other variables are benign.
xml2_prefix = spec['libxml2'].prefix # Starting with QMCPACK 3.8.0, CMake uses the builtin find(libxml2)
args.append('-DLIBXML2_HOME={0}'.format(xml2_prefix)) # function
args.append('-DLibxml2_INCLUDE_DIRS={0}'.format(xml2_prefix.include)) if spec.satisfies('@:3.7.0'):
args.append('-DLibxml2_LIBRARY_DIRS={0}'.format(xml2_prefix.lib)) xml2_prefix = spec['libxml2'].prefix
args.append('-DLIBXML2_HOME={0}'.format(xml2_prefix))
args.append(
'-DLibxml2_INCLUDE_DIRS={0}'.format(xml2_prefix.include))
args.append('-DLibxml2_LIBRARY_DIRS={0}'.format(xml2_prefix.lib))
if '^fftw@3:' in spec: if '^fftw@3:' in spec:
fftw_prefix = spec['fftw'].prefix fftw_prefix = spec['fftw'].prefix