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