Skip to content
Merged
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
131 changes: 26 additions & 105 deletions SPECS/openmpi/openmpi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

# Define this to 1 if you want this RPM to install a modulefile.
# type: bool (0/1)
%{!?install_modulefile: %define install_modulefile 0}
%{!?install_modulefile: %define install_modulefile 1}

# Root path to install modulefiles. If the value modulefile_path is
# set, that directory is the root path for where the modulefile will
Expand All @@ -80,9 +80,9 @@
# to check/process install_in_opt first.

# type: string (subdir to install modulefile)
%{!?modulefile_subdir: %define modulefile_subdir %{name}}
%{!?modulefile_subdir: %define modulefile_subdir mpi}
# type: string (name of modulefile)
%{!?modulefile_name: %define modulefile_name %{version}}
%{!?modulefile_name: %define modulefile_name openmpi-%{_arch}%{?_cc_name_suffix}}

# The name of the modules RPM. Can vary from system to system.
# RHEL6 calls it "environment-modules".
Expand All @@ -104,10 +104,6 @@
# type: bool (0/1)
%{!?build_debuginfo_rpm: %define build_debuginfo_rpm 0}

# Should we build an all-in-one RPM, or several sub-package RPMs?
# type: bool (0/1)
%{!?build_all_in_one_rpm: %define build_all_in_one_rpm 1}

# Should we use the default "check_files" RPM step (i.e., check for
# unpackaged files)? It is discouraged to disable this, but some
# installers need it (e.g., older versions of OFED, because they
Expand Down Expand Up @@ -181,7 +177,7 @@
# 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.
%{!?modulefile_path: %define modulefile_path /usr/share/Modules/modulefiles}
%{!?modulefile_path: %define modulefile_path %{_datadir}/modulefiles}

%if !%{build_debuginfo_rpm}
%define debug_package %{nil}
Expand Down Expand Up @@ -224,7 +220,7 @@ Summary: A powerful implementation of MPI/SHMEM
Name: openmpi
Epoch: 3
Version: 4.1.9a1
Release: 1%{?dist}
Release: 2%{?dist}
License: BSD
Group: Development/Libraries
# https://linux.mellanox.com/public/repo/doca/3.3.0/SOURCES/mlnx_ofed/MLNX_OFED_SRC-26.01-1.0.0.0.tgz
Expand Down Expand Up @@ -261,45 +257,6 @@ communication techniques.
This RPM contains all the tools necessary to compile, link, and run
Open MPI and OpenSHMEM jobs.

%if !%{build_all_in_one_rpm}

#############################################################################
#
# Preamble Section (runtime)
#
#############################################################################

%package runtime
Summary: Tools and plugin modules for running Open MPI/SHMEM jobs
Group: Development/Libraries
Provides: mpi
Provides: openmpi = %{version}
Provides: openmpi-runtime = %{version}
%if %{disable_auto_requires}
AutoReq: no
%endif
%if %{install_modulefile}
Requires: %{modules_rpm_name}
%endif

%description runtime
Open MPI is an open source implementation of the Message Passing
Interface specification (http://www.mpi-forum.org/) developed and
maintained by a consortium of research, academic, and industry
partners.

Open MPI also includes an implementation of the OpenSHMEM parallel
programming API (http://www.openshmem.org/). OpenSHMEM is a
Partitioned Global Address Space (PGAS) abstraction layer, which
provides fast inter-process communication using one-sided
communication techniques.

This subpackage provides general tools (mpirun, mpiexec, etc.) and the
Module Component Architecture (MCA) base and plugins necessary for
running Open MPI/OpenSHMEM jobs.

%endif

#############################################################################
#
# Preamble Section (devel)
Expand All @@ -313,7 +270,7 @@ Group: Development/Libraries
AutoReq: no
%endif
Provides: openmpi-devel = %{version}
Requires: %{name}-runtime
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}

%description devel
Open MPI is an open source implementation of the Message Passing
Expand Down Expand Up @@ -344,7 +301,7 @@ Group: Development/Documentation
AutoReq: no
%endif
Provides: openmpi-docs = %{version}
Requires: %{name}-runtime
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}

%description docs
Open MPI is an open source implementation of the Message Passing
Expand Down Expand Up @@ -481,21 +438,32 @@ find $RPM_BUILD_ROOT -name config.log -exec rm -f {} \;
%if %{install_modulefile}
%{__mkdir_p} $RPM_BUILD_ROOT/%{modulefile_path}/%{modulefile_subdir}/
cat <<EOF >$RPM_BUILD_ROOT/%{modulefile_path}/%{modulefile_subdir}/%{modulefile_name}
#%Module
#%Module 1.0

# NOTE: This is an automatically-generated file! (generated by the
# Open MPI/SHMEM RPM). Any changes made here will be lost a) if the RPM is
# uninstalled, or b) if the RPM is upgraded or uninstalled.

conflict mpi

proc ModulesHelp { } {
puts stderr "This module adds Open MPI/SHMEM v%{version} to various paths"
}

module-whatis "Sets up Open MPI/SHMEM v%{version} in your enviornment"

prepend-path PATH "%{_prefix}/bin/"
prepend-path PATH "%{_bindir}"
prepend-path LD_LIBRARY_PATH %{_libdir}
prepend-path PKG_CONFIG_PATH %{_libdir}/pkgconfig
prepend-path MANPATH %{_mandir}
setenv MPI_BIN %{_bindir}
setenv MPI_SYSCONFIG %{_sysconfdir}
setenv MPI_INCLUDE %{_includedir}
setenv MPI_LIB %{_libdir}
setenv MPI_MAN %{_mandir}
setenv MPI_COMPILER %{modulefile_name}
setenv MPI_SUFFIX %{?_cc_name_suffix}_openmpi
setenv MPI_HOME %{_prefix}
EOF
%endif
# End of modulefile if
Expand Down Expand Up @@ -565,8 +533,6 @@ EOF
%endif
# End of shell_scripts if

%if !%{build_all_in_one_rpm}

# Build lists of files that are specific to each package that are not
# easily identifiable by a single directory (e.g., the different
# libraries). In a somewhat lame move, we can't just pipe everything
Expand Down Expand Up @@ -632,9 +598,6 @@ mv tmp.files devel.files
grep -v %{_mandir} docs.files > tmp.files | /bin/true
mv tmp.files docs.files

%endif
# End of build_all_in_one_rpm

#############################################################################
#
# Clean Section
Expand Down Expand Up @@ -680,50 +643,6 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
#
#############################################################################

%if %{build_all_in_one_rpm}

#
# All in one RPM
#
# Easy; just list the prefix and then specifically call out the doc
# files.
#

%files
%defattr(-, root, root, -)
%if %(test "%{_prefix}" = "/usr" && echo 1 || echo 0)
%{_bindir}/*
%{_includedir}/*
%{_libdir}/*
%{_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
# /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.
%if %{install_in_opt}
%dir /opt/%{name}
%endif
# If we're installing the modulefile, get that, too
%if %{install_modulefile}
%{modulefile_path}
%endif
# If we're installing the shell scripts, get those, too
%if %{install_shell_scripts}
%{shell_scripts_path}/%{shell_scripts_basename}.sh
%{shell_scripts_path}/%{shell_scripts_basename}.csh
%endif
%doc README INSTALL
%license LICENSE

%else

#
# Sub-package RPMs
#
Expand All @@ -733,7 +652,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
# specific file lists.
#

%files runtime -f runtime.files
%files -f runtime.files
%defattr(-, root, root, -)
%if %(test "%{_prefix}" = "/usr" && echo 1 || echo 0)
%{_bindir}/*
Expand Down Expand Up @@ -776,19 +695,21 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
# 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
%files docs
%defattr(-, root, root, -)
%{_mandir}

%endif


#############################################################################
#
# Changelog
#
#############################################################################
%changelog
* Mon Jun 29 2026 Mitch Zhu <mitchzhu@microsoft.com> - 3:4.1.9a1-2
- Build Open MPI runtime in the main package with split devel and docs
- Restore Open MPI environment modulefile

* Mon May 11 2026 Azure Linux Team - 3:4.1.9a1-1
- Upgrade to DOCA 3.3.0 (OFED 26.01-1.0.0.0)

Expand Down
Loading