# IT4Innovations 2018

easyblock = 'ConfigureMake'

name = 'PLUMED'
version = '2.4.2'

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': 'intel', 'version': '2017c'}
toolchainopts = {'usempi': 'True'}

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

dependencies = [
    ('zlib', '1.2.11', '', True),
    ('GSL', '2.5'),
    ('libmatheval', '1.1.11', '', True),
]

preconfigopts = 'env FC=$MPIF90 LIBS="$LIBLAPACK $LIBS" '
configopts = ' --exec-prefix=%(installdir)s --enable-gsl'
prebuildopts = 'source sourceme.sh && '

sanity_check_paths = {
    'files': [
        'bin/plumed',
        'lib/libplumedKernel.%s' %
        SHLIB_EXT,
        'lib/libplumed.%s' %
        SHLIB_EXT],
    'dirs': ['lib/plumed']}

modextrapaths = {
    'PLUMED_KERNEL': 'lib/libplumedKernel.%s' % SHLIB_EXT,
    'PLUMED_ROOT': 'lib/plumed',
}

moduleclass = 'chem'
