easyblock = 'MakeCp'

name = 'Wannier90'
version = '2.0.1'

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

toolchain = {'name': 'intel', 'version': '2016.02-GCC-4.9'}
toolchainopts = {'usempi': True}

sources = [SOURCELOWER_TAR_GZ]
source_urls = ['http://www.wannier.org/code']

patches = ['Wannier90_2x_ignore_makesys.patch']

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

# build program and library
buildopts = "all"

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'
