easyblock = 'Tarball'

name = 'SimVascular'
version = '2.16.0406'

homepage = 'http://simvascular.github.io/'
description = """SimVascular is an open source software suite for cardiovascular simulation, providing a complete
 pipeline from medical image data to 3D model construction, meshing, and blood flow simulation."""

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

# download via https://simtk.org/project/xml/downloads.xml?group_id=188
sources = ['SV-linux-x64-2016-04-06.tar.gz']

dependencies = [
    ('X11', '20160819'),
    ('Tcl', '8.6.5'),
    ('Tk', '8.6.5'),
]

unpack_options = '--strip-components=1'
keepsymlinks = True

# mimic what setup-symlinks.sh, but stick to dedicated install dir
postinstallcmds = [
    "mkdir %(installdir)s/bin",
    "ln -s %(installdir)s/Bin/simvascular %(installdir)s/bin/simvascular",
    "ln -s %(installdir)s/Bin/svpost %(installdir)s/bin/svpost",
    "ln -s %(installdir)s/Bin/svpre %(installdir)s/bin/svpre",
    "ln -s %(installdir)s/Bin/svsolver %(installdir)s/bin/svsolver",
]

sanity_check_paths = {
    'files': ['bin/simvascular', 'bin/svpost', 'bin/svpre', 'bin/svsolver'],
    'dirs': ['Bin'],
}

moduleclass = 'bio'
