diff --git a/h5py-3.7.0.tar.gz b/h5py-3.7.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3317771f1d9b26f475d5edb0bd901579f287fb33 Binary files /dev/null and b/h5py-3.7.0.tar.gz differ diff --git a/h5py.spec b/h5py.spec new file mode 100644 index 0000000000000000000000000000000000000000..f94212772e2dab07cc5854156f3b085845f8ec5d --- /dev/null +++ b/h5py.spec @@ -0,0 +1,192 @@ +%define anolis_release 1 + +Summary: A Python interface to the HDF5 library +Name: h5py +Version: 3.7.0 +Release: %{anolis_release}%{?dist} +License: BSD +URL: http://www.h5py.org/ +Source0: https://files.pythonhosted.org/packages/source/h/h5py/h5py-%{version}.tar.gz +BuildRequires: gcc +BuildRequires: hdf5-devel +BuildRequires: liblzf-devel +BuildRequires: python%{python3_pkgversion}-Cython >= 0.23 +BuildRequires: python%{python3_pkgversion}-devel >= 3.2 +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-cached_property +BuildRequires: python%{python3_pkgversion}-numpy >= 1.7 +BuildRequires: python%{python3_pkgversion}-pkgconfig +BuildRequires: python%{python3_pkgversion}-pip +BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-pytest-mpi +BuildRequires: python%{python3_pkgversion}-six +BuildRequires: python%{python3_pkgversion}-sphinx +# MPI builds +BuildRequires: hdf5-openmpi-devel +BuildRequires: openmpi-devel +BuildRequires: python%{python3_pkgversion}-mpi4py-openmpi +BuildRequires: hdf5-mpich-devel +BuildRequires: mpich-devel +BuildRequires: python%{python3_pkgversion}-mpi4py-mpich + +%global _description\ +The h5py package provides both a high- and low-level interface to the\ +HDF5 library from Python. The low-level interface is intended to be a\ +complete wrapping of the HDF5 API, while the high-level component\ +supports access to HDF5 files, data sets and groups using established\ +Python and NumPy concepts.\ +\ +A strong emphasis on automatic conversion between Python (Numpy)\ +data types and data structures and their HDF5 equivalents vastly\ +simplifies the process of reading and writing data from Python. + +%description %_description + +%package -n python%{python3_pkgversion}-h5py +Summary: %{summary} +Requires: hdf5%{_isa} = %{_hdf5_version} +Requires: python%{python3_pkgversion}-cached_property +Requires: python%{python3_pkgversion}-numpy >= 1.7 +Requires: python%{python3_pkgversion}-six +%{?python_provide:%python_provide python%{python3_pkgversion}-h5py} +%description -n python%{python3_pkgversion}-h5py %_description + +%package -n python%{python3_pkgversion}-h5py-openmpi +Summary: A Python interface to the HDF5 library using OpenMPI +Requires: hdf5%{_isa} = %{_hdf5_version} +Requires: python%{python3_pkgversion}-cached_property +Requires: python%{python3_pkgversion}-numpy >= 1.7 +Requires: python%{python3_pkgversion}-six +Requires: python3-mpi4py-openmpi +Requires: openmpi +%description -n python%{python3_pkgversion}-h5py-openmpi %_description + +%package -n python%{python3_pkgversion}-h5py-mpich +Summary: A Python interface to the HDF5 library using MPICH +Requires: hdf5%{_isa} = %{_hdf5_version} +Requires: python%{python3_pkgversion}-cached_property +Requires: python%{python3_pkgversion}-numpy >= 1.7 +Requires: python%{python3_pkgversion}-six +Requires: python3-mpi4py-openmpi +Requires: python3-mpi4py-mpich +Requires: mpich +%description -n python%{python3_pkgversion}-h5py-mpich %_description + + +%prep +%setup -q -c -n %{name}-%{version} +mv %{name}-%{version} serial +cd serial +%{__python3} api_gen.py +cd - +for x in mpich openmpi +do + cp -al serial $x +done + + +%build +# Upstream requires a specific numpy without this +export H5PY_SETUP_REQUIRES=0 +export H5PY_SYSTEM_LZF=1 +# serial +export CFLAGS="%{optflags} -fopenmp" +cd serial +%py3_build +cd - + +# MPI +export CC=mpicc +export HDF5_MPI="ON" + +# openmpi +cd openmpi +%{_openmpi_load} +%py3_build +%{_openmpi_unload} +cd - + +# mpich +cd mpich +%{_mpich_load} +%py3_build +%{_mpich_unload} +cd - + + +%install +# Upstream requires a specific numpy without this +export H5PY_SETUP_REQUIRES=0 +export H5PY_SYSTEM_LZF=1 +# openmpi +cd openmpi +%py3_install +rm -rf %{buildroot}%{python3_sitearch}/h5py/tests +mkdir -p %{buildroot}%{python3_sitearch}/openmpi +mv %{buildroot}%{python3_sitearch}/%{name}/ \ + %{buildroot}%{python3_sitearch}/%{name}*.egg-info \ + %{buildroot}%{python3_sitearch}/openmpi +cd - + +# mpich +cd mpich +%py3_install +rm -rf %{buildroot}%{python3_sitearch}/h5py/tests +mkdir -p %{buildroot}%{python3_sitearch}/mpich +mv %{buildroot}%{python3_sitearch}/%{name}/ \ + %{buildroot}%{python3_sitearch}/%{name}*.egg-info \ + %{buildroot}%{python3_sitearch}/mpich +cd - + +# serial part must be last (not to overwrite files) +cd serial +%py3_install +rm -rf %{buildroot}%{python3_sitearch}/h5py/tests +cd - + + +%check +# Upstream requires a specific numpy without this +export H5PY_SETUP_REQUIRES=0 +export H5PY_SYSTEM_LZF=1 +fail=1 + +export PYTHONPATH=$(echo serial/build/lib*) +%{__python3} -m pytest --pyargs h5py -rxXs ${PYTHONPATH} || exit $fail + +# openmpi +export PYTHONPATH=$(echo openmpi/build/lib*) +%{_openmpi_load} +#mpirun %{__python3} -m pytest --pyargs h5py -rxXs --with-mpi ${PYTHONPATH} || exit $fail +%{_openmpi_unload} + +# mpich +export PYTHONPATH=$(echo mpich/build/lib*) +%{_mpich_load} +#mpirun %{__python3} -m pytest --pyargs h5py -rxXs --with-mpi ${PYTHONPATH} || exit $fail +%{_mpich_unload} + + +%files -n python%{python3_pkgversion}-h5py +%license serial/licenses/*.txt +#doc serial/ANN.rst serial/README.rst serial/examples +%doc serial/README.rst serial/examples +%{python3_sitearch}/%{name}/ +%{python3_sitearch}/%{name}-%{version}-*.egg-info + +%files -n python%{python3_pkgversion}-h5py-openmpi +%license openmpi/licenses/*.txt +%doc openmpi/README.rst +%{python3_sitearch}/openmpi/%{name}/ +%{python3_sitearch}/openmpi/%{name}-%{version}-*.egg-info + +%files -n python%{python3_pkgversion}-h5py-mpich +%license mpich/licenses/*.txt +%doc mpich/README.rst +%{python3_sitearch}/mpich/%{name}/ +%{python3_sitearch}/mpich/%{name}-%{version}-*.egg-info + + +%changelog +* Wed Jun 14 2023 Chunmei Xu - 3.7.0-1 +- init from upstream