# IT4Innovations 2021
# LK

easyblock = 'PythonPackage'

name = 'h5py'
version = '2.10.0'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://www.h5py.org/'
description = """HDF5 for Python (h5py) is a general-purpose Python interface to the Hierarchical Data Format library,
 version 5. HDF5 is a versatile, mature scientific software library designed for the fast, flexible storage of enormous
 amounts of data."""

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

source_urls = [PYPI_SOURCE]
sources = [SOURCE_TAR_GZ]
#patches = ['h5py-%(version)s_avoid-mpi-init.patch']
#checksums = [
#    '84412798925dc870ffd7107f045d7659e60f5d46d1c70c700375248bf6bf512d',  # h5py-2.10.0.tar.gz
#    '6bacb71f5d9fbd7bd9a01018d7fe21b067a2317f33c4a7c21fde9cd404c1603f',  # h5py-2.10.0_avoid-mpi-init.patch
#]

builddependencies = [('pkgconfig', '1.5.1', versionsuffix)]

dependencies = [
    ('Python', '3.8.6'),
    ('SciPy-bundle', '2020.03', versionsuffix),
    ('HDF5', '1.10.6', '', ('iimpi', '2020b')),
]

use_pip = False
download_dep_fail = True

# to really use mpi enabled hdf5 we now seem to need a configure step, which is the reason we can't use pip
prebuildopts = 'python setup.py configure --mpi --hdf5=$EBROOTHDF5 && '

moduleclass = 'data'
