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