# IT4Innovations 2021
# LK

easyblock = "PythonPackage"

name = 'GPAW'
version = '21.1.0'
versionsuffix = '-Py-3.7'

homepage = 'https://wiki.fysik.dtu.dk/gpaw/'
description = """GPAW is a density-functional theory (DFT) Python code based on the projector-augmented wave (PAW)
 method and the atomic simulation environment (ASE). It uses real-space uniform grids and multigrid methods or
 atom-centered basis-functions."""

toolchain = {'name': 'intel', 'version': '2020a'}
toolchainopts = {'usempi': True, 'openmp': False}

source_urls = [PYPI_LOWER_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
patches = [
    ('GPAW-20.1.0-Add-Easybuild-configuration-files.patch', 1),
]
checksums = [
    '96843b68e04bd1c12606036c9f99b0ddfa5e6ee08ce46835e6bb347a6bd560a3',  # gpaw-21.1.0.tar.gz
    # GPAW-20.1.0-Add-Easybuild-configuration-files.patch
    'a12440bf63af70b891a63989b0f048bb8ebf4f60499020ea09259937f04cd042',
]

# libvdwxc is not a dependency of the intel build, as it is incompatible with the Intel MKL.
dependencies = [
    ('Py', '3.7', '', True),
    ('scipy', '1.3.3', versionsuffix, True),
    ('ASE', '3.21.1', versionsuffix, True),
    ('libxc', '4.3.4'),
    ('GPAW-setups', '0.9.20000', '', True),
]

prebuildopts = 'GPAW_CONFIG=doc/platforms/Linux/EasyBuild/config_intel.py'
preinstallopts = prebuildopts

download_dep_fail = True
use_pip = True
sanity_pip_check = True

# required because we're building a Python package using Intel compilers on top of Python built with GCC.
check_ldshared = True

sanity_check_paths = {
    'files': ['bin/gpaw%s' % x for x in ['', '-analyse-basis', '-basis', '-mpisim', '-plot-parallel-timings',
                                         '-runscript', '-setup', '-upfplot']],
    'dirs': ['lib/python3.7/site-packages']
}

moduleclass = 'chem'
