# IT4Innovations 2020
# JH 2020

easyblock = 'CMakeMake'

name = 'QMCPACK'
version = '3.9.1'
versionsuffix = "-Python-%(pyver)s"

homepage = "https://qmcpack.org/"
description = """QMCPACK, is a modern high-performance open-source Quantum Monte Carlo (QMC) simulation code. Its main applications are electronic structure calculations of molecular, quasi-2D and solid-state systems. Variational Monte Carlo (VMC), diffusion Monte Carlo (DMC) and a number of other advanced QMC algorithms are implemented. Orbital space auxiliary field QMC (AFQMC) has recently been added. By directly solving the Schrodinger equation, QMC methods offer greater accuracy than methods such as density functional theory, but at a trade-off of much greater local_computational expense.
"""

toolchain = {'name': 'intel', 'version': '2020a'}
toolchainopts = {'opt': True, 'pic': True, 'usempi': True}

source_urls = ['https://github.com/QMCPACK/qmcpack/archive/']
sources = ['v%(version)s.tar.gz']

builddependencies = [('CMake', '3.16.4')]

dependencies = [
    ('libxml2', '2.9.10'),
    ('Boost', '1.72.0'),
    ('HDF5', '1.10.6', '', ('iimpi', '2020a')),
    ('Python', '3.8.2'),
    ('h5py', '2.10.0', versionsuffix),
]

separate_build_dir = True

configopts = ' -DENABLE_SOA=1 '

#preinstallopts = [
#    #'cp %(builddir)s/easybuild_obj/ %(installdir)s/build -R',
#    'cd %(builddir)s/easybuild_obj/ && ',
#    'ctest -R deterministic -LE unstable && ',
#    'ctest -R short -LE unstable && '
#]

sanity_check_paths = {
    'files': ['bin/qmcpack'],
    'dirs': ['bin'],
}

moduleclass = 'phys'
