# IT4Innovations 2019

easyblock = 'ConfigureMake'

name = 'ABINIT'
version = '8.10.3'

homepage = 'http://www.abinit.org/'
description = """ABINIT is a package whose main program allows one to find the total energy, charge density and
 electronic structure of systems made of electrons and nuclei (molecules and periodic solids) within Density Functional
 Theory (DFT), using pseudopotentials and a planewave or wavelet basis."""

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

source_urls = ['https://github.com/abinit/abinit/archive/']
sources = ['abinit-8.10.3.tar.gz']

configopts = '--with-mpi-prefix=$EBROOTIMPI/intel64 --with-dft-flavor="atompaw+bigdft+libxc+wannier90" '
configopts += '--with-netcdf-incs="-I$EBROOTNETCDF/include -I$EBROOTNETCDFMINFORTRAN/include" '
configopts += '--with-netcdf-libs="-L$EBROOTNETCDF/lib -lnetcdf -L$EBROOTNETCDFMINFORTRAN/lib -lnetcdff" '
configopts += 'CC=mpicc CXX=mpicxx FC=mpif90 --enable-mpi --enable-mpi-io --enable-64bit-flags --enable-optim="yes" --enable-gw-dpc="yes" --enable-memory-profiling="no" --enable-openmp="no" --enable-maintainer-checks="no" --enable-debug="no" '

dependencies = [
#    ('libxc', '4.3.4'),
    ('netCDF', '4.6.2'),
    ('netCDF-Fortran', '4.4.5'),
]

sanity_check_paths = {
    'files': [
        'bin/%s' %
        x for x in [
            'abinit',
            'aim',
            'cut3d',
            'conducti',
            'mrgddb',
            'mrgscr',
            'optic']],
    'dirs': ['lib/pkgconfig'],
}

moduleclass = 'chem'