name = 'HDF5'
easyblock = 'CMakeMake'
version = '1.10.3'

homepage = 'https://portal.hdfgroup.org/display/support'
description = """HDF5 is a data model, library, and file format for storing and
managing data.
It supports an unlimited variety of datatypes, and is designed for flexible and
efficient I/O and for high volume and complex data."""

source_urls = ['https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-%(version_major_minor)s/hdf5-%(version)s/src']
sources = ['hdf5-%(version)s.tar.gz']
checksums = [
   'b600d7c914cfa80ae127cd1a1539981213fee9994ac22ebec9e3845e951d9b39',
   'ecd32e24eada9e4bd2ded272addc678bda8812d381aab0b5189bbfaa92c4b6d4'
]

patches = [
    'HDF5-1.10.3.patch'  # Pthread patch
]

toolchain = {
    'name': 'foss',
    'version': '2022b'
}

toolchainopts = {'pic': True}

dependencies = [
    ('zlib', '1.2.12'),
    ('Szip', '2.1.1'),
]
builddependencies = [('CMake', '3.24.3')]

configopts = ' -DBUILD_SHARED_LIBS:BOOL=ON'
configopts += ' -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON'
configopts += ' -DHDF5_BUILD_HL_LIB:BOOL=ON'
configopts += ' -DHDF5_ENABLE_THREADSAFE:BOOL=ON'
configopts += ' -DALLOW_UNSUPPORTED:BOOL=ON'
configopts += ' -DHDF5_BUILD_CPP_LIB:BOOL=ON'

# Disable Parallel
configopts += ' -DHDF5_ENABLE_PARALLEL:BOOL=OFF'

moduleclass = 'data'
