diff --git a/.mpich.metadata b/.mpich.metadata new file mode 100644 index 0000000..47dc177 --- /dev/null +++ b/.mpich.metadata @@ -0,0 +1 @@ +c86b71e38ff3ebb50b411166d0aafd1f988c8edd SOURCES/mpich-3.0.4-rh.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/mpich-3.0.4-module.patch b/SOURCES/mpich-3.0.4-module.patch new file mode 100644 index 0000000..5aba59e --- /dev/null +++ b/SOURCES/mpich-3.0.4-module.patch @@ -0,0 +1,30 @@ +--- mpich-3.0.4/src/packaging/envmods/mpich.module.in.orig 2013-10-03 14:59:05.000000000 -0400 ++++ mpich-3.0.4/src/packaging/envmods/mpich.module.in 2013-10-03 15:43:57.000000000 -0400 +@@ -3,12 +3,19 @@ + # MPICH module for use with 'environment-modules' package: + # + +-# Define prefix so PATH and MANPATH can be updated. +-setenv prefix @prefix@ +-setenv exec_prefix @exec_prefix@ +-prepend-path PATH @bindir@ +-prepend-path MANPATH @mandir@ ++conflict mpi ++prepend-path PATH @LIBDIR@/bin ++prepend-path LD_LIBRARY_PATH @LIBDIR@/lib ++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_COMPILER @COMPILER@ ++setenv MPI_SUFFIX @SUFFIX@ ++setenv MPI_HOME @LIBDIR@ + +-# Undefine prefix and exec_prefix which are too generic environment variables. +-unsetenv prefix +-unsetenv exec_prefix diff --git a/SOURCES/mpich-3.0.4-rh.patch b/SOURCES/mpich-3.0.4-rh.patch new file mode 100644 index 0000000..d786abe --- /dev/null +++ b/SOURCES/mpich-3.0.4-rh.patch @@ -0,0 +1,116 @@ +diff -upr mpich-3.0.4/src/pm/hydra/configure.ac mpich-3.0.4.new/src/pm/hydra/configure.ac +--- mpich-3.0.4/src/pm/hydra/configure.ac 2013-04-24 10:05:00.000000000 -0400 ++++ mpich-3.0.4.new/src/pm/hydra/configure.ac 2013-09-05 11:49:01.000000000 -0400 +@@ -10,28 +10,6 @@ AC_INIT([Hydra], MPICH_VERSION_m4) + AC_CONFIG_AUX_DIR(confdb) + AC_CONFIG_MACRO_DIR(confdb) + +-# needed by hwloc in embedded mode. Must come very early to avoid +-# bizarre expansion ordering warnings +-AC_CANONICAL_TARGET +-AC_ARG_PROGRAM +- +-dnl must come before LT_INIT, which AC_REQUIREs AC_PROG_CC +-dnl must also come before AC_USE_SYSTEM_EXTENSIONS +-PAC_PROG_CC +- +-# also needed by hwloc in embedded mode, must also come early for expansion +-# ordering reasons +-AC_USE_SYSTEM_EXTENSIONS +- +-# Define -D_DARWIN_C_SOURCE on OS/X to ensure that hwloc will build even if we +-# are building under MPICH with --enable-strict that defined _POSIX_C_SOURCE. +-# Some standard Darwin headers don't build correctly under a strict posix +-# environment. +-AS_CASE([$host], +- [*-*-darwin*], [PAC_APPEND_FLAG([-D_DARWIN_C_SOURCE],[CPPFLAGS])] +-) +- +- + AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.12.3]) + + AM_PROG_AR +@@ -353,54 +331,16 @@ AC_MSG_RESULT([$hydra_topolib_list]) + + hydra_topolibs="`echo $hydra_topolib_list | sed -e 's/:/ /g' -e 's/,/ /g'`" + +-# Unconditionally include the hwloc macros, even if we are using an +-# external hwloc (or hwloc is disabled). This is needed for the +-# AM_CONDITIONALS that we will set later. +-m4_include([tools/topo/hwloc/hwloc/config/hwloc.m4]) +-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_attributes.m4]) +-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_visibility.m4]) +-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_vendor.m4]) +-m4_include([tools/topo/hwloc/hwloc/config/hwloc_components.m4]) +-m4_include([tools/topo/hwloc/hwloc/config/hwloc_pkg.m4]) +- + have_hwloc=no +-for hydra_topolib in ${hydra_topolibs}; do +- case "$hydra_topolib" in +- hwloc) +- if test "$with_hwloc_prefix" = "embedded" ; then +- HWLOC_SETUP_CORE([tools/topo/hwloc/hwloc],[have_hwloc=yes],[have_hwloc=no],[1]) +- # Only build hwloc in embedded mode +- if test "$have_hwloc" = "yes" ; then +- hydra_use_embedded_hwloc=yes +- CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS" +- CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS" +- LIBS="$HWLOC_EMBEDDED_LIBS $LIBS" +- fi +- else +- AC_CHECK_HEADERS([hwloc.h]) +- # hwloc_topology_set_pid was added in hwloc-1.0.0, which is our minimum +- # required version +- AC_CHECK_LIB([hwloc],[hwloc_topology_set_pid]) +- AC_MSG_CHECKING([if non-embedded hwloc works]) +- if test "$ac_cv_header_hwloc_h" = "yes" -a "$ac_cv_lib_hwloc_hwloc_topology_set_pid" = "yes" ; then +- have_hwloc=yes +- fi +- AC_MSG_RESULT([$have_hwloc]) +- fi +- +- # FIXME: Disable hwloc on Cygwin for now. The hwloc package, atleast as of 1.0.2, +- # does not install correctly on Cygwin +- AS_CASE([$host], [*-*-cygwin], [have_hwloc=no]) +- +- if test "$have_hwloc" = "yes" ; then +- AC_DEFINE(HAVE_HWLOC,1,[Define if hwloc is available]) +- available_topolibs="$available_topolibs hwloc" +- fi +- ;; +- *) +- ;; +- esac +-done ++AC_CHECK_HEADERS([hwloc.h]) ++# hwloc_topology_set_pid was added in hwloc-1.0.0, which is our minimum ++# required version ++AC_CHECK_LIB([hwloc],[hwloc_topology_set_pid]) ++AC_MSG_CHECKING([if non-embedded hwloc works]) ++if test "$ac_cv_header_hwloc_h" = "yes" -a "$ac_cv_lib_hwloc_hwloc_topology_set_pid" = "yes" ; then ++ have_hwloc=yes ++fi ++AC_MSG_RESULT([$have_hwloc]) + + tmp_list= + for hydra_topolib in ${available_topolibs}; do +@@ -424,7 +364,6 @@ fi + + HWLOC_DO_AM_CONDITIONALS + AM_CONDITIONAL([hydra_have_hwloc], [test "${have_hwloc}" = "yes"]) +-AM_CONDITIONAL([hydra_use_embedded_hwloc], [test "${hydra_use_embedded_hwloc}" = "yes"]) + + AC_MSG_CHECKING([available processor topology libraries]) + AC_MSG_RESULT([$available_topolibs]) +diff -upr mpich-3.0.4/src/pm/hydra/autogen.sh mpich-3.0.4.new/src/pm/hydra/autogen.sh +--- mpich-3.0.4/src/pm/hydra/autogen.sh 2013-04-24 10:05:00.000000000 -0400 ++++ mpich-3.0.4.new/src/pm/hydra/autogen.sh 2013-09-05 11:50:18.000000000 -0400 +@@ -8,8 +8,6 @@ fi + + echo "=== running autoreconf in 'mpl' ===" + (cd mpl && $autoreconf ${autoreconf_args:-"-vif"}) +-echo "=== running autoreconf in 'tools/topo/hwloc/hwloc' ===" +-(cd tools/topo/hwloc/hwloc && $autoreconf ${autoreconf_args:-"-vif"}) + $autoreconf ${autoreconf_args:-"-vif"} + + # Remove the autom4te.cache folders for a release-like structure. diff --git a/SOURCES/mpich.macros b/SOURCES/mpich.macros new file mode 100644 index 0000000..85443f4 --- /dev/null +++ b/SOURCES/mpich.macros @@ -0,0 +1,7 @@ +%_mpich_load \ + . /etc/profile.d/modules.sh; \ + module load mpi/mpich-%{_arch}; \ + export CFLAGS="$CFLAGS %{optflags}"; +%_mpich_unload \ + . /etc/profile.d/modules.sh; \ + module unload mpi/mpich-%{_arch}; diff --git a/SPECS/mpich.spec b/SPECS/mpich.spec new file mode 100644 index 0000000..9193e83 --- /dev/null +++ b/SPECS/mpich.spec @@ -0,0 +1,301 @@ +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} + +Summary: A high-performance implementation of MPI +Name: mpich +Version: 3.0.4 +Release: 4%{?dist} +License: MIT +Group: Development/Libraries +URL: http://www.mpich.org + +# Source0 derived from +# Source0: http://www.mpich.org/static/downloads/%{version}/%{name}-%{version}.tar.gz +# by +# rm -r src/mpid/pamid +# vi src/mpid/Makefile* +# and remove references to pamid +# rm -r src/mpid/ch3/channels/nemesis/netmod/scif +# vi src/src/mpid/ch3/channels/nemesis/netmod/Makefile* +# and remove references to scif +# rm -r src/pm/hydra/tools/topo/hwloc/hwloc +# vi src/pm/hydra/tools/topo/hwloc/Makefile.mk +# and remove references to hwloc +# rm `find * -name 'Makefile.in' -print | grep -v doc/ | grep -v src/mpi/romio/mpi2-other/` +# rm -r contrib www +# rm src/mpi/romio/test/external32.c +# rm `find * -name ar-lib -o -name compile -o -name config.guess -o -name config.sub -o -name depcomp -o -name missing -o -name configure -o -name .state-cache -o -name aclocal.mp -o -name libtool.m4` +# rm README.envvar maint/createcoverage maint/getcoverage src/include/mpichconf.h.in src/include/mpich_param_vals.h src/pm/hydra/include/hydra_config.h.in src/util/logging/common/state_names.h src/util/param/param_vals.c subsys_include.m4 +# more extensive changes need to actually build are included in the mpich-3.0.4-rh.patch file +Source0: %{name}-%{version}-rh.tar.gz +Source1: mpich.macros +# Patch0: mpich-modules.patch +Patch0: mpich-3.0.4-rh.patch +Patch1: mpich-3.0.4-module.patch + +BuildRequires: libXt-devel, bison, flex, libuuid-devel +BuildRequires: gcc-gfortran +BuildRequires: hwloc-devel >= 1.5 +BuildRequires: perl, python, perl-Digest-MD5, hwloc-devel +BuildRequires: automake autoconf libtool gettext +%ifnarch s390 s390x %{arm} +BuildRequires: valgrind-devel +%endif +Provides: mpi +Obsoletes: mpich2 +Obsoletes: %{name}-libs < 1.1.1 +Obsoletes: %{name}-mpd < 1.4.1 +Requires: environment-modules +Requires: chkconfig +#Requires chkconfig for /usr/sbin/alternatives + +%description +MPICH is a high-performance and widely portable implementation of the +MPI standard (MPI-1, MPI-2 and MPI-3). This release has all MPI-2.2 functions +and features required by the standard with the exeption of support for the +"external32" portable I/O format and user-defined data representations for I/O. + +The mpich binaries in this RPM packages were configured to use the default +process manager (Hydra) using the default device (ch3). The ch3 device +was configured with support for the nemesis channel that allows for +shared-memory and TCP/IP sockets based communication. + +This build also include support for using the 'module environment' to select +which MPI implementation to use when multiple implementations are installed. +If you want MPICH2 support to be automatically loaded, you need to install the +mpich-autoload package. + +%package autoload +Summary: Load mpich automatically into profile +Group: System Environment/Base +Requires: mpich = %{version}-%{release} + +%description autoload +This package contains profile files that make mpich automatically loaded. + +%package devel +Summary: Development files for mpich +Group: Development/Libraries +Provides: %{name}-devel-static = %{version}-%{release} +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig +Requires: gcc-gfortran +Requires(pre): chkconfig +#Requires chkconfig for /usr/sbin/alternatives + +%description devel +Contains development headers and libraries for mpich + +%package doc +Summary: Documentations and examples for mpich +Group: Documentation +BuildArch: noarch +Requires: %{name}-devel = %{version}-%{release} + +%description doc +Contains documentations, examples and manpages for mpich + +# We only compile with gcc, but other people may want other compilers. +# Set the compiler here. +%{!?opt_cc: %global opt_cc gcc} +%{!?opt_fc: %global opt_fc gfortran} +%{!?opt_f77: %global opt_f77 gfortran} +# Optional CFLAGS to use with the specific compiler...gcc doesn't need any, +# so uncomment and undefine to NOT use +%{!?opt_cc_cflags: %global opt_cc_cflags %{optflags}} +%{!?opt_fc_fflags: %global opt_fc_fflags %{optflags}} +#%{!?opt_fc_fflags: %global opt_fc_fflags %{optflags} -I%{_fmoddir}} +%{!?opt_f77_fflags: %global opt_f77_fflags %{optflags}} + +%ifarch s390 +%global m_option -m31 +%else +%global m_option -m%{__isa_bits} +%endif + +%ifarch %{arm} +%global m_option "" +%endif + +%ifarch %{ix86} x86_64 +%global selected_channels ch3:nemesis +%else +%global selected_channels ch3:sock +%endif + +%ifarch x86_64 ia64 ppc64 s390x sparc64 +%global priority 41 +%else +%global priority 40 +%endif + +%ifarch %{ix86} x86_64 s390 %{arm} +%global XFLAGS -fPIC +%endif + +%prep +%setup -q +# % patch0 -p0 -b .modu +%patch0 -p1 -b .rh +%patch1 -p1 -b .module +./autogen.sh +cd src/pm/hydra && ./autogen.sh && cd ../../.. + +%build +%configure \ + --enable-sharedlibs=gcc \ + --enable-shared \ + --enable-lib-depend \ + --disable-rpath \ + --enable-fc \ + --with-device=%{selected_channels} \ + --with-pm=hydra:gforker \ + --sysconfdir=%{_sysconfdir}/%{name}-%{_arch} \ + --includedir=%{_includedir}/%{name}-%{_arch} \ + --bindir=%{_libdir}/%{name}/bin \ + --libdir=%{_libdir}/%{name}/lib \ + --datadir=%{_datadir}/%{name} \ + --mandir=%{_mandir}/%{name} \ + --docdir=%{_datadir}/%{name}/doc \ + --htmldir=%{_datadir}/%{name}/doc \ + --with-hwloc-prefix=system \ + FC=%{opt_fc} \ + F77=%{opt_f77} \ + CFLAGS="%{m_option} -O2 %{?XFLAGS}" \ + CXXFLAGS="%{m_option} -O2 %{?XFLAGS}" \ + FCFLAGS="%{m_option} -O2 %{?XFLAGS}" \ + FFLAGS="%{m_option} -O2 %{?XFLAGS}" \ + LDFLAGS='-Wl,-z,noexecstack' \ + MPICH2LIB_CFLAGS="%{?opt_cc_cflags}" \ + MPICH2LIB_CXXFLAGS="%{optflags}" \ + MPICH2LIB_FCFLAGS="%{?opt_fc_fflags}" \ + MPICH2LIB_FFLAGS="%{?opt_f77_fflags}" +# MPICH2LIB_LDFLAGS='-Wl,-z,noexecstack' \ +# MPICH2_MPICC_FLAGS="%{m_option} -O2 %{?XFLAGS}" \ +# MPICH2_MPICXX_FLAGS="%{m_option} -O2 %{?XFLAGS}" \ +# MPICH2_MPIFC_FLAGS="%{m_option} -O2 %{?XFLAGS}" \ +# MPICH2_MPIF77_FLAGS="%{m_option} -O2 %{?XFLAGS}" +# --with-openpa-prefix=embedded \ + +# FCFLAGS="%{?opt_fc_fflags} -I%{_fmoddir}/%{name} %{?XFLAGS}" \ +#make %{?_smp_mflags} doesn't work +make VERBOSE=1 + +%install +make DESTDIR=%{buildroot} install + +# Workaround 1.4.1 broken destdir +for fichier in mpif77 mpif90 mpicxx mpicc ; do + sed -i 's#'%{buildroot}'##' %{buildroot}%{_libdir}/%{name}/bin/$fichier + sed -i 's#'%{buildroot}'##' %{buildroot}%{_sysconfdir}/%{name}-%{_arch}/$fichier.conf +done + +mv %{buildroot}%{_libdir}/%{name}/lib/pkgconfig %{buildroot}%{_libdir}/ +chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc + +mkdir -p %{buildroot}/%{_fmoddir}/%{name}-%{_arch} +#mv %{buildroot}%{_includedir}/%{name}/*.mod %{buildroot}/%{_fmoddir}/%{name}/ + +# Install the module file +mkdir -p %{buildroot}%{_sysconfdir}/modulefiles/mpi +mkdir -p %{buildroot}%{python_sitearch}/%{name} +sed -e 's#@LIBDIR@#%{_libdir}/%{name}#g;s#@ETCDIR@#%{_sysconfdir}/%{name}-%{_arch}#g;s#@FMODDIR@#%{_fmoddir}/%{name}-%{_arch}#g;s#@INCDIR@#%{_includedir}/%{name}-%{_arch}#g;s#@MANDIR@#%{_mandir}/%{name}#g;s#@PYSITEARCH@#%{python_sitearch}/%{name}#g;s#@COMPILER@#%{name}-%{_arch}%{?_cc_name_suffix}#g;s#@SUFFIX@#%{?_cc_name_suffix}_%{name}#g' src/packaging/envmods/mpich.module > %{buildroot}%{_sysconfdir}/modulefiles/mpi/%{name}-%{_arch} + +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +cat << EOF > %{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.sh +# Load mpich environment module +module load mpi/%{name}-%{_arch} +EOF +cp -p %{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.{sh,csh} + +# Install the RPM macro +mkdir -p %{buildroot}%{_sysconfdir}/rpm +cp -pr %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.%{name} + +# Silence rpmlint +sed -i '/^#! \//,1 d' %{buildroot}%{_sysconfdir}/%{name}-%{_arch}/mpi*.conf + +# The uninstall script here is not needed/necesary for rpm packaging +rm -rf %{buildroot}%{_sbindir}/mpe* + +find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' +rm -f %{buildroot}%{_libdir}/%{name}/lib/lib{*mpich*,opa,mpl}.a + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%pre +if [ $1 -gt 1 ] ; then + if [ -e %{_bindir}/mpiexec.py ] ; then + /usr/sbin/alternatives --remove mpi-run %{_bindir}/mpiexec.py + fi +fi + +%pre devel +if [ $1 -gt 1 ] ; then +# Remove the old alternative + if [ -e %{_bindir}/mp%{__isa_bits}-mpicc ] ; then + /usr/sbin/alternatives --remove mpicc %{_bindir}/mp%{__isa_bits}-mpicc + fi +fi + +%files +%defattr(-,root,root,-) +%doc CHANGES COPYRIGHT README RELEASE_NOTES +%dir %{_libdir}/%{name} +%dir %{_libdir}/%{name}/lib +%dir %{_libdir}/%{name}/bin +%{_libdir}/%{name}/lib/*.so.* +%{_libdir}/%{name}/bin/hydra* +%{_libdir}/%{name}/bin/mpichversion +%{_libdir}/%{name}/bin/mpiexec* +%{_libdir}/%{name}/bin/mpirun +%dir %{python_sitearch}/%{name} +%dir %{_fmoddir}/%{name}-%{_arch} +%{_libdir}/%{name}/bin/parkill +%dir %{_mandir}/%{name} +%dir %{_mandir}/%{name}/man1 +%{_mandir}/%{name}/man1/mpiexec* +%dir %{_sysconfdir}/modulefiles/mpi +%{_sysconfdir}/modulefiles/mpi/%{name}-%{_arch} + +%files autoload +%defattr(-,root,root,-) +%{_sysconfdir}/profile.d/mpich-%{_arch}.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/%{name}/bin/mpicc +%{_libdir}/%{name}/bin/mpicxx +%{_libdir}/%{name}/bin/mpic++ +%{_libdir}/%{name}/bin/mpif* +%{_mandir}/%{name}/man1/mpic* +%{_mandir}/%{name}/man1/mpif* +%config %{_sysconfdir}/%{name}-%{_arch}/ +%{_includedir}/%{name}-%{_arch}/ +#%{_fmoddir}/%{name}/ +%{_libdir}/%{name}/lib/*.so +%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/pkgconfig/openpa.pc +%config %{_sysconfdir}/rpm/macros.%{name} + +%files doc +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/doc/ +%{_mandir}/%{name}/man3/ + +%changelog +* Fri Oct 4 2013 Jay Fenlason 3.0.4-4.el7 +- Fix the module file to contain all the definitions we expect. + Resolves: rhbz1001469 + +* Wed Oct 2 2013 Jay Fenlason 3.0.4-3.el7 +- Fix macros.mpich + Resolves: rhbz1001469 + +* Fri Sep 6 2013 Jay Fenlason 3.0.4-1.el7 +- Initial import for RHEL, using sanitized source tarball. +