easyblock = 'ConfigureMake'

name = 'almost'
version = '2.1.0'

homepage = 'http://www-almost.ch.cam.ac.uk/site'
description = """all atom molecular simulation toolkit
 - is a fast and flexible molecular modeling environment
 that provides powerful and efficient algorithms for molecular
 simulation, homology modeling, de novo design and ab-initio
 calculations.
 """

toolchain = SYSTEM

# Sources checked out using svn
# svn checkout svn://svn.code.sf.net/p/almost/code/ almost-code).
# ALMOST 2.1 can be found in branches/almost-2.1
# tar.gz file created from almost-2.1 directory and put to the
# /easybuild/sources
source_urls = ['http://www-almost.ch.cam.ac.uk/site/downloads']
sources = [SOURCELOWER_TAR_GZ]

builddependencies = [
    ('ScaLAPACK', '2.0.2', '-OpenBLAS-0.2.15-LAPACK-3.6.0', ('gompi', '2016a')),
    ('OpenBLAS', '0.2.15', '-LAPACK-3.6.0', ('GCC', '4.9.3-2.25')),
    ('SQLite', '3.8.8.1'),
    ('gzip', '1.6'),
    ('Autotools', '20150215'),
]

configopts = 'CPPFLAGS="-I$EBROOTOPENMPI/include" '
configopts += 'LDFLAGS="-L$EBROOTOPENMPI/lib -lmpi" '
configopts += 'CXXFLAGS="-O3 -fPIC" CFLAGS="-O3 -fPIC" '
configopts += '--enable-mpi '

preconfigopts = 'autoreconf -fi && automake && '

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

moduleclass = 'bio'