Skip to content

openmpi.spec: updates for v5.0.0 #10224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contrib/dist/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ Please, do NOT set the same settings with parameters and config vars.
* `-c parameter`:
Add custom configure parameter.

**NOTE:** As of Open MPI v5.0.x, there are default configure
options for `--with-FOO=external` for all the 3rd party packages
(libevent, hwloc, pmix, prrte). This makes a pure Open MPI RPM,
not an RPM that includes those 3rd party packages. If you specify
`-c`, if you want to preserve the default options, you will need to
include those in the parameter value.

* `-r parameter`:
Add custom RPM build parameter.

Expand Down
9 changes: 3 additions & 6 deletions contrib/dist/linux/buildrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ unpack_spec=0
# "normal" names.
#export CC=gcc
#export CXX=g++
#export F77=f77
#export FC=

# Note that this script can build one or all of the following RPMs:
Expand Down Expand Up @@ -353,7 +352,6 @@ cat <<EOF
--> Hard-wired for compilers:
CC = $CC
CXX = $CXX
F77 = $F77
FC = $FC
EOF

Expand Down Expand Up @@ -391,9 +389,6 @@ fi
if test "$CXX" != ""; then
configure_options="$configure_options CXX=$CXX"
fi
if test "$F77" != ""; then
configure_options="$configure_options F77=$F77"
fi
if test "$FC" != ""; then
configure_options="$configure_options FC=$FC"
fi
Expand Down Expand Up @@ -446,6 +441,8 @@ fi
if test "$build_multiple" = "yes"; then
echo "--> Building the multiple Open MPI RPM"
cmd="$rpm_cmd -bb $rpmbuild_options --define 'build_all_in_one_rpm 0'"
# JMS
cmd="$cmd --define 'mflags -j12'"
if test "$configure_options" != ""; then
cmd="$cmd --define 'configure_options $configure_options'"
fi
Expand All @@ -471,7 +468,7 @@ cat <<EOF
==== FINISHED BUILDING Open MPI RPM ====
------------------------------------------------------------------------------
A copy of the tarball is located in: $rpmtopdir/SOURCES/
The completed rpms are located in: $rpmtopdir/RPMS/i<something>86/
The completed rpms are located in: $rpmtopdir/RPMS/
The sources rpms are located in: $rpmtopdir/SRPMS/
The spec files are located in: $rpmtopdir/SPECS/
------------------------------------------------------------------------------
Expand Down
156 changes: 82 additions & 74 deletions contrib/dist/linux/openmpi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
Expand Down Expand Up @@ -43,11 +43,6 @@
#
# shell$ rpmbuild ... --define 'install_in_opt 1' ...
#
# Or (a multi-token example):
#
# shell$ rpmbuild ... \
# --define 'configure_options CFLAGS=-g --with-openib=/usr/local/ofed' ...
#
#############################################################################

# Define this if you want to make this SRPM build in
Expand All @@ -58,6 +53,19 @@
# type: bool (0/1)
%{!?install_in_opt: %define install_in_opt 0}

# This specfile expects to find all required 3rd party packages
# (Libevent, Hwloc, PMIx, PRRTE) externally, and will not use the
# internal/embedded copies of these packages. This behavior is
# strongly recomended for packagers. However, if you want to override
# this behavior, change the definition below to 0.
#
# NOTE: This option will cause "--with-libevent=external
# --with-hwloc=external --with-pmix=external --with-prrte=external" to
# be added to the arguments to configure. If you wish to use different
# CLI options, set this value to 0 and set configure_options to the
# CLI options you want.
%{!?all_external_3rd_party: %define all_external_3rd_party 1}

# Define this if you want this RPM to install environment setup
# shell scripts.
# type: bool (0/1)
Expand Down Expand Up @@ -138,22 +146,24 @@

# On some platforms, Open MPI/SHMEM just flat-out doesn't work with
# -D_FORTIFY_SOURCE (e.g., some users have reported that there are
# problems on ioa64 platforms). In this case, just turn it off
# problems on ia64 platforms). In this case, just turn it off
# (meaning: this specfile will strip out that flag from the
# OS-provided compiler flags). We already strip out _FORTIFY_SOURCE
# for non-GCC compilers; setting this option to 0 will *always* strip
# it out, even if you're using GCC.
# type: bool (0/1)
%{!?allow_fortify_source: %define allow_fortify_source 1}

# Select md5 packing algorithm, that src.rpm created on one distro can be read on another.
# Select md5 packing algorithm, that src.rpm created on one distro can
# be read on another.
%global _binary_filedigest_algorithm 1
%global _source_filedigest_algorithm 1

# Define this to 1 if you want to keep libtool achive files
# Default is 0 (remove *.la files)
# type: bool (0/1)
%{!?install_libtool_archive: %define install_libtool_archive 0}

#############################################################################
#
# Configuration Logic
Expand All @@ -177,15 +187,22 @@
# Per advice from Doug Ledford at Red Hat, docdir is supposed to be in
# a fixed location. But if you're installing a package in /opt, all
# bets are off. So feel free to install it anywhere in your tree. He
# suggests $prefix/doc.
%define _defaultdocdir /opt/%{name}/%{version}/doc
# suggests $prefix/doc, but the GNU Autotools these days default to
# $prefix/share/doc.
%define _defaultdocdir /opt/%{name}/%{version}/share/doc

# Also put the modulefile in /opt (unless the user already specified
# where they want it to go -- the modulefile is a bit different in
# that the user may want it outside of /opt).
%{!?modulefile_path: %define modulefile_path /opt/%{name}/%{version}/share/openmpi/modulefiles}
%endif

%if %{all_external_3rd_party}
%define _configure_3rd_party --with-libevent=external --with-hwloc=external --with-pmix=external --with-prrte=external
%else
%define _configure_3rd_party %{nil}
%endif

# Now that we have processed install_in_opt, we can see if
# modulefile_path was not set. If it was not, then set it to a
# default value.
Expand All @@ -212,6 +229,7 @@
%define __check_files %{nil}
%endif

# Set this to any options you want to pass in to configure.
%{!?configure_options: %define configure_options %{nil}}

%if !%{use_default_rpm_opt_flags}
Expand Down Expand Up @@ -245,6 +263,12 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%if %{disable_auto_requires}
AutoReq: no
%endif
%if %{all_external_3rd_party}
# If we require all external 3rd party packages, then assume the use
# of the OS Libevent and Hwloc packages.
BuildRequires: libevent-devel hwloc-devel
Requires: libevent hwloc
%endif
%if %{install_modulefile}
Requires: %{modules_rpm_name}
%endif
Expand Down Expand Up @@ -284,6 +308,12 @@ Provides: openmpi-runtime = %{version}
%if %{disable_auto_requires}
AutoReq: no
%endif
%if %{all_external_3rd_party}
# If we require all external 3rd party packages, then assume the use
# of the OS Libevent and Hwloc packages.
BuildRequires: libevent-devel hwloc-devel
Requires: libevent hwloc
%endif
%if %{install_modulefile}
Requires: %{modules_rpm_name}
%endif
Expand Down Expand Up @@ -465,7 +495,7 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}"
FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}"
export CFLAGS CXXFLAGS FCFLAGS

%configure %{configure_options}
%configure %{configure_options} %{_configure_3rd_party}
%{__make} %{?mflags}


Expand Down Expand Up @@ -595,63 +625,34 @@ EOF
# always gives a 0 exit status.

# First, find all the files
rm -f all.files runtime.files remaining.files devel.files docs.files
rm -f all.files runtime.files remaining.files devel.files
find $RPM_BUILD_ROOT -type f -o -type l | \
sed -e "s@$RPM_BUILD_ROOT@@" \
> all.files | /bin/true

# Runtime files. This should generally be library files and some
# executables (no man pages, no doc files, no header files). Do *not*
# include wrapper compilers.
cat all.files | egrep '/lib/|/lib64/|/lib32/|/bin/|/etc/|/help-' > tmp.files | /bin/true
cat all.files | \
egrep '/lib/|/lib64/|/lib32/|/bin/|/etc/|/help-' \
> tmp.files | /bin/true
# Snip out a bunch of executables (e.g., wrapper compilers, pkgconfig
# files, .la and .a files)
egrep -vi 'mpic|mpif|ortec|f77|f90|pkgconfig|\.la$|\.a$' tmp.files > runtime.files | /bin/true
# files, .la and .a files) and docs
egrep -vi 'bin/mpic|bin/mpif|bin/mpif77|bin/mpif90|pkgconfig|wrapper|\.mod$|\.la$|\.a$' tmp.files > runtime.files | /bin/true

rm -f tmp.files

# Now take the runtime files out of all.files so that we don't get
# duplicates.
grep -v -f runtime.files all.files > remaining.files

# Devel files, potentially including VT files. Basically -- just
# exclude the man pages and doc files.
# Devel files. Basically -- just exclude the man pages and doc files.
cat remaining.files | \
egrep -v '/man/|/doc/' \
> devel.files | /bin/true

# Now take those files out of reaming.files so that we don't get
# duplicates.
grep -v -f devel.files remaining.files > docs.files

#################################################

# Now that we have a final list of files for each of the runtime,
# devel, and docs RPMs, snip even a few more files out of those lists
# because for directories that are wholly in only one RPM, we just
# list that directory in the file lists below, and RPM will pick up
# all files in that tree. We therefore don't want to list any files
# in those trees in our *.files file lists. Additionally, the man
# pages may get compressed by rpmbuild after this "install" step, so we
# might not even have their final filenames, anyway.

# runtime sub package
%if !%{sysconfdir_in_prefix}
grep -v %{_sysconfdir} runtime.files > tmp.files | /bin/true
mv tmp.files runtime.files
%endif
grep -v %{_pkgdatadir} runtime.files > tmp.files | /bin/true
mv tmp.files runtime.files

# devel sub package
grep -v %{_includedir} devel.files > tmp.files | /bin/true
mv tmp.files devel.files

# docs sub package
grep -v %{_mandir} docs.files > tmp.files | /bin/true
mv tmp.files docs.files

%endif
# End of build_all_in_one_rpm
# End of !build_all_in_one_rpm

#############################################################################
#
Expand Down Expand Up @@ -713,15 +714,15 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{_bindir}/*
%{_includedir}/*
%{_libdir}/*
%{_datadir}
%{_datadir}/*
%else
%{_prefix}
%endif
# If the sysconfdir is not under the prefix, then list it explicitly.
%if !%{sysconfdir_in_prefix}
%{_sysconfdir}
%endif
# If %{install_in_opt}, then we're instaling OMPI to
# If install_in_opt, then we're instaling OMPI to
# /opt/openmpi/<version>. But be sure to also explicitly mention
# /opt/openmpi so that it can be removed by RPM when everything under
# there is also removed.
Expand All @@ -737,33 +738,30 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{shell_scripts_path}/%{shell_scripts_basename}.sh
%{shell_scripts_path}/%{shell_scripts_basename}.csh
%endif
%doc README.md INSTALL LICENSE
%doc README.md LICENSE

%else

#
# Sub-package RPMs
#
# Harder than all-in-one. We list the directories specifically so
# that if the RPM creates directories when it is installed, we will
# remove them when the RPM is uninstalled. We also have to use
# specific file lists.
#
# Harder than all-in-one. Explicitly list all the files we want by
# the various *.files we generated above. Only list directories if
# they are not /usr (or assumedly any other location that does not
# already exist).

%files runtime -f runtime.files
%defattr(-, root, root, -)
%if %(test "%{_prefix}" = "/usr" && echo 1 || echo 0)
%{_bindir}/*
%{_libdir}/*
%{_datadir}
%else
%{_prefix}
%endif
%if %(test "%{_prefix}" != "/usr" && echo 1 || echo 0)
%dir %{_prefix}
%dir %{_pkgdatadir}
# If the sysconfdir is not under the prefix, then list it explicitly.
%if !%{sysconfdir_in_prefix}
%{_sysconfdir}
%dir %{_sysconfdir}
%endif
%endif
# If %{install_in_opt}, then we're instaling OMPI to

# If install_in_opt, then we're instaling OMPI to
# /opt/openmpi/<version>. But be sure to also explicitly mention
# /opt/openmpi so that it can be removed by RPM when everything under
# there is also removed. Also list /opt/openmpi/<version>/share so
Expand All @@ -781,21 +779,23 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{shell_scripts_path}/%{shell_scripts_basename}.sh
%{shell_scripts_path}/%{shell_scripts_basename}.csh
%endif
%doc README.md INSTALL LICENSE
%{_pkgdatadir}
%doc README.md LICENSE

%files devel -f devel.files
%defattr(-, root, root, -)
%{_includedir}

%files docs
%defattr(-, root, root, -)
# Note that we list the mandir specifically here, because we want all
# files found in that tree, because rpmbuild may have compressed them
# (e.g., foo.1.gz or foo.1.bz2) -- and we therefore don't know the
# exact filenames.
%files docs -f docs.files
%defattr(-, root, root, -)
# after we installed them (e.g., foo.1.gz or foo.1.bz2), and we
# therefore don't know the exact filenames.
%{_mandir}

# Explicitly list the pkgdocdir so that it will be removed when the
# RPM is removed.
%{_pkgdocdir}

%endif


Expand All @@ -805,6 +805,15 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
#
#############################################################################
%changelog
* Mon Apr 04 2022 Jeff Squyres <jsquyres@cisco.com>
- Updates for v5.0.0:
- Default all 3rd-party packages to be "external".
- Remove no-longer-existing INSTALL file.
- Tighten up files listings for the individual RPMs.
- Convert -docs sub-package to exclusively use mandir and pkgdocdir
(instead of docs.files).
- Remove some stale F77 and VT references.

* Tue Mar 28 2017 Jeff Squyres <jsquyres@cisco.com>
- Reverting a decision from a prior changelog entry: if
install_in_opt==1, then even put the modulefile under /opt.
Expand Down Expand Up @@ -959,4 +968,3 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT

* Wed Mar 23 2005 Mezzanine <mezzanine@kainx.org>
- Specfile auto-generated by Mezzanine