add mvapich2 package

This commit is contained in:
sigui 2019-12-05 16:50:06 +08:00
commit d65d49fe75
6 changed files with 340 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From c152d5a633876ff01ae69bd69d25c9ec08d0bbcb Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 3 Nov 2017 11:49:50 +0100
Subject: [PATCH 1/2] mvapich23: unbundle contrib/hwloc
---
Makefile.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 0d9ec512f5..ff3af667a4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3029,10 +3029,10 @@ bin_PROGRAMS = $(am__EXEEXT_1) src/env/mpichversion$(EXEEXT) \
@BUILD_F77_BINDING_TRUE@@BUILD_PROFILING_LIB_TRUE@am__append_173 = -DMPICH_MPI_FROM_PMPI -DUSE_ONLY_MPI_NAMES
@BUILD_F77_BINDING_TRUE@@BUILD_FC_BINDING_TRUE@am__append_174 = $(mpi_fc_sources)
@BUILD_CXX_BINDING_TRUE@am__append_175 = lib/lib@MPICXXLIBNAME@.la
-@BUILD_OSU_MVAPICH_TRUE@am__append_176 = contrib/hwloc
+@BUILD_OSU_MVAPICH_TRUE@am__append_176 =
@BUILD_OSU_MVAPICH_TRUE@am__append_177 = src/env/mpiname src/util/mv2_ckpt_rebuild osu_benchmarks
-@BUILD_OSU_MVAPICH_TRUE@am__append_178 = -Icontrib/hwloc/include/ -I$(top_srcdir)/contrib/hwloc/include
-@BUILD_OSU_MVAPICH_TRUE@am__append_179 = contrib/hwloc/src/libhwloc_embedded.la
+@BUILD_OSU_MVAPICH_TRUE@am__append_178 =
+@BUILD_OSU_MVAPICH_TRUE@am__append_179 = -lhwloc
@BUILD_COVERAGE_TRUE@am__append_180 = coverage-clean
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
--
2.13.6

View File

@ -0,0 +1,25 @@
From 3aad06949ee9edbb6376092c6891efa9a37b8f51 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 3 Nov 2017 11:51:33 +0100
Subject: [PATCH 2/2] mvapich23: unbundle osu_benchmarks
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index ff3af667a4..21e2754b56 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3030,7 +3030,7 @@ bin_PROGRAMS = $(am__EXEEXT_1) src/env/mpichversion$(EXEEXT) \
@BUILD_F77_BINDING_TRUE@@BUILD_FC_BINDING_TRUE@am__append_174 = $(mpi_fc_sources)
@BUILD_CXX_BINDING_TRUE@am__append_175 = lib/lib@MPICXXLIBNAME@.la
@BUILD_OSU_MVAPICH_TRUE@am__append_176 =
-@BUILD_OSU_MVAPICH_TRUE@am__append_177 = src/env/mpiname src/util/mv2_ckpt_rebuild osu_benchmarks
+@BUILD_OSU_MVAPICH_TRUE@am__append_177 = src/env/mpiname src/util/mv2_ckpt_rebuild
@BUILD_OSU_MVAPICH_TRUE@am__append_178 =
@BUILD_OSU_MVAPICH_TRUE@am__append_179 = -lhwloc
@BUILD_COVERAGE_TRUE@am__append_180 = coverage-clean
--
2.13.6

BIN
mvapich2-2.3.tar.gz Normal file

Binary file not shown.

6
mvapich2.macros.in Normal file
View File

@ -0,0 +1,6 @@
%_@MACRONAME@_load \
. /etc/profile.d/modules.sh; \
module load mpi/@MODULENAME@;
%_@MACRONAME@_unload \
. /etc/profile.d/modules.sh; \
module unload mpi/@MODULENAME@;

22
mvapich2.module.in Normal file
View File

@ -0,0 +1,22 @@
#%Module 1.0
#
# OpenMPI module for use with 'environment-modules' package:
#
conflict mpi
prepend-path PATH @LIBDIR@/bin
prepend-path LD_LIBRARY_PATH @LIBDIR@/lib
prepend-path PKG_CONFIG_PATH @LIBDIR@/lib/pkgconfig
prepend-path PYTHONPATH @PYSITEARCH@
prepend-path MANPATH @MANDIR@
setenv MPI_BIN @LIBDIR@/bin
setenv MPI_SYSCONFIG @ETCDIR@
setenv MPI_FORTRAN_MOD_DIR @FMODDIR@
setenv MPI_INCLUDE @INCDIR@
setenv MPI_LIB @LIBDIR@/lib
setenv MPI_MAN @MANDIR@
setenv MPI_PYTHON_SITEARCH @PYSITEARCH@
setenv MPI_PYTHON2_SITEARCH @PYSITEARCH@
setenv MPI_PYTHON3_SITEARCH @PYSITEARCH@
setenv MPI_COMPILER @COMPILER@
setenv MPI_SUFFIX @SUFFIX@
setenv MPI_HOME @LIBDIR@

257
mvapich2.spec Normal file
View File

@ -0,0 +1,257 @@
%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Name: mvapich2
Version: 2.3
Release: 6
Summary: OSU MVAPICH2 MPI package
License: BSD and MIT
URL: http://mvapich.cse.ohio-state.edu
Source: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-%{version}.tar.gz
Source1: mvapich2.module.in
Source2: mvapich2.macros.in
Patch0001: 0001-mvapich23-unbundle-contrib-hwloc.patch
Patch0002: 0002-mvapich23-unbundle-osu_benchmarks.patch
BuildRequires: gcc-gfortran libibumad-devel librdmacm-devel python3-devel
BuildRequires: rpm-mpi-hooks bison flex autoconf automake libtool
BuildRequires: perl-Digest-MD5 hwloc-devel libibverbs-devel >= 1.1.3 libibmad-devel
%ifarch x86_64
BuildRequires: libpsm2-devel >= 10.3.58
%endif
Provides: mpi
Requires: environment-modules
%description
MVAPICH2 is a Message Passing Interface (MPI 3.0) ,over InfiniBand,
Omni-Path, Ethernet/iWARP, RoCE.
%package devel
Summary: Development files for mvapich2
Provides: mpi-devel
Requires: librdmacm-devel libibverbs-devel libibumad-devel
Requires: mvapich2 = %{version}-%{release} gcc-gfortran
%description devel
Provides development headers and libraries for mvapich2.
%package help
Summary: Documentation files for mvapich2
BuildArch: noarch
Provides: mvapich2-doc = %{version}-%{release}
Obsoletes: mvapich2-doc < %{version}-%{release}
%description help
Help and additional documentation for mvapich2.
%ifarch x86_64
%package psm2
Summary: OSU MVAPICH2 MPI package 2.3 for Omni-Path adapters
Provides: mpi
Requires: environment-modules
%description psm2
MVAPICH2 is a Message Passing Interface (MPI 3.0) ,over InfiniBand, Omni-Path,
Ethernet/iWARP, RoCE. And mvapich2-psm2 is a version of mvapich2 2.3 transport
for Omni-Path adapters.
%package psm2-devel
Summary: Development files for mvapich2-psm2
Provides: mpi-devel
Requires: librdmacm-devel libibverbs-devel libibumad-devel
Requires: mvapich2-psm2 = %{version}-%{release} gcc-gfortran
%description psm2-devel
Provides development headers and libraries for mvapich2-psm2.
%package psm2-help
Summary: Documentation files for mvapich2-psm2
%description help
Help and additional documentation for mvapich2-psm2.
%endif
%prep
%autosetup -n %{name}-%{version} -p1
rm -r contrib/ limic2-0.5.6/ osu_benchmarks/
find . -name configure -exec \
sed -i -r 's/(hardcode_into_libs)=.*$/\1=no/' '{}' ';'
mkdir .default
mv * .default
mv .default default
%ifarch x86_64
cp -pr default psm2
%endif
%build
%set_build_flags
export AR=ar
%ifarch x86_64
cd psm2
%configure --prefix=%{_libdir}/mvapich2-psm2 --exec-prefix=%{_libdir}/mvapich2-psm2 \
--bindir=%{_libdir}/mvapich2-psm2/bin --sbindir=%{_libdir}/mvapich2-psm2/bin \
--libdir=%{_libdir}/mvapich2-psm2/lib --mandir=%{_mandir}/mvapich2-psm2-x86_64 \
--includedir=%{_includedir}/mvapich2-psm2-x86_64 \
--sysconfdir=%{_sysconfdir}/mvapich2-psm2-x86_64 --datarootdir=%{_datadir}/mvapich2-psm2 \
--docdir=%{_docdir}/mvapich2 --enable-error-checking=runtime --enable-timing=none \
--enable-g=mem,dbg,meminit --enable-fast=all --enable-shared --enable-static \
--enable-fortran=all --enable-cxx --with-fuse=no --disable-silent-rules --disable-wrapper-rpath \
--with-hwloc-prefix=system --with-device=ch3:psm --with-ftb=no --with-blcr=no \
CC=gcc CFLAGS="-m64 -O3 -fno-strict-aliasing %{build_cflags} $XFLAGS" CXX=g++ \
CXXFLAGS="-m64 -O3 %{build_cflags} $XFLAGS" FC=gfortran FCFLAGS="-m64 %{build_cflags} \
$XFLAGS" F77=gfortran FFLAGS="-m64 %{build_cflags} $XFLAGS" LDFLAGS="%{build_ldflags}"
find . -name libtool -exec \
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' '{}' ';'
%make_build
cd ..
%endif
%global namearch mvapich2-%{_arch}
cd default
%configure --prefix=%{_libdir}/mvapich2 --exec-prefix=%{_libdir}/mvapich2 \
--bindir=%{_libdir}/mvapich2/bin --sbindir=%{_libdir}/mvapich2/bin \
--libdir=%{_libdir}/mvapich2/lib --mandir=%{_mandir}/%{namearch} \
--includedir=%{_includedir}/%{namearch} --sysconfdir=%{_sysconfdir}/%{namearch} \
--datarootdir=%{_datadir}/mvapich2 --docdir=%{_docdir}/mvapich2 \
--enable-error-checking=runtime --enable-timing=none --enable-g=mem,dbg,meminit \
--enable-fast=all --enable-shared --enable-static --enable-fortran=all --enable-cxx \
--disable-silent-rules --disable-wrapper-rpath --with-hwloc-prefix=system --with-ftb=no \
--with-blcr=no --with-fuse=no \
CC=gcc CFLAGS="-O3 -fno-strict-aliasing %{build_cflags} $XFLAGS" CXX=g++ \
CXXFLAGS="-O3 %{build_cflags} $XFLAGS" FC=gfortran FCFLAGS="%{build_cflags} $XFLAGS" \
F77=gfortran FFLAGS="%{build_cflags} $XFLAGS" LDFLAGS="%{build_ldflags}"
find . -name libtool -exec \
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' '{}' ';'
%make_build
cd ..
%install
finish_install() {
local LIBNAME="$1"
local NAMEARCH="$1-%{_arch}"
%delete_la
install -d %{buildroot}%{_mandir}/$NAMEARCH/man{2,4,5,6,7,8,9,n}
install -d %{buildroot}/%{_fmoddir}/$1$4
install -d %{buildroot}/%{python3_sitearch}/$1
install -d %{buildroot}%{_sysconfdir}/modulefiles/mpi
sed "s#@LIBDIR@#%{_libdir}/$1#g;
s#@ETCDIR@#%{_sysconfdir}/$NAMEARCH#g;
s#@FMODDIR@#%{_fmoddir}/$1$4#g;
s#@INCDIR@#%{_includedir}/$NAMEARCH#g;
s#@MANDIR@#%{_mandir}/$NAMEARCH#g;
s#@PYSITEARCH@#%{python3_sitearch}/$1#g;
s#@COMPILER@#$NAMEARCH#g;
s#@SUFFIX@#_$1#g" < $2 \
> %{buildroot}%{_sysconfdir}/modulefiles/mpi/$NAMEARCH
install -d %{buildroot}%{_sysconfdir}/rpm
sed "s#@MACRONAME@#${LIBNAME//[-.]/_}#g;
s#@MODULENAME@#$NAMEARCH#" < $3 \
> %{buildroot}/%{_sysconfdir}/rpm/macros.$NAMEARCH
}
install -d %{buildroot}%{_docdir}/mvapich2
%ifarch x86_64
cd psm2
%make_install
finish_install mvapich2-psm2 %SOURCE1 %SOURCE2 ""
cd ..
%endif
cd default
%make_install
finish_install mvapich2 %SOURCE1 %SOURCE2 ""
cd ..
%global namearch mvapich2-%{_arch}
%files
%dir %{_libdir}/mvapich2
%dir %{_libdir}/mvapich2/bin
%dir %{_libdir}/mvapich2/lib
%dir %{_fmoddir}/mvapich2
%dir %{python3_sitearch}/mvapich2
%{_libdir}/mvapich2/bin/hydra_*
%{_libdir}/mvapich2/bin/mpichversion
%{_libdir}/mvapich2/bin/mpiexec*
%{_libdir}/mvapich2/bin/mpiname
%{_libdir}/mvapich2/bin/mpirun*
%{_libdir}/mvapich2/bin/mpispawn
%{_libdir}/mvapich2/bin/mpivars
%{_libdir}/mvapich2/bin/parkill
%{_libdir}/mvapich2/lib/*.so.*
%{_sysconfdir}/modulefiles/mpi/%{namearch}
%files devel
%dir %{_includedir}/%{namearch}
%{_sysconfdir}/rpm/macros.%{namearch}
%{_includedir}/%{namearch}/*
%{_libdir}/mvapich2/bin/mpic++
%{_libdir}/mvapich2/bin/mpicc
%{_libdir}/mvapich2/bin/mpicxx
%{_libdir}/mvapich2/bin/mpif77
%{_libdir}/mvapich2/bin/mpif90
%{_libdir}/mvapich2/bin/mpifort
%{_libdir}/mvapich2/lib/pkgconfig
%{_libdir}/mvapich2/lib/*.a
%{_libdir}/mvapich2/lib/*.so
%files help
%{_docdir}/mvapich2
%dir %{_mandir}/%{namearch}
%dir %{_mandir}/%{namearch}/man*
%{_mandir}/%{namearch}/man1/*
%{_mandir}/%{namearch}/man3/*
%ifarch x86_64
%files psm2
%dir %{_libdir}/mvapich2-psm2
%dir %{_libdir}/mvapich2-psm2/bin
%dir %{_libdir}/mvapich2-psm2/lib
%dir %{_fmoddir}/mvapich2-psm2
%dir %{python3_sitearch}/mvapich2-psm2
%{_libdir}/mvapich2-psm2/bin/hydra*
%{_libdir}/mvapich2-psm2/bin/mpichversion
%{_libdir}/mvapich2-psm2/bin/mpiexec*
%{_libdir}/mvapich2-psm2/bin/mpiname
%{_libdir}/mvapich2-psm2/bin/mpirun*
%{_libdir}/mvapich2-psm2/bin/mpispawn
%{_libdir}/mvapich2-psm2/bin/mpivars
%{_libdir}/mvapich2-psm2/bin/parkill
%{_libdir}/mvapich2-psm2/lib/*.so.*
%{_sysconfdir}/modulefiles/mpi/mvapich2-psm2-x86_64
%files psm2-devel
%dir %{_includedir}/mvapich2-psm2-x86_64
%{_sysconfdir}/rpm/macros.mvapich2-psm2-x86_64
%{_includedir}/mvapich2-psm2-x86_64/*
%{_libdir}/mvapich2-psm2/bin/mpic++
%{_libdir}/mvapich2-psm2/bin/mpicc
%{_libdir}/mvapich2-psm2/bin/mpicxx
%{_libdir}/mvapich2-psm2/bin/mpif*
%{_libdir}/mvapich2-psm2/lib/pkgconfig
%{_libdir}/mvapich2-psm2/lib/*.a
%{_libdir}/mvapich2-psm2/lib/*.so
%files psm2-help
%dir %{_mandir}/mvapich2-psm2-x86_64
%dir %{_mandir}/mvapich2-psm2-x86_64/man*
%{_mandir}/mvapich2-psm2-x86_64/man1/*
%{_mandir}/mvapich2-psm2-x86_64/man3/*
%endif
%changelog
* Fri Nov 22 2019 sunguoshuai <sunguoshuai@huawei.com> - 2.3-6
- Package init.