easyblock = 'ConfigureMake'

name = 'H5hut'
version = '1.99.13'

homepage = 'https://amas.psi.ch/H5hut/'
description = "HDF5 Utility Toolkit: High-Performance I/O Library for Particle-based Simulations"

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

source_urls = ['https://amas.psi.ch/H5hut/raw-attachment/wiki/DownloadSources/']
sources = [SOURCE_TAR_GZ]
checksums = ['2a07a449afe50534de006ac6954a421a']

builddependencies = [
    ('Autotools', '20150215'),
]
dependencies = [
    # HDF5 v1.8.12 required because of API changes in v1.8.13 that this version of H5hut does not take into account
    ('HDF5', '1.8.12'),
]

configopts = "--enable-parallel --enable-fortran --with-hdf5=$EBROOTHDF5"

# building in parallel tends to fail
parallel = 1

runtest = 'test'

sanity_check_paths = {
    'files': ['lib/libH5hut.a', 'lib/libH5hutF.a'],
    'dirs': ['include'],
}

moduleclass = 'lib'
