# IT4Innovations 2021
# LK

easyblock = "PythonPackage"

name = 'GPAW'
version = '21.1.0'
_aseversion = '3.21.1'
versionsuffix = '-ASE-' + _aseversion

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',
]

dependencies = [
    ('Python', '3.8.6'),
    ('SciPy-bundle', '2020.11'),
    ('ASE', _aseversion),
    ('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', '-plot-parallel-timings',
                                         '-runscript', '-setup', '-upfplot']],
    'dirs': ['lib/python%(pyshortver)s/site-packages']
}

moduleclass = 'chem'