easyblock = 'CmdCp'

name = 'ALAMODE'
version = '0.9.8'

homepage = 'http://alamode.readthedocs.io/'
description = """ALAMODE is an open source software designed for analyzing lattice anharmonicity
and lattice thermal conductivity of solids. By using an external DFT package such as VASP and
Quantum ESPRESSO, you can extract harmonic and anharmonic force constants straightforwardly
with ALAMODE. Using the calculated anharmonic force constants, you can also estimate lattice
thermal conductivity, phonon linewidth, and other anharmonic phonon properties from first principles."""

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

source_urls = [SOURCEFORGE_SOURCE]
sources = [SOURCELOWER_TAR_GZ]

dependencies = [
    ('Boost', '1.63.0'),
    ('Python', '2.7.13-base', '', True),
    ('matplotlib', '2.0.2-Python-2.7.13-base', '', True),
    ('numpy', '1.13.0-Python-2.7.13-base', '', True),
]

local_commands = "cd alm && mv Makefile.linux Makefile && make && cd .. && "
local_commands += "cd anphon && mv Makefile.linux Makefile && make && cd .. && "
local_commands += "cd tools && make "

cmds_map = [('.*', local_commands)]

files_to_copy = [
    (['alm/alm', 'anphon/anphon'], 'bin'),
    (['tools/analyze_phonons', 'tools/qe2alm'], 'tools'),
    (['tools/*.py'], 'tools'),
]

modextrapaths = {'PATH': 'tools'}

sanity_check_paths = {
    'files': ['bin/alm', 'bin/anphon'],
    'dirs': []
}

moduleclass = 'phys'
