686bc6
%global _hardened_build 1
686bc6
# We only compile with gcc, but other people may want other compilers.
686bc6
# Set the compiler here.
686bc6
%global opt_cc gcc
686bc6
# Optional CFLAGS to use with the specific compiler...gcc doesn't need any,
686bc6
# so uncomment and define to use
686bc6
#global opt_cflags
686bc6
%global opt_cxx g++
686bc6
#global opt_cxxflags
686bc6
%global opt_f77 gfortran
686bc6
#global opt_fflags
686bc6
%global opt_fc gfortran
686bc6
#global opt_fcflags
686bc6
686bc6
686bc6
# Optional name suffix to use...we leave it off when compiling with gcc, but
686bc6
# for other compiled versions to install side by side, it will need a
686bc6
# suffix in order to keep the names from conflicting.
686bc6
#global _cc_name_suffix -gcc
686bc6
686bc6
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
686bc6
686bc6
Name:			openmpi%{?_cc_name_suffix}
998727
Version:		4.0.3
686bc6
Release:		1%{?dist}
686bc6
Summary:		Open Message Passing Interface
686bc6
Group:			Development/Libraries
686bc6
License:		BSD and MIT and Romio
686bc6
URL:			http://www.open-mpi.org/
686bc6
686bc6
# We can't use %%{name} here because of _cc_name_suffix
686bc6
Source0:		https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-%{version}.tar.bz2
686bc6
Source1:		openmpi.module.in
686bc6
Source2:		openmpi.pth.py3
686bc6
Source3:		macros.openmpi
686bc6
686bc6
BuildRequires:		gcc-gfortran, gcc-c++
686bc6
%ifnarch s390 s390x
686bc6
BuildRequires:		valgrind-devel
686bc6
%endif
51343a
%ifnarch s390 s390x i686
51343a
BuildRequires:		ucx-devel
51343a
%endif
686bc6
%ifnarch s390 s390x %{arm}
51343a
BuildRequires:		libibverbs-devel >= 1.1.3, opensm-devel >= 3.3.22
686bc6
BuildRequires:		librdmacm-devel rdma-core-devel
686bc6
%endif
686bc6
# Doesn't compile:
686bc6
# vt_dyn.cc:958:28: error: 'class BPatch_basicBlockLoop' has no member named 'getLoopHead'
686bc6
#                      loop->getLoopHead()->getStartAddress(), loop_stmts );
686bc6
#BuildRequires:		dyninst-devel
686bc6
BuildRequires:		hwloc-devel
686bc6
# So configure can find lstopo
686bc6
BuildRequires:		hwloc-gui
686bc6
BuildRequires:		java-devel
686bc6
%ifnarch s390 s390x
686bc6
BuildRequires:		libfabric-devel
686bc6
BuildRequires:		papi-devel
686bc6
%endif
686bc6
BuildRequires:		perl-generators
686bc6
BuildRequires:		perl(Getopt::Long)
686bc6
BuildRequires:		pmix-devel
686bc6
%ifarch x86_64
686bc6
BuildRequires:          libpsm2-devel
686bc6
%endif
686bc6
BuildRequires:		torque-devel
686bc6
BuildRequires:		zlib-devel
686bc6
BuildRequires:		rpm-mpi-hooks
686bc6
BuildRequires:		libevent-devel >= 2.0.22
686bc6
686bc6
Provides:		mpi
686bc6
Requires:		environment(modules)
686bc6
# openmpi currently requires ssh to run
686bc6
# https://svn.open-mpi.org/trac/ompi/ticket/4228
686bc6
Requires:		openssh-clients
686bc6
Requires:		libevent >= 2.0.22
686bc6
686bc6
# Private openmpi libraries
686bc6
%global __provides_exclude_from %{_libdir}/openmpi/lib/(lib(mca|ompi|open-(pal|rte|trace))|openmpi/).*.so
686bc6
%global __requires_exclude lib(mca|ompi|open-(pal|rte|trace)|vt).*
686bc6
686bc6
%description
686bc6
Open MPI is an open source, freely available implementation of both the
686bc6
MPI-1 and MPI-2 standards, combining technologies and resources from
686bc6
several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in
686bc6
order to build the best MPI library available.  A completely new MPI-2
686bc6
compliant implementation, Open MPI offers advantages for system and
686bc6
software vendors, application developers, and computer science
686bc6
researchers. For more information, see http://www.open-mpi.org/ .
686bc6
686bc6
%package devel
686bc6
Summary:	Development files for openmpi
686bc6
Group:		Development/Libraries
686bc6
Requires:	%{name} = %{version}-%{release}, gcc-gfortran
686bc6
Provides:	mpi-devel
686bc6
Requires:	rpm-mpi-hooks
686bc6
686bc6
%description devel
686bc6
Contains development headers and libraries for openmpi.
686bc6
686bc6
%package java
686bc6
Summary:	Java library
686bc6
Group:		Development/Libraries
686bc6
Requires:	%{name} = %{version}-%{release}
686bc6
Requires:	java-headless
686bc6
686bc6
%description java
686bc6
OpenMPI Java library.
686bc6
686bc6
%package java-devel
686bc6
Summary:	Java development files for openmpi
686bc6
Group:		Development/Libraries
686bc6
Requires:	%{name}-java = %{version}-%{release}
686bc6
Requires:	java-devel
686bc6
686bc6
%description java-devel
686bc6
Contains development wrapper for compiling Java with openmpi.
686bc6
686bc6
# We set this to for convenience, since this is the unique dir we use for this
686bc6
# particular package, version, compiler
686bc6
%global namearch openmpi-%{_arch}%{?_cc_name_suffix}
686bc6
686bc6
%package -n python3-openmpi
686bc6
Summary:	OpenMPI support for Python 3
686bc6
Group:		Development/Libraries
686bc6
BuildRequires:	python3-devel
686bc6
Requires:	%{name} = %{version}-%{release}
686bc6
Provides:	python-openmpi
686bc6
686bc6
%description -n python3-openmpi
686bc6
OpenMPI support for Python 3.
686bc6
686bc6
686bc6
%prep
686bc6
%setup -q -n openmpi-%{version}
686bc6
686bc6
%build
686bc6
%set_build_flags
686bc6
./configure --prefix=%{_libdir}/%{name} \
686bc6
	--mandir=%{_mandir}/%{namearch} \
686bc6
	--includedir=%{_includedir}/%{namearch} \
686bc6
	--sysconfdir=%{_sysconfdir}/%{namearch} \
686bc6
	--disable-silent-rules \
686bc6
	--enable-builtin-atomics \
686bc6
	--enable-mpi-thread-multiple \
686bc6
%ifnarch %{power64}
686bc6
	--enable-mpi-cxx \
686bc6
%endif
686bc6
	--enable-mpi-java \
686bc6
	--enable-mpi-fortran=all \
686bc6
	--enable-cxx-exceptions \
686bc6
	--with-sge \
686bc6
%ifnarch s390 s390x
686bc6
	--with-valgrind \
686bc6
	--enable-memchecker \
686bc6
%endif
51343a
%ifnarch s390 s390x i686
51343a
	--with-ucx \
51343a
	--with-ucx-libdir=%{_libdir} \
51343a
%endif
686bc6
	--with-hwloc=external \
686bc6
	--with-pmix=external \
686bc6
	--with-libevent=external \
686bc6
	CC=%{opt_cc} CXX=%{opt_cxx} FC=%{opt_fc} \
686bc6
	LDFLAGS="%{build_ldflags}" \
686bc6
	CFLAGS="%{?opt_cflags}%{!?opt_cflags:$RPM_OPT_FLAGS}" \
686bc6
	CXXFLAGS="%{?opt_cxxflags}%{!?opt_cxxflags:$RPM_OPT_FLAGS}" \
686bc6
	FCFLAGS="%{?opt_fcflags}%{!?opt_fcflags:$RPM_OPT_FLAGS}" \
686bc6
	--with-contrib-vt-flags='CXXFLAGS="-I%{_includedir}/dyninst -L%{_libdir}/dyninst"'
686bc6
686bc6
make %{?_smp_mflags} V=1
686bc6
686bc6
%install
686bc6
make install DESTDIR=%{buildroot}
686bc6
find %{buildroot}%{_libdir}/%{name}/lib -name \*.la | xargs rm
686bc6
find %{buildroot}%{_mandir}/%{namearch} -type f | xargs gzip -9
686bc6
ln -s mpicc.1.gz %{buildroot}%{_mandir}/%{namearch}/man1/mpiCC.1.gz
686bc6
# Remove dangling symlink
686bc6
rm %{buildroot}%{_mandir}/%{namearch}/man1/mpiCC.1
686bc6
mkdir %{buildroot}%{_mandir}/%{namearch}/man{2,4,5,6,8,9,n}
686bc6
686bc6
# Make the environment-modules file
686bc6
mkdir -p %{buildroot}%{_sysconfdir}/modulefiles/mpi
686bc6
# Since we're doing our own substitution here, use our own definitions.
686bc6
sed 's#@LIBDIR@#%{_libdir}/%{name}#;
686bc6
     s#@ETCDIR@#%{_sysconfdir}/%{namearch}#;
686bc6
     s#@FMODDIR@#%{_fmoddir}/%{name}#;
686bc6
     s#@INCDIR@#%{_includedir}/%{namearch}#;
686bc6
     s#@MANDIR@#%{_mandir}/%{namearch}#;
686bc6
     s#@PYSITEARCH@#%{python3_sitearch}/%{name}#;
686bc6
     s#@COMPILER@#openmpi-%{_arch}%{?_cc_name_suffix}#;
686bc6
     s#@SUFFIX@#%{?_cc_name_suffix}_openmpi#' \
686bc6
     <%{SOURCE1} \
686bc6
     >%{buildroot}%{_sysconfdir}/modulefiles/mpi/%{namearch}
686bc6
686bc6
# make the rpm config file
686bc6
install -Dpm 644 %{SOURCE3} %{buildroot}/%{macrosdir}/macros.%{namearch}
686bc6
686bc6
# Link the fortran module to proper location
686bc6
mkdir -p %{buildroot}%{_fmoddir}/%{name}
686bc6
for mod in %{buildroot}%{_libdir}/%{name}/lib/*.mod
686bc6
do
686bc6
  modname=$(basename $mod)
686bc6
  ln -s ../../../%{name}/lib/${modname} %{buildroot}/%{_fmoddir}/%{name}/
686bc6
done
686bc6
686bc6
# Link the pkgconfig files into the main namespace as well
686bc6
mkdir -p %{buildroot}%{_libdir}/pkgconfig
686bc6
cd %{buildroot}%{_libdir}/pkgconfig
686bc6
ln -s ../%{name}/lib/pkgconfig/*.pc .
686bc6
cd -
686bc6
686bc6
# Remove extraneous wrapper link libraries (bug 814798)
686bc6
sed -i -e s/-ldl// -e s/-lhwloc// \
686bc6
  %{buildroot}%{_libdir}/%{name}/share/openmpi/*-wrapper-data.txt
686bc6
686bc6
# install .pth files
686bc6
mkdir -p %{buildroot}/%{python3_sitearch}/%{name}
686bc6
install -pDm0644 %{SOURCE2} %{buildroot}/%{python3_sitearch}/openmpi.pth
686bc6
686bc6
%check
686bc6
make check
686bc6
686bc6
%files
686bc6
%license LICENSE
686bc6
%dir %{_libdir}/%{name}
686bc6
%dir %{_sysconfdir}/%{namearch}
686bc6
%dir %{_libdir}/%{name}/bin
686bc6
%dir %{_libdir}/%{name}/lib
686bc6
%dir %{_libdir}/%{name}/lib/openmpi
686bc6
%dir %{_mandir}/%{namearch}
686bc6
%dir %{_mandir}/%{namearch}/man*
686bc6
%config(noreplace) %{_sysconfdir}/%{namearch}/*
686bc6
%{_libdir}/%{name}/bin/*.pl
686bc6
%{_libdir}/%{name}/bin/mpi[er]*
686bc6
%{_libdir}/%{name}/bin/ompi*
686bc6
%{_libdir}/%{name}/bin/orte[-dr_]*
51343a
%ifnarch s390 s390x i686
51343a
%{_libdir}/%{name}/bin/osh*
51343a
%{_libdir}/%{name}/bin/shmem*
51343a
%endif
686bc6
%{_libdir}/%{name}/lib/*.so.*
686bc6
%{_mandir}/%{namearch}/man1/*
686bc6
%{_mandir}/%{namearch}/man7/*
686bc6
%{_libdir}/%{name}/lib/openmpi/*
686bc6
%{_sysconfdir}/modulefiles/mpi/
686bc6
%dir %{_libdir}/%{name}/share
686bc6
%dir %{_libdir}/%{name}/share/openmpi
686bc6
%{_libdir}/%{name}/share/openmpi/amca-param-sets
686bc6
%{_libdir}/%{name}/share/openmpi/help*.txt
686bc6
%ifnarch s390 %{arm}
686bc6
%{_libdir}/%{name}/share/openmpi/mca-btl-openib-device-params.ini
686bc6
%endif
686bc6
686bc6
686bc6
%files devel
686bc6
%dir %{_includedir}/%{namearch}
686bc6
%{_libdir}/%{name}/bin/mpi[cCf]*
686bc6
%{_libdir}/%{name}/bin/opal_*
686bc6
%{_libdir}/%{name}/bin/orte[cCf]*
686bc6
%{_includedir}/%{namearch}/*
686bc6
%{_fmoddir}/%{name}/
686bc6
%{_libdir}/%{name}/lib/*.so
686bc6
%{_libdir}/%{name}/lib/*.mod
686bc6
%{_libdir}/%{name}/lib/pkgconfig/
686bc6
%{_libdir}/pkgconfig/*.pc
686bc6
%{_mandir}/%{namearch}/man1/mpi[cCf]*
686bc6
%{_mandir}/%{namearch}/man1/opal_*
686bc6
%{_mandir}/%{namearch}/man3/*
686bc6
%{_libdir}/%{name}/share/openmpi/openmpi-valgrind.supp
686bc6
%{_libdir}/%{name}/share/openmpi/*-wrapper-data.txt
686bc6
%{macrosdir}/macros.%{namearch}
686bc6
686bc6
%files java
686bc6
%{_libdir}/%{name}/lib/mpi.jar
686bc6
686bc6
%files java-devel
686bc6
%{_libdir}/%{name}/bin/mpijavac
686bc6
%{_libdir}/%{name}/bin/mpijavac.pl
686bc6
# Currently this only contaings openmpi/javadoc
686bc6
%{_libdir}/%{name}/share/doc/
686bc6
%{_mandir}/%{namearch}/man1/mpijavac.1.gz
686bc6
686bc6
%files -n python3-openmpi
686bc6
%dir %{python3_sitearch}/%{name}
686bc6
%{python3_sitearch}/openmpi.pth
686bc6
686bc6
686bc6
%changelog
998727
* Tue May 12 2020 Honggang Li <honli@redhat.com> - 4.0.3-1
998727
- Update to upstream v4.0.3 release
998727
- Resolves: rhbz#1817834
998727
998727
* Sun Jan 19 2020 Honggang Li <honli@redhat.com> - 4.0.2-2
998727
- Rebuild against ucx-1.6
998727
- Resolves: rhbz#1791483
998727
51343a
* Wed Oct 16 2019 Jarod Wilson <jarod@redhat.com> - 4.0.2-1
51343a
- Update to upstream v4.0.2 release
51343a
- Resolves: rhbz#1725631
51343a
51343a
* Thu Aug 01 2019 Jarod Wilson <jarod@redhat.com> - 4.0.1-3
51343a
- Actually enable UCX support
51343a
- Resolves: rhbz#1642942
51343a
51343a
* Wed Jun 19 2019 Jarod Wilson <jarod@redhat.com> - 4.0.1-2
51343a
- Bump and rebuild for newer opensm
51343a
- Resolves: rhbz#1717289
51343a
686bc6
* Mon Apr 29 2019 Jarod Wilson <jarod@redhat.com> - 4.0.1-1
686bc6
- Update to upstream v4.0.1 release
686bc6
- Resolves: rhbz#1660623
686bc6
686bc6
* Tue Sep 25 2018 Jarod Wilson <jarod@redhat.com> - 3.1.2-5
686bc6
- Update BR: opensm-devel min version and rebuild against opensm 3.3.21
686bc6
- Resolves: rhbz#1630653
686bc6
686bc6
* Mon Sep 24 2018 Jarod Wilson <jarod@redhat.com> - 3.1.2-4
686bc6
- Further tweaks to compile/linker flag usage
686bc6
- Related: rhbz#1624157
686bc6
- Move modulefiles under /etc like our other suppored mpi providers
686bc6
- Resolves: rhbz#1632399
686bc6
686bc6
* Tue Sep 18 2018 Jarod Wilson <jarod@redhat.com> - 3.1.2-3
686bc6
- Undo stripping/ignoring of distro-provided optimization flags
686bc6
- Related: rhbz#1624157
686bc6
686bc6
* Wed Sep 12 2018 Jarod Wilson <jarod@redhat.com> - 3.1.2-2
686bc6
- Additional tweaks to module paths, fix openmpi-devel R
686bc6
- Related: rhbz#1623441
686bc6
686bc6
* Wed Sep 12 2018 Jarod Wilson <jarod@redhat.com> - 3.1.2-1
686bc6
- Update to upstream 3.1.2 bug fix release
686bc6
- Fix some paths in module file, strip out python2 bits
686bc6
- Related: rhbz#1623441
686bc6
686bc6
* Thu Aug 30 2018 Jarod Wilson <jarod@redhat.com> - 3.1.1-2
686bc6
- Bump and rebuild for autogen rpmbuild library dependency fixes
686bc6
- Related: rhbz#1623441
686bc6
686bc6
* Mon Jul 02 2018 Jarod Wilson <jarod@redhat.com> - 3.1.1-1
686bc6
- Update to upstream 3.1.1 bug fix release
686bc6
- Drop BR: on deprecated infinipath-psm
686bc6
686bc6
* Thu May 31 2018 Jarod Wilson <jarod@redhat.com> - 3.1.0-1
686bc6
- Update to upstream 3.1.0 release
686bc6
- Use external pmix and libevent
686bc6
686bc6
* Thu May 17 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.1.1-11
686bc6
- Do not build the python2 subpackage on EL > 7
686bc6
686bc6
* Wed May 09 2018 Troy Dawson <tdawson@redhat.com> - 2.1.1-10
686bc6
- Build with rdma-core-devel instead of libibcm-devel
686bc6
686bc6
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.1-9
686bc6
- Escape macros in %%changelog
686bc6
686bc6
* Mon Feb 05 2018 Orion Poplawski <orion@cora.nwra.com> - 2.1.1-8
686bc6
- Rebuild for rdma-core 16.2
686bc6
686bc6
* Wed Jan 31 2018 Christoph Junghans <junghans@votca.org> - 2.1.1-7
686bc6
- Rebuild for gfortran-8
686bc6
686bc6
* Fri Jan 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.1.1-6
686bc6
- Update Python 2 dependency declarations to new packaging standards
686bc6
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
686bc6
686bc6
* Wed Aug 23 2017 Adam Williamson <awilliam@redhat.com> - 2.1.1-5
686bc6
- Disable RDMA support on 32-bit ARM (#1484155)
686bc6
- Disable hanging opal_fifo test on ppc64le (gh #2526 / #2966)
686bc6
686bc6
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-4
686bc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
686bc6
686bc6
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-3
686bc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
686bc6
686bc6
* Wed Jul 19 2017 Orion Poplawski <orion@cora.nwra.com> - 2.1.1-2
686bc6
- Provide pkgconfig files in the main namespace as well (1471512)
686bc6
686bc6
* Fri May 12 2017 Orion Poplawski <orion@cora.nwra.com> - 2.1.1-1
686bc6
- Update to 2.1.1
686bc6
686bc6
* Thu May 4 2017 Orion Poplawski <orion@cora.nwra.com> - 2.1.0-1
686bc6
- Update to 2.1.0