File _service:extract_file:mpich.spec of Package mpich-ucx-gnu12 (Revision 07b491d035602f94d93312841be5d2fc)
Currently displaying revision 07b491d035602f94d93312841be5d2fc , Show latest
210
1
#----------------------------------------------------------------------------bh-
2
# This RPM .spec file is part of the OpenHPC project.
3
#
4
# It may have been modified from the default version supplied by the underlying
5
# release package (if available) in order to apply patches, perform customized
6
# build/install configurations, and supply additional files to support
7
# desired integration conventions.
8
#
9
#----------------------------------------------------------------------------eh-
10
11
# MPICH MPI stack that is dependent on compiler toolchain
12
%define ohpc_compiler_dependent 1
13
%include %{_sourcedir}/OHPC_macros
14
%{!?RMS_DELIM: %global RMS_DELIM %{nil}}
15
%{!?FABRIC_DELIM: %global FABRIC_DELIM %{nil}}
16
17
%define with_slurm 0
18
%{!?with_slurm: %define with_slurm 0}
19
%if 0%{with_slurm}
20
BuildRequires: slurm-devel%{PROJ_DELIM} slurm%{PROJ_DELIM}
21
%endif
22
23
%{!?with_pmix: %define with_pmix 0}
24
%if 0%{with_pmix}
25
BuildRequires: pmix%{PROJ_DELIM}
26
BuildRequires: libevent-devel
27
%endif
28
29
# note: a libfabric based build is the default, but can be overridden by
30
# specifying with_ucx=1
31
32
%{!?with_ucx: %define with_ucx 0}
33
%if 0%{with_ucx}
34
%define with_ofi 0
35
BuildRequires: ucx%{PROJ_DELIM}
36
Requires: ucx%{PROJ_DELIM}
37
Requires: ucx-ib%{PROJ_DELIM}
38
%define FABRIC_DELIM -ucx
39
%else
40
%define with_ofi 1
41
BuildRequires: libfabric%{PROJ_DELIM}
42
BuildRequires: rdma-core-devel
43
%ifarch x86_64
44
BuildRequires: libpsm2-devel
45
%endif
46
Requires: libfabric%{PROJ_DELIM}
47
%define FABRIC_DELIM -ofi
48
%endif
49
50
# Base package name
51
%define pname mpich
52
53
Summary: MPICH MPI implementation
54
Name: %{pname}%{RMS_DELIM}%{FABRIC_DELIM}-%{compiler_family}%{PROJ_DELIM}
55
Version: 3.4.3
56
Release: 1%{?dist}
57
License: BSD
58
Group: %{PROJ_NAME}/mpi-families
59
URL: http://www.mpich.org
60
Source0: http://www.mpich.org/static/downloads/%{version}/%{pname}-%{version}.tar.gz
61
Patch0: config.pmix.patch
62
# 08/14/19 karl@ices.utexas.edu - upping patch fuzz factor for node.name patch
63
%global _default_patch_fuzz 2
64
65
Requires: prun%{PROJ_DELIM} >= 1.2
66
BuildRequires: perl
67
Requires: perl
68
BuildRequires: zlib-devel make
69
%if 0%{?suse_version}
70
BuildRequires: libnuma-devel
71
%else
72
BuildRequires: numactl-devel
73
%endif
74
75
%if "%{RMS_DELIM}" != "%{nil}"
76
Provides: %{pname}-%{compiler_family}%{PROJ_DELIM}
77
%endif
78
%if "%{FABRIC_DELIM}" != "%{nil}"
79
Provides: %{pname}-%{compiler_family}%{PROJ_DELIM}
80
%endif
81
82
%if 0%{?suse_version}
83
#!BuildIgnore: post-build-checks
84
%endif
85
86
# Default library install path
87
%define install_path %{OHPC_MPI_STACKS}/%{name}/%version
88
89
%description
90
91
MPICH is a high performance and widely portable implementation of the
92
Message Passing Interface (MPI) standard.
93
94
%prep
95
96
%setup -q -n %{pname}-%{version}
97
%patch0 -p0
98
99
%build
100
# OpenHPC compiler designation
101
%ohpc_setup_compiler
102
%if 0%{with_pmix}
103
module load pmix
104
export CPATH=${PMIX_INC}
105
%endif
106
%if 0%{with_ucx}
107
module load ucx
108
%endif
109
%if 0%{with_ofi}
110
module load libfabric
111
%endif
112
113
%if "%{compiler_family}" == "gnu12"
114
# configure fails with:
115
# The Fortran compiler gfortran does not accept programs that
116
# call the same routine with arguments of different types without
117
# the option -fallow-argument-mismatch.
118
# Rerun configure with FFLAGS=-fallow-argument-mismatch
119
# This seems to fix the build.
120
export FFLAGS=-fallow-argument-mismatch
121
%endif
122
./configure --prefix=%{install_path} \
123
--libdir=%{install_path}/lib \
124
%if 0%{with_slurm}
125
--with-pm=no --with-pmi=slurm \
126
%endif
127
%if 0%{with_pmix}
128
LIBS="-L%{OHPC_ADMIN}/pmix/pmix/lib -lpmix" --with-pm=none --with-pmi=slurm \
129
%endif
130
%if 0%{with_ucx}
131
--with-device=ch4:ucx --with-ucx=$UCX_DIR \
132
%endif
133
%if 0%{with_ofi}
134
--with-device=ch4:ofi --with-libfabric=$LIBFABRIC_DIR \
135
%endif
136
|| { cat config.log && exit 1; }
137
138
%if "%{compiler_family}" == "llvm" || "%{compiler_family}" == "arm1"
139
%{__sed} -i -e 's#wl=""#wl="-Wl,"#g' libtool
140
%{__sed} -i -e 's#pic_flag=""#pic_flag=" -fPIC -DPIC"#g' libtool
141
%endif
142
143
make V=1 %{?_smp_mflags}
144
145
%install
146
# OpenHPC compiler designation
147
%ohpc_setup_compiler
148
make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
149
150
# Remove .la files detected by rpm
151
rm $RPM_BUILD_ROOT/%{install_path}/lib/*.la
152
153
154
# OpenHPC module file
155
%{__mkdir_p} %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}
156
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/%{version}%{FABRIC_DELIM}
157
#%Module1.0#####################################################################
158
159
proc ModulesHelp { } {
160
161
puts stderr " "
162
puts stderr "This module loads the %{pname} library built with the %{compiler_family} toolchain."
163
puts stderr "\nVersion %{version}\n"
164
165
}
166
module-whatis "Name: %{pname} built with %{compiler_family} toolchain"
167
module-whatis "Version: %{version}"
168
module-whatis "Category: runtime library"
169
module-whatis "Description: %{summary}"
170
module-whatis "URL: %{url}"
171
172
set version %{version}
173
174
setenv MPI_DIR %{install_path}
175
%if 0%{with_pmix}
176
setenv OHPC_MPI_LAUNCHERS pmix
177
%endif
178
prepend-path PATH %{install_path}/bin
179
prepend-path MANPATH %{install_path}/share/man
180
prepend-path LD_LIBRARY_PATH %{install_path}/lib
181
prepend-path MODULEPATH %{OHPC_MODULEDEPS}/%{compiler_family}-%{pname}
182
prepend-path PKG_CONFIG_PATH %{install_path}/lib/pkgconfig
183
184
%if 0%{with_ucx}
185
depends-on ucx
186
%endif
187
%if 0%{with_ofi}
188
depends-on libfabric
189
%endif
190
family "MPI"
191
EOF
192
193
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULEDEPS}/%{compiler_family}/%{pname}/.version%{FABRIC_DELIM}.%{version}
194
#%Module1.0#####################################################################
195
##
196
## version file for %{pname}-%{version}
197
##
198
set ModulesVersion "%{version}%{FABRIC_DELIM}"
199
EOF
200
201
%{__mkdir_p} ${RPM_BUILD_ROOT}/%{_docdir}
202
203
%files
204
%{OHPC_HOME}
205
%doc README.envvar
206
%doc COPYRIGHT
207
%doc CHANGES
208
%doc README
209
%doc RELEASE_NOTES
210