Skip to content

Commit 3a6bd75

Browse files
committed
SQUASHME address review comments
See #10224 (review) Signed-off-by: Jeff Squyres <[email protected]>
1 parent 86557ff commit 3a6bd75

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

contrib/dist/linux/buildrpm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
specfile="openmpi.spec"
7474
prefix=${prefix:-"/opt/openmpi"}
7575
rpmbuild_options=${rpmbuild_options:-"--define 'mflags -j4' --define '_source_filedigest_algorithm md5' --define '_binary_filedigest_algorithm md5'"}
76-
configure_options=${configure_options:-"--with-libevent=external --with-hwloc=external --with-pmix=external --with-prrte=external"}
76+
configure_options=${configure_options:-""}
7777
unpack_spec=0
7878

7979
# Helpful when debugging

contrib/dist/linux/openmpi.spec

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@
5353
# type: bool (0/1)
5454
%{!?install_in_opt: %define install_in_opt 0}
5555

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+
5669
# Define this if you want this RPM to install environment setup
5770
# shell scripts.
5871
# type: bool (0/1)
@@ -141,14 +154,16 @@
141154
# type: bool (0/1)
142155
%{!?allow_fortify_source: %define allow_fortify_source 1}
143156

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.
145159
%global _binary_filedigest_algorithm 1
146160
%global _source_filedigest_algorithm 1
147161

148162
# Define this to 1 if you want to keep libtool achive files
149163
# Default is 0 (remove *.la files)
150164
# type: bool (0/1)
151165
%{!?install_libtool_archive: %define install_libtool_archive 0}
166+
152167
#############################################################################
153168
#
154169
# Configuration Logic
@@ -181,6 +196,12 @@
181196
%{!?modulefile_path: %define modulefile_path /opt/%{name}/%{version}/share/openmpi/modulefiles}
182197
%endif
183198

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+
184205
# Now that we have processed install_in_opt, we can see if
185206
# modulefile_path was not set. If it was not, then set it to a
186207
# default value.
@@ -207,14 +228,8 @@
207228
%define __check_files %{nil}
208229
%endif
209230

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}}
218233

219234
%if !%{use_default_rpm_opt_flags}
220235
%define optflags ""
@@ -247,6 +262,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
247262
%if %{disable_auto_requires}
248263
AutoReq: no
249264
%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
250271
%if %{install_modulefile}
251272
Requires: %{modules_rpm_name}
252273
%endif
@@ -286,6 +307,12 @@ Provides: openmpi-runtime = %{version}
286307
%if %{disable_auto_requires}
287308
AutoReq: no
288309
%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
289316
%if %{install_modulefile}
290317
Requires: %{modules_rpm_name}
291318
%endif
@@ -467,7 +494,7 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}"
467494
FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}"
468495
export CFLAGS CXXFLAGS FCFLAGS
469496

470-
%configure %{configure_options}
497+
%configure %{configure_options} %{_configure_3rd_party}
471498
%{__make} %{?mflags}
472499

473500

0 commit comments

Comments
 (0)