# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
# Author: Pablo Escobar Lopez
# sciCORE - University of Basel
# SIB Swiss Institute of Bioinformatics 

easyblock = "CMakeMake"

name = "OpenMM"
version = "6.1"
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://simtk.org/home/openmm'
description = """OpenMM is a toolkit for molecular simulation."""

toolchain = {'version': '1.4.10', 'name': 'goolf'}

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

builddependencies = [
    ('CMake', '2.8.12'),
]

separate_build_dir = True

dependencies = [
    ('Python', '2.7.5'),
    ('SWIG', '2.0.4', '-Python-%(pyver)s'),
]

runtest = ' test'

preinstallopts = ' export OPENMM_INCLUDE_PATH=%(installdir)s/include && '
preinstallopts += ' export OPENMM_LIB_PATH=%(installdir)s/lib && '

# required to install the python API
installopts = ' && cd python && python setup.py build && python setup.py install --prefix=%(installdir)s'

sanity_check_paths = {
    'files': ["lib/libOpenMM.%s" % SHLIB_EXT, "lib/python%(pyshortver)s/site-packages/simtk/openmm/openmm.py"],
    'dirs': []
}

modextrapaths = {
    'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages',
}

modextravars = {
    'OPENMM_INCLUDE_PATH': 'include',
    'OPENMM_LIB_PATH': 'lib',
}

moduleclass = 'bio'
