easyblock = 'PackedBinary'

name = 'USPEX'
version = '9.4.4'
versionsuffix = '-Python-%(local_pyver)s'

homepage = 'http://uspex-team.org/uspex/overview'
description = """USPEX (Universal Structure Predictor: Evolutionary Xtallography...
 and in Russian "uspekh" means "success" - owing to the high success rate and many
 useful results produced by this method) is a method developed by the Oganov
 laboratory since 2004. The problem of crystal structure prediction is very old and
 does, in fact, constitute the central problem of theoretical crystal chemistry.

USPEX can also be used for finding low-energy metastable phases, as well as stable
 structures of nanoparticles, surface reconstructions, molecular packings in organic
 crystals, and for searching for materials with desired physical (mechanical,
 electronic) properties. The USPEX code is based on an efficient evolutionary
 algorithm developed by A.R. Oganov's group, but also has options for using
 alternative methods (random sampling, metadynamics, corrected particle swarm
 optimization algorithms). USPEX is interfaced with many ab initio codes, such as
 VASP, SIESTA, GULP, Quantum Espresso, CP2K, CASTEP, LAMMPS, and so on. """

toolchain = {'name': 'intel', 'version': '2016b'}

sources = ['%(name)s-%(version)s.tar.gz']
# You have to register before download
#source_urls = ['http://uspex-team.org/uspex/downloads']

dependencies = [
    ('Python', '2.7.12'),
    ('Octave', '4.0.3'),
]

postinstallcmds = [
    'echo $EBROOTOCTAVE/bin/octave > %(installdir)s/CODEPATH',
    'chmod +x %(installdir)s/src/FunctionFolder/Tool/*',
    'rm %(installdir)s/INSTALL',
    'rm %(installdir)s/install.sh',
    'rm %(installdir)s/job',
]

sanity_check_paths = {
    'files': ['USPEX'],
    'dirs': ['doc', 'examples', 'lib', 'src', 'tests']
}

modextravars = {'USPEXPATH': '%(installdir)s/src'}

moduleclass = 'phys'
