easyblock = 'MakeCp'

name = 'Yambo'
version = '3.4.2'

homepage = 'http://www.yambo-code.org'
description = """Yambo is a FORTRAN/C code for Many-Body calculations in solid state and molecular physics.
 Yambo relies on the Kohn-Sham wavefunctions generated by two DFT public codes: abinit, and PWscf."""

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

sources = [SOURCELOWER_TGZ]
source_urls = ['http://qe-forge.org/gf/download/frsrelease/208/932/']
checksums = ['f0820a0f42dfc81ce3811af647bed777']

dependencies = [('netCDF-Fortran', '4.4.2')]

with_configure = 'True'

configopts = 'CPPFLAGS="" FCFLAGS="-nofor_main" --with-blas-libs="$LIBBLAS" '
configopts += '--with-lapack-libs="$LIBLAPACK" --with-blacs-libs="$LIBBLACS" '
configopts += '--with-scalapack-libs="$LIBSCALAPACK" --with-fft-libs="$LIBFFT" '
configopts += '--with-netcdf-libs="-lnetcdff -lnetcdf"'

buildopts = 'all'

parallel = 1

files_to_copy = [(['bin/*'], 'bin')]

sanity_check_paths = {
    'files': ['bin/'+prog for prog in ['a2y', 'iotk', 'iotk.x', 'p2y', 'yambo',
              'yambo_kerr', 'yambo_ph', 'yambo_surf', 'ypp', 'ypp_ph', 'ypp_surf']],
    'dirs': []
}

moduleclass = 'phys'
