easyblock = 'ConfigureMake'

name = 'PLUMED'
version = '2.3b'

homepage = 'http://www.plumed-code.org'
description = """PLUMED is an open source library for free energy calculations
 in molecular systems which works together with some of the most popular molecular
 dynamics engines. Free energy calculations can be performed as a function of many
 order parameters with a particular  focus on biological problems, using state of
 the art methods such as metadynamics, umbrella sampling and Jarzynski-equation
 based steered MD. The software, written in C++, can be easily interfaced with
 both fortran and C/C++ codes.
 """

toolchain = {'name': 'foss', 'version': '2016a'}

source_urls = ['https://github.com/plumed/plumed2/archive/']
sources = ['v%(version)s.tar.gz']

#patches = ['PLUMED_configure_MPI.patch']

preconfigopts = "export CXX=mpic++ && "

configopts = 'CPPFLAGS="-I$EBROOTALMOST/include/almost -I$EBROOTOPENMPI/include" '
configopts += 'LDFLAGS="-L$EBROOTALMOST/lib -L$EBROOTSCALAPACK/lib -L$EBROOTOPENMPI/lib -L$EBROOTOPENBLAS/lib -ldl -lscalapack -lopenblas -lmpi -lrt" '
configopts += '--enable-mpi --enable-almost '

dependencies = [
    ('almost', '2.1.0'),
    ('libmatheval', '1.1.8'),
    ('xdrfile', '1.1.4')
]

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

skipsteps = ['test']

parallel = 1

moduleclass = 'bio'
