blob: 62117761998091cc37cebbc5b79d51595ba809ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
%global with_mpich 1
%global MPICH 1
%global OPENMPI 1
# Run full testsuite or just with 1 core
%global FULLTESTS 0
Name: mpi4py
Version: 4.0.1
Release: 1
Summary: Python bindings of the Message Passing Interface (MPI)
License: BSD-2-Clause
URL: https://mpi4py.readthedocs.io/en/stable/
Source0: https://github.com/mpi4py/mpi4py/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-Cython
BuildRequires: environment-modules
%global _description %{expand:
This package is constructed on top of the MPI-1/MPI-2 specification and
provides an object oriented interface which closely follows MPI-2 C++
bindings. It supports point-to-point (sends, receives) and collective
(broadcasts, scatters, gathers) communications of any picklable Python
object as well as optimized communications of Python object exposing the
single-segment buffer interface (NumPy arrays, built-in bytes/string/array
objects).}
%description %_description
%package docs
Summary: Documentation for %{name}
Requires: %{name}-common = %{version}-%{release}
BuildArch: noarch
%description docs
This package contains the documentation and examples for %{name}.
%package -n python3-mpi4py
Requires: %{name}-common = %{version}-%{release}
Summary: Python %{python3_version} bindings of the Message Passing Interface (MPI)
%{?python_provide:%python_provide python3-mpi4py}
%description -n python3-mpi4py %_description
%package -n python3-mpi4py-openmpi
BuildRequires: openmpi-devel
Requires: %{name}-common = %{version}-%{release}
Requires: python3-openmpi%{?_isa}
Summary: Python %{python3_version} bindings of MPI, Open MPI version
Provides: python3-mpi4py-runtime = %{version}-%{release}
%{?python_provide:%python_provide python3-mpi4py-openmpi}
%description -n python3-mpi4py-openmpi %_description
This package contains %{name} compiled against Open MPI.
%if %{with_mpich}
%package -n python3-mpi4py-mpich
BuildRequires: mpich-devel
Requires: %{name}-common = %{version}-%{release}
Requires: python3-mpich%{?_isa}
Summary: Python %{python3_version} bindings of MPI, MPICH version
Provides: python3-mpi4py-runtime = %{version}-%{release}
Provides: python3-%{name}-mpich2 = %{version}-%{release}
Obsoletes: python3-%{name}-mpich2 < 1.3-8
%{?python_provide:%python_provide python3-mpi4py-mpich}
%description -n python3-mpi4py-mpich %_description
This package contains %{name} compiled against MPICH.
%endif
%package common
Summary: Common files for mpi4py packages
BuildArch: noarch
Requires: %{name}-common = %{version}-%{release}
%description common
This package contains the license file shared between the subpackages of %{name}.
%prep
%autosetup -p1 %{?commit:-n %{name}-%{name}-%{shortcommit}}
# delete docs/source
# this is just needed to generate docs/*
rm -r docs/source
# work around "wrong-file-end-of-line-encoding"
for file in $(find | grep runtests.bat); do
sed -i 's/\r//' $file
done
# Save current src/__init__.py for mpich
cp src/mpi4py/__init__.py .__init__mpich.py
cp src/mpi4py/__init__.py .__init__openmpi.py
# Remove precythonized C sources
#rm $(grep -rl '/\* Generated by Cython')
python3 conf/cythonize.py
%build
# Build parallel versions: set compiler variables to MPI wrappers
export CC=mpicc
export CXX=mpicxx
# Build OpenMPI version
%{_openmpi_load}
ompi_info
cp .__init__openmpi.py src/mpi4py/__init__.py
%py3_build
mv build openmpi
%{_openmpi_unload}
%if %{with_mpich}
# Build mpich version
%{_mpich_load}
cp .__init__mpich.py src/mpi4py/__init__.py
%py3_build
mv build mpich
%{_mpich_unload}
%endif
%install
# Install OpenMPI version
%{_openmpi_load}
cp .__init__openmpi.py src/mpi4py/__init__.py
mv openmpi build
%py3_install
mkdir -p %{buildroot}%{python3_sitearch}/openmpi
mv %{buildroot}%{python3_sitearch}/%{name}/ %{buildroot}%{python3_sitearch}/%{name}*.egg-info %{buildroot}%{python3_sitearch}/openmpi
mv build openmpi
%{_openmpi_unload}
%if %{with_mpich}
# Install MPICH version
%{_mpich_load}
cp .__init__mpich.py src/mpi4py/__init__.py
mv mpich build
%py3_install
mkdir -p %{buildroot}%{python3_sitearch}/mpich
mv %{buildroot}%{python3_sitearch}/%{name}/ %{buildroot}%{python3_sitearch}/%{name}*.egg-info %{buildroot}%{python3_sitearch}/mpich
mv build mpich
%{_mpich_unload}
%endif
%files common
%license LICENSE.rst
%doc CHANGES.rst DESCRIPTION.rst README.rst
%files -n python3-mpi4py-openmpi
%{python3_sitearch}/openmpi/%{name}-*.egg-info
%{python3_sitearch}/openmpi/%{name}
%if %{with_mpich}
%files -n python3-mpi4py-mpich
%{python3_sitearch}/mpich/%{name}-*.egg-info
%{python3_sitearch}/mpich/%{name}
%endif
%files docs
%doc docs/* demo
%changelog
* Tue Dec 26 2024 zhtianyu <zhangtianyu@iscas.ac.cn> - 4.0.1-1
- upgrade to 4.0.1
* Fri Apr 15 2022 tanyulong <tanyulong@kylinos.cn> - 3.1.3-2
- rebuild
* Thu Mar 24 2022 tanyulong <tanyulong@kylinos.cn> - 3.1.3-1
- init package for openEuler
|