SHA256
1
0
forked from pool/mvapich2
mvapich2/mvapich2.spec
Nicolas Morey-Chaisemartin 13bb212a7c Accepting request 523093 from home:NMoreyChaisemartin:branches:science:HPC
- Only requires verbs libraries for verbs build.
  libibverbs devel causes a SEGV when run in a chroot using the
  psm or psm2 conduits
- Add testuite packages for all build flavours

OBS-URL: https://build.opensuse.org/request/show/523093
OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich2?expand=0&rev=20
2017-09-11 12:09:49 +00:00

268 lines
6.7 KiB
RPMSpec

#
# spec file for package mvapich2
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%nil
%if "%{flavor}" == ""
%define build_flavor verbs
%endif
%if "%{flavor}" == "testsuite"
%define build_flavor verbs
%define testsuite 1
%endif
%if "%{flavor}" == "psm"
%define build_flavor psm
%endif
%if "%{flavor}" == "psm-testsuite"
%define build_flavor psm
%define testsuite 1
%endif
%if "%{flavor}" == "psm2"
%define build_flavor psm2
%endif
%if "%{flavor}" == "psm2-testsuite"
%define build_flavor psm2
%define testsuite 1
%endif
%if "%{flavor}" != ""
%define pack_suff -%{flavor}
%else
%define pack_suff %{nil}
%endif
%define module_name mvapich2%{pack_suff}
%define _prefix /usr/%_lib/mpi/gcc/%{module_name}
%define _libexecdir %{_prefix}/%{_lib}
%define _benchmarkdir %{_libexecdir}/osu-micro-benchmarks
%define _moduledir /usr/share/modules/gnu-%{module_name}
Name: mvapich2%{pack_suff}
Summary: OSU MVAPICH2 MPI package
License: BSD-3-Clause
Group: Development/Libraries/Parallel
Version: 2.2
Release: 0
Source0: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-%{version}.tar.gz
Source1: mpivars.sh
Source2: mpivars.csh
Source3: _multibuild
Patch0: mvapich2-s390_get_cycles.patch
Patch1: mvapich2-pthread_yield.patch
Patch2: mvapich2-arm-support.patch
Url: http://mvapich.cse.ohio-state.edu/overview/mvapich2/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: automake
BuildRequires: bison
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
%ifnarch s390 s390x armv7hl
BuildRequires: libnuma-devel
%endif
BuildRequires: libtool
BuildRequires: libtool
BuildRequires: mpi-selector
BuildRequires: python-devel
BuildRequires: sysfsutils
BuildRequires: xorg-x11-devel
%if "%{build_flavor}" == "psm"
ExclusiveArch: %ix86 x86_64
BuildRequires: infinipath-psm-devel
%endif
%if "%{build_flavor}" == "psm2"
ExclusiveArch: x86_64
BuildRequires: libpsm2-devel
%endif
%if "%{build_flavor}" == "verbs"
BuildRequires: infiniband-diags-devel
BuildRequires: libibumad-devel
BuildRequires: libibverbs-devel
BuildRequires: librdmacm-devel
%endif
Requires: mpi-selector
%description
This is an MPI-3 implementation which includes all MPI-1 features. It
is based on MPICH2 and MVICH.
%if 0%{!?testsuite:1}
%package devel
Summary: OSU MVAPICH2 MPI package
Group: Development/Libraries/Parallel
Requires: %{name} = %{version}
%if "%{build_flavor}" == "psm"
Requires: infinipath-psm-devel
%endif
%if "%{build_flavor}" == "psm2"
Requires: libpsm2-devel
%endif
%if "%{build_flavor}" == "verbs"
Requires: libibumad-devel
Requires: libibverbs-devel
Requires: librdmacm-devel
%endif
%description devel
This is an MPI-2 implementation which includes all MPI-1 features. It
is based on MPICH2 and MVICH.
%package devel-static
Summary: OSU MVAPICH2 MPI package - static libraries
Group: Development/Libraries/Parallel
Requires: %{name}-devel = %{version}
%description devel-static
This is an MPI-3 implementation which includes all MPI-1 and MPI-2 features. It
is based on MPICH2 and MVICH. This package contains the static libraries
%endif # ! testsuite
%prep
%setup -q -n mvapich2-%{version}%{?rc_ver}
%patch0
%patch1
%patch2
cp /usr/share/automake*/config.* .
%build
#./autogen.sh
%configure \
--disable-wrapper-rpath \
%if "%{build_flavor}" == "psm"
--with-device=ch3:psm \
--with-psm=/usr \
%endif
%if "%{build_flavor}" == "psm2"
--with-device=ch3:psm \
--with-psm2=/usr \
%endif
--without-mpe
make %{?_smp_mflags} V=1
%if 0%{?testsuite}
%check
make V=1 check
%endif
%install
make DESTDIR=%{buildroot} V=1 install
# make and install mpivars files
sed -e 's,prefix,%_prefix,g' -e 's,libdir,%{_libdir},g' %{S:1} > %{buildroot}%{_bindir}/mpivars.sh
sed -e 's,prefix,%_prefix,g' -e 's,libdir,%{_libdir},g' %{S:2} > %{buildroot}%{_bindir}/mpivars.csh
rm -f %{buildroot}%{_libdir}/libfmpich.la \
%{buildroot}%{_libdir}/libmpich.la \
%{buildroot}%{_libdir}/libmpichcxx.la \
%{buildroot}%{_libdir}/libmpichf90.la \
%{buildroot}%{_libdir}/libmpl.la \
%{buildroot}%{_libdir}/libopa.la \
%{buildroot}%{_libdir}/libmpi.la \
%{buildroot}%{_libdir}/libmpicxx.la \
%{buildroot}%{_libdir}/libmpifort.la
install -m 0644 COPYRIGHT* %{buildroot}%{_datadir}/doc/mvapich2
install -m 0644 CHANGE* %{buildroot}%{_datadir}/doc/mvapich2
%if 0%{?testsuite}
# Remove everything from testsuite package
# It is all contained by mvapich2 packages
rm -rf %{buildroot}/*
%else
mkdir -p %{buildroot}%{_moduledir}
cat << EOF > %{buildroot}%{_moduledir}/%{version}
#%%Module
proc ModulesHelp { } {
global dotversion
puts stderr "\tLoads the gnu - mvapich2 %{version} Environment"
}
module-whatis "Loads the gnu mvapich2 %{version} Environment."
conflict gnu-mvapich2
prepend-path PATH %{_bindir}
prepend-path INCLUDE %{_includedir}
prepend-path INCLUDE %{_libdir}
prepend-path MANPATH %{_mandir}
prepend-path LD_LIBRARY_PATH %{_libdir}
EOF
cat << EOF > %{buildroot}%{_moduledir}/.version
#%%Module1.0
set ModulesVersion "%{version}"
EOF
%post
/sbin/ldconfig
/usr/bin/mpi-selector \
--register %{name}%{pack_suff}-%{version} \
--source-dir %{_bindir} \
--yes
%postun
/sbin/ldconfig
/usr/bin/mpi-selector --unregister %{name}%{pack_suff}-%{version} --yes --silent
%files
%defattr(-, root, root)
%doc %{_datadir}/doc
%dir /usr/%_lib/mpi
%dir /usr/%_lib/mpi/gcc
%dir %{_prefix}
%dir %{_bindir}
%dir %{_datadir}
%dir %{_includedir}
%dir /usr/share/modules
%dir %{_moduledir}
%dir %{_mandir}
%dir %{_mandir}/man1
%dir %{_mandir}/man3
%dir %{_libdir}
%dir %{_libexecdir}
%{_bindir}/*
%{_libexecdir}/osu-micro-benchmarks
%{_moduledir}
%{_mandir}/man1/*
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root)
%dir %{_libdir}/pkgconfig
%{_mandir}/man3/*
%{_includedir}
%{_libdir}/*.so
%{_libdir}/pkgconfig/mvapich2.pc
%{_libdir}/pkgconfig/openpa.pc
%files devel-static
%defattr(-,root,root)
%{_libdir}/*.a
%endif # !testsuite
%changelog