|
53 | 53 | # type: bool (0/1) |
54 | 54 | %{!?install_in_opt: %define install_in_opt 0} |
55 | 55 |
|
| 56 | +# This specfile expects to find all required 3rd party packages |
| 57 | +# (Libevent, Hwloc, PMIx, PRRTE) externally, and will not use the |
| 58 | +# internal/embedded copies of these packages. This behavior is |
| 59 | +# strongly recomended for packagers. However, if you want to override |
| 60 | +# this behavior, change the definition below to 0. |
| 61 | +# |
| 62 | +# NOTE: This option will cause "--with-libevent=external |
| 63 | +# --with-hwloc=external --with-pmix=external --with-prrte=external" to |
| 64 | +# be added to the arguments to configure. If you wish to use different |
| 65 | +# CLI options, set this value to 0 and set configure_options to the |
| 66 | +# CLI options you want. |
| 67 | +%{!?all_external_3rd_party: %define all_external_3rd_party 1} |
| 68 | + |
56 | 69 | # Define this if you want this RPM to install environment setup |
57 | 70 | # shell scripts. |
58 | 71 | # type: bool (0/1) |
|
141 | 154 | # type: bool (0/1) |
142 | 155 | %{!?allow_fortify_source: %define allow_fortify_source 1} |
143 | 156 |
|
144 | | -# Select md5 packing algorithm, that src.rpm created on one distro can be read on another. |
| 157 | +# Select md5 packing algorithm, that src.rpm created on one distro can |
| 158 | +# be read on another. |
145 | 159 | %global _binary_filedigest_algorithm 1 |
146 | 160 | %global _source_filedigest_algorithm 1 |
147 | 161 |
|
148 | 162 | # Define this to 1 if you want to keep libtool achive files |
149 | 163 | # Default is 0 (remove *.la files) |
150 | 164 | # type: bool (0/1) |
151 | 165 | %{!?install_libtool_archive: %define install_libtool_archive 0} |
| 166 | + |
152 | 167 | ############################################################################# |
153 | 168 | # |
154 | 169 | # Configuration Logic |
|
181 | 196 | %{!?modulefile_path: %define modulefile_path /opt/%{name}/%{version}/share/openmpi/modulefiles} |
182 | 197 | %endif |
183 | 198 |
|
| 199 | +%if %{all_external_3rd_party} |
| 200 | +%define _configure_3rd_party --with-libevent=external --with-hwloc=external --with-pmix=external --with-prrte=external |
| 201 | +%else |
| 202 | +%define _configure_3rd_party %{nil} |
| 203 | +%endif |
| 204 | + |
184 | 205 | # Now that we have processed install_in_opt, we can see if |
185 | 206 | # modulefile_path was not set. If it was not, then set it to a |
186 | 207 | # default value. |
|
207 | 228 | %define __check_files %{nil} |
208 | 229 | %endif |
209 | 230 |
|
210 | | -# Set this to any options you want to pass in to configure. By |
211 | | -# default, we pass in flags to tell configure to expect to find all |
212 | | -# the 3rd party packages elsewhere on the system (vs. using the |
213 | | -# bundled versions). This behavior is strongly recomended |
214 | | -# (vs. including other, 3rd party packages in this Open MPI RPM). |
215 | | -# Meaning: if you set a value to configure_options, you are strongly |
216 | | -# advised to *also* include all the options listed below. |
217 | | -%{!?configure_options: %define configure_options --with-libevent=external --with-hwloc=external --with-pmix=external --with-prrte=external} |
| 231 | +# Set this to any options you want to pass in to configure. |
| 232 | +%{!?configure_options: %define configure_options %{nil}} |
218 | 233 |
|
219 | 234 | %if !%{use_default_rpm_opt_flags} |
220 | 235 | %define optflags "" |
@@ -247,6 +262,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root |
247 | 262 | %if %{disable_auto_requires} |
248 | 263 | AutoReq: no |
249 | 264 | %endif |
| 265 | +%if %{all_external_3rd_party} |
| 266 | +# If we require all external 3rd party packages, then assume the use |
| 267 | +# of the OS Libevent and Hwloc packages. |
| 268 | +BuildRequires: libevent-devel hwloc-devel |
| 269 | +Requires: libevent hwloc |
| 270 | +%endif |
250 | 271 | %if %{install_modulefile} |
251 | 272 | Requires: %{modules_rpm_name} |
252 | 273 | %endif |
@@ -286,6 +307,12 @@ Provides: openmpi-runtime = %{version} |
286 | 307 | %if %{disable_auto_requires} |
287 | 308 | AutoReq: no |
288 | 309 | %endif |
| 310 | +%if %{all_external_3rd_party} |
| 311 | +# If we require all external 3rd party packages, then assume the use |
| 312 | +# of the OS Libevent and Hwloc packages. |
| 313 | +BuildRequires: libevent-devel hwloc-devel |
| 314 | +Requires: libevent hwloc |
| 315 | +%endif |
289 | 316 | %if %{install_modulefile} |
290 | 317 | Requires: %{modules_rpm_name} |
291 | 318 | %endif |
@@ -467,7 +494,7 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}" |
467 | 494 | FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}" |
468 | 495 | export CFLAGS CXXFLAGS FCFLAGS |
469 | 496 |
|
470 | | -%configure %{configure_options} |
| 497 | +%configure %{configure_options} %{_configure_3rd_party} |
471 | 498 | %{__make} %{?mflags} |
472 | 499 |
|
473 | 500 |
|
|
0 commit comments