easyblock = 'SCons'

name = 'Cantera'
version = '2.2.1'
versionsuffix = '-Python-%(local_pyver)s'

homepage = 'https://github.com/Cantera/cantera'
description = """Chemical kinetics, thermodynamics, and transport tool suite"""

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

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

dependencies = [
    ('Python', '2.7.12'),
    ('Boost', '1.61.0', versionsuffix),
    ('SUNDIALS', '2.6.2'),
]
builddependencies = [
    ('SCons', '2.5.0', versionsuffix),
    ('3to2', '1.1.1', versionsuffix),
]

local_common_opts = 'env_vars=all CC="$CC" CXX="$CXX" blas_lapack_libs=mkl_rt blas_lapack_dir=$BLAS_LAPACK_LIB_DIR'
local_common_opts += ' sundials_include=$EBROOTSUNDIALS/include sundials_libdir=$EBROOTSUNDIALS/lib'
buildopts = 'build ' + local_common_opts
runtest = 'test ' + local_common_opts
buildopts = 'install ' + local_common_opts
prefix_arg = 'prefix='

modextrapaths = {'PYTHONPATH': ['lib/python%(local_pyshortver)s/site-packages']}

sanity_check_paths = {
    'files': ['bin/mixmaster'],
    'dirs': [
        'include/cantera',
        'lib/pkgconfig',
        'lib/python%(local_pyshortver)s/site-packages'],
}

sanity_check_commands = [('python', "-c 'import cantera'")]

moduleclass = 'chem'
