# IT4Innovations 2020

easyblock = 'MakeCp'

name = 'Wannier90'
version = '3.0.0'

homepage = 'http://www.wannier.org'
description = """A tool for obtaining maximally-localised Wannier functions"""

toolchain = {'name': 'intel', 'version': '2017c'}
toolchainopts = {'usempi': True}

github_account = 'wannier-developers'
source_urls = [GITHUB_LOWER_SOURCE]
sources = [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCELOWER_TAR_GZ}]

patches = ['Wannier90_3x_ignore_makeinc.patch']

checksums = [
    'f196e441dcd7b67159a1d09d2d7de2893b011a9f03aab6b30c4703ecbf20fe5b',   # v3.0.0.tar.gz
    '561c0d296e0e30b8bb303702cd6e41ded54c153d9b9e6cd9cab73858e5e2945e',   # Wannier90_3x_ignore_makeinc.patch
]

buildopts = 'all F90=$F90 MPIF90=$MPIF90 FCOPTS="$FFLAGS" LDOPTS="$FFLAGS" '
buildopts += 'LIBDIR="$LAPACK_LIB_DIR" LIBS="$LIBLAPACK" '
buildopts += 'COMMS=mpi'

files_to_copy = [(['wannier90.x', 'postw90.x'], 'bin'), (['libwannier.a'], 'lib')]

sanity_check_paths = {
    'files': ['bin/wannier90.x', 'bin/postw90.x', 'lib/libwannier.a'],
    'dirs': []
}

moduleclass = 'chem'
