From d4b4e249f8fc370aa6d011ed0db3fb0b7d3b7f74 Mon Sep 17 00:00:00 2001 From: basebuilder_pel7ppc64bebuilder0 Date: Tue, 29 May 2018 17:24:10 +0200 Subject: [PATCH] mpich package update Signed-off-by: basebuilder_pel7ppc64bebuilder0 --- .../0001-Revert-require-automake-1.15.patch | 29 + ...01-hydra-improve-localhost-detection.patch | 163 ++++++ ...pm-remshell-include-MPL-when-linking.patch | 32 ++ .../0002-Revert-require-libtool-2.4.3.patch | 228 ++++++++ ...-pm-gforker-include-MPL-when-linking.patch | 13 + SOURCES/0003-soften-version-check.patch | 13 + SOURCES/0003-unbundle-YAML-Tiny.patch | 48 ++ SOURCES/0004-unbundle-hwloc-from-hydra.patch | 119 ++++ SOURCES/mpich-3.0.4-rh.patch | 116 ++++ SOURCES/mpich.macros.in | 7 + SOURCES/mpich.module.in | 20 + SPECS/mpich.spec | 540 ++++++++++++++++++ 12 files changed, 1328 insertions(+) create mode 100644 SOURCES/0001-Revert-require-automake-1.15.patch create mode 100644 SOURCES/0001-hydra-improve-localhost-detection.patch create mode 100644 SOURCES/0001-pm-remshell-include-MPL-when-linking.patch create mode 100644 SOURCES/0002-Revert-require-libtool-2.4.3.patch create mode 100644 SOURCES/0002-pm-gforker-include-MPL-when-linking.patch create mode 100644 SOURCES/0003-soften-version-check.patch create mode 100644 SOURCES/0003-unbundle-YAML-Tiny.patch create mode 100644 SOURCES/0004-unbundle-hwloc-from-hydra.patch create mode 100644 SOURCES/mpich-3.0.4-rh.patch create mode 100644 SOURCES/mpich.macros.in create mode 100644 SOURCES/mpich.module.in create mode 100644 SPECS/mpich.spec diff --git a/SOURCES/0001-Revert-require-automake-1.15.patch b/SOURCES/0001-Revert-require-automake-1.15.patch new file mode 100644 index 00000000..e10c38bb --- /dev/null +++ b/SOURCES/0001-Revert-require-automake-1.15.patch @@ -0,0 +1,29 @@ +From fce385fb31b7faed0ab01834831a920a66073807 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Tue, 21 Jun 2016 17:18:51 +0200 +Subject: [PATCH 1/4] Revert "require automake >= 1.15" + +This reverts commit 67577443f839be953e7c9c9dfd53c06cbd08525f +to allow re-running automake in RHEL7. +The reverted commit suggests that the newer automake was needed on Tru64, +which does not concern us. +--- + autogen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/autogen.sh b/autogen.sh +index 5370dbf32d..bc33139189 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -506,7 +506,7 @@ fi + + echo_n "Checking for automake version... " + recreate_tmp +-ver=1.15 ++ver=1.12.3 + cat > .tmp/configure.ac< +Date: Thu, 21 Jan 2016 17:01:42 -0600 +Subject: [PATCH] hydra: improve localhost detection. + +Be more forgiving for systems that do not resolve "localhost" or +equivalent names very well (e.g., they are not added to /etc/hosts). +Try them out, and if nothing works, fallback to "is not local" mode. + +Thanks to Orion Poplawski for the suggestion. +--- + src/pm/hydra/utils/sock/sock.c | 89 +++++++++++++++++++++++------------------- + 1 file changed, 48 insertions(+), 41 deletions(-) + +diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c +index 86b25077aac2..dc56c767f544 100644 +--- a/src/pm/hydra/utils/sock/sock.c ++++ b/src/pm/hydra/utils/sock/sock.c +@@ -492,7 +492,7 @@ HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip) + HYD_status HYDU_sock_is_local(char *host, int *is_local) + { + struct hostent *ht; +- char *host_ip = NULL, *local_ip = NULL, *lhost_ip = NULL; ++ char *host_ip = NULL, *lhost_ip = NULL; + char lhost[MAX_HOSTNAME_LEN]; + struct sockaddr_in sa; + struct ifaddrs *ifaddr, *ifa; +@@ -516,54 +516,63 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local) + + /* STEP 1: If "host" matches the local host name, return */ + if (gethostname(lhost, MAX_HOSTNAME_LEN) < 0) { +- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "gethostname returned an error\n"); ++ /* We can't figure out what my localhost name is. *sigh*. We ++ * could return an error here, but we will just punt it to the ++ * upper layer saying that we don't know if it is local. We ++ * cannot try steps 2 and 3 either, since we don't have our ++ * local hostname. */ ++ goto fn_exit; + } + else if (!strcmp(lhost, host)) { + *is_local = 1; + goto fn_exit; + } ++ else { ++ /* we have our local hostname, but that does not match the ++ * provided hostname. Let's try to get our remote IP address ++ * first. If we can't get that, we can give up. */ ++ /* If we are unable to resolve the remote host name, it need ++ * not be an error. It could mean that the user is using an ++ * alias for the hostname (e.g., an ssh config alias) */ ++ if ((ht = gethostbyname(host)) == NULL) ++ goto fn_exit; + ++ memset((char *) &sa, 0, sizeof(struct sockaddr_in)); ++ memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length); + +- /* STEP 2: If the IP address associated with "host" and the IP address local +- * host resolves to match, return */ +- +- if ((ht = gethostbyname(lhost)) == NULL) { +- HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "gethostbyname error on %s: %s\n", +- lhost, hstrerror(h_errno)); ++ /* Find the IP address of the host */ ++ host_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf, ++ MAX_HOSTNAME_LEN)); ++ HYDU_ASSERT(host_ip, status); + } + +- memset((char *) &sa, 0, sizeof(struct sockaddr_in)); +- memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length); +- +- /* Find the IP address of the host */ +- lhost_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf, +- MAX_HOSTNAME_LEN)); +- HYDU_ASSERT(lhost_ip, status); ++ /* OK, if we are here, we got the remote IP. We have two ways of ++ * getting the local IP: gethostbyname or getifaddrs. We'll try ++ * both. */ + +- /* If we are unable to resolve the remote host name, it need not be an +- * error. It could mean that the user is using an alias for the hostname +- * (e.g., an ssh config alias) */ +- if ((ht = gethostbyname(host)) == NULL) +- goto fn_exit; ++ /* STEP 2: Let's try the gethostbyname model */ + +- memset((char *) &sa, 0, sizeof(struct sockaddr_in)); +- memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length); ++ if ((ht = gethostbyname(lhost))) { ++ memset((char *) &sa, 0, sizeof(struct sockaddr_in)); ++ memcpy(&sa.sin_addr, ht->h_addr_list[0], ht->h_length); + +- /* Find the IP address of the host */ +- host_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf, +- MAX_HOSTNAME_LEN)); +- HYDU_ASSERT(host_ip, status); ++ /* Find the IP address of the host */ ++ lhost_ip = HYDU_strdup((char *) inet_ntop(AF_INET, (const void *) &sa.sin_addr, buf, ++ MAX_HOSTNAME_LEN)); ++ HYDU_ASSERT(lhost_ip, status); + +- /* See if the IP address of the hostname we got matches the IP address +- * to which the local host resolves */ +- if (!strcmp(lhost_ip, host_ip)) { +- *is_local = 1; +- goto fn_exit; ++ /* See if the IP address of the hostname we got matches the IP ++ * address to which the local host resolves */ ++ if (!strcmp(lhost_ip, host_ip)) { ++ *is_local = 1; ++ goto fn_exit; ++ } + } + ++ /* Either gethostbyname didn't resolve or we didn't find a match. ++ * Either way, let's try the getifaddr model. */ + +- /* STEP 3: Find all local IP addresses and try to match the host IP +- * with it. */ ++ /* STEP 3: Let's try the getifaddr model */ + + if (getifaddrs(&ifaddr) == -1) + HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "getifaddrs failed\n"); +@@ -573,21 +582,21 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local) + if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) { + struct sockaddr_in *sa_ptr = (struct sockaddr_in *) ifa->ifa_addr; + +- local_ip = HYDU_strdup((char *) ++ lhost_ip = HYDU_strdup((char *) + inet_ntop(AF_INET, (const void *) &(sa_ptr->sin_addr), buf, + MAX_HOSTNAME_LEN)); +- HYDU_ASSERT(local_ip, status); ++ HYDU_ASSERT(lhost_ip, status); + +- /* STEP 3: For each local IP address, see if it matches the "host" ++ /* For each local IP address, see if it matches the "host" + * IP address */ +- if (!strcmp(host_ip, local_ip)) { ++ if (!strcmp(host_ip, lhost_ip)) { + *is_local = 1; + freeifaddrs(ifaddr); + goto fn_exit; + } + +- HYDU_FREE(local_ip); +- local_ip = NULL; ++ HYDU_FREE(lhost_ip); ++ lhost_ip = NULL; + } + } + +@@ -596,8 +605,6 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local) + fn_exit: + if (host_ip) + HYDU_FREE(host_ip); +- if (local_ip) +- HYDU_FREE(local_ip); + if (lhost_ip) + HYDU_FREE(lhost_ip); + return status; +-- +1.9.1 + diff --git a/SOURCES/0001-pm-remshell-include-MPL-when-linking.patch b/SOURCES/0001-pm-remshell-include-MPL-when-linking.patch new file mode 100644 index 00000000..c200c48d --- /dev/null +++ b/SOURCES/0001-pm-remshell-include-MPL-when-linking.patch @@ -0,0 +1,32 @@ +From d3d7f0d571607c3547396045093c77364cfaec0b Mon Sep 17 00:00:00 2001 +From: Ken Raffenetti +Date: Fri, 28 Aug 2015 14:28:37 -0700 +Subject: [PATCH] pm/remshell: include MPL when linking + +--- + src/pm/remshell/Makefile.mk | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/pm/remshell/Makefile.mk b/src/pm/remshell/Makefile.mk +index ea366a9e..0ec937d9 100644 +--- a/src/pm/remshell/Makefile.mk ++++ b/src/pm/remshell/Makefile.mk +@@ -16,13 +16,13 @@ if BUILD_PM_REMSHELL + if PRIMARY_PM_REMSHELL + bin_PROGRAMS += src/pm/remshell/mpiexec + src_pm_remshell_mpiexec_SOURCES = src/pm/remshell/mpiexec.c +-src_pm_remshell_mpiexec_LDADD = src/pm/util/libmpiexec.a ++src_pm_remshell_mpiexec_LDADD = src/pm/util/libmpiexec.a $(mpllib) + # we may not want to add AM_CPPFLAGS for this program + src_pm_remshell_mpiexec_CPPFLAGS = $(common_pm_includes) $(AM_CPPFLAGS) + else !PRIMARY_PM_REMSHELL + bin_PROGRAMS += src/pm/remshell/mpiexec.remshell + src_pm_remshell_mpiexec_remshell_SOURCES = src/pm/remshell/mpiexec.c +-src_pm_remshell_mpiexec_remshell_LDADD = src/pm/util/libmpiexec.a ++src_pm_remshell_mpiexec_remshell_LDADD = src/pm/util/libmpiexec.a $(mpllib) + # we may not want to add AM_CPPFLAGS for this program + src_pm_remshell_mpiexec_remshell_CPPFLAGS = $(common_pm_includes) $(AM_CPPFLAGS) + endif !PRIMARY_PM_REMSHELL +-- +1.9.1 + diff --git a/SOURCES/0002-Revert-require-libtool-2.4.3.patch b/SOURCES/0002-Revert-require-libtool-2.4.3.patch new file mode 100644 index 00000000..2cd912fd --- /dev/null +++ b/SOURCES/0002-Revert-require-libtool-2.4.3.patch @@ -0,0 +1,228 @@ +From 7a9b12d8c8d2fdb2906f941fab9853e39883d381 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Tue, 21 Jun 2016 17:26:49 +0200 +Subject: [PATCH 2/4] Revert "require libtool >= 2.4.3" + +This reverts commit b21dc461115bdf99d42176ecea8e8efc763d8a2d. +--- + autogen.sh | 31 +++++- + maint/0001-libtool-powerpc-le-linux-support.patch | 111 ++++++++++++++++++++++ + maint/darwin-ifort.patch | 8 +- + maint/libtool.m4.patch | 11 +++ + 4 files changed, 155 insertions(+), 6 deletions(-) + create mode 100644 maint/0001-libtool-powerpc-le-linux-support.patch + create mode 100644 maint/libtool.m4.patch + +diff --git a/autogen.sh b/autogen.sh +index bc33139189..8a8ccd90f2 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -544,7 +544,7 @@ fi + + echo_n "Checking for libtool version... " + recreate_tmp +-ver=2.4.3 ++ver=2.4 + cat <.tmp/configure.ac + AC_INIT(testver,1.0) + AC_CONFIG_AUX_DIR([m4]) +@@ -924,6 +924,33 @@ if [ "$do_build_configure" = "yes" ] ; then + # Older versions are not supported to build mpich. + # Newer versions should have this patch already included. + if [ -f $amdir/confdb/libtool.m4 ] ; then ++ echo_n "Patching libtool.m4 to enable support for powerpcle... " ++ powerpcle_patch_requires_rebuild=no ++ patch -N -s -l $amdir/confdb/libtool.m4 maint/0001-libtool-powerpc-le-linux-support.patch ++ if [ $? -eq 0 ] ; then ++ powerpcle_patch_requires_rebuild=yes ++ # Remove possible leftovers, which don't imply a failure ++ rm -f $amdir/confdb/libtool.m4.orig ++ echo "done" ++ else ++ echo "failed" ++ fi ++ ++ # There is no need to patch if we're not going to use Fortran. ++ nagfor_patch_requires_rebuild=no ++ if [ $do_bindings = "yes" ] ; then ++ echo_n "Patching libtool.m4 for compatibility with nagfor shared libraries... " ++ patch -N -s -l $amdir/confdb/libtool.m4 maint/libtool.m4.patch ++ if [ $? -eq 0 ] ; then ++ nagfor_patch_requires_rebuild=yes ++ # Remove possible leftovers, which don't imply a failure ++ rm -f $amdir/confdb/libtool.m4.orig ++ echo "done" ++ else ++ echo "failed" ++ fi ++ fi ++ + # There is no need to patch if we're not going to use Fortran. + ifort_patch_requires_rebuild=no + if [ $do_bindings = "yes" ] ; then +@@ -939,7 +966,7 @@ if [ "$do_build_configure" = "yes" ] ; then + fi + fi + +- if [ $ifort_patch_requires_rebuild = "yes" ] ; then ++ if [ $powerpcle_patch_requires_rebuild = "yes" -o $nagfor_patch_requires_rebuild = "yes" -o $ifort_patch_requires_rebuild = "yes" ] ; then + # Rebuild configure + (cd $amdir && $autoconf -f) || exit 1 + # Reset libtool.m4 timestamps to avoid confusing make +diff --git a/maint/0001-libtool-powerpc-le-linux-support.patch b/maint/0001-libtool-powerpc-le-linux-support.patch +new file mode 100644 +index 0000000000..52e122ac27 +--- /dev/null ++++ b/maint/0001-libtool-powerpc-le-linux-support.patch +@@ -0,0 +1,111 @@ ++From 723f678b8f297544b64880c8d80b60328e82cb45 Mon Sep 17 00:00:00 2001 ++From: Alan Modra ++Date: Thu, 6 Jun 2013 14:48:22 +0930 ++Subject: [PATCH] libtool: powerpc*le-linux support ++ ++This is a combination of 5 commits. ++ ++See libtool version 2.4.2.418 ++http://git.savannah.gnu.org/cgit/libtool.git/log/?h=v2.4.2.418 ++ ++========================================================================== ++ ++ commit 12bf693d2d317c3313ee91058b2289d65a57f386 ++ Author: Alan Modra ++ Date: Thu Jun 6 14:48:22 2013 +0930 ++ ++ libtool: fix refixed unmangled powerpc*le-linux support patch ++ ++ * m4/libtool.m4: fix refixed badly unmangled hunks from earlier ++ powerpc*le changeset. ++ Reported by Peter Rosin. ++ ++ Signed-off-by: Gary V. Vaughan ++ ++ commit aa14ead14c5e375789f08026d9ece5963a9322c2 ++ Author: Alan Modra ++ Date: Thu Jun 6 14:48:22 2013 +0930 ++ ++ libtool: refix unmangled powerpc*le-linux support patch ++ ++ * m4/libtool.m4: refix badly unmangled hunks from earlier ++ powerpc*le changeset. ++ Reported by Peter Rosin. ++ ++ Signed-off-by: Gary V. Vaughan ++ ++ commit bb1c8bca8aee6e487aaf6b320b8f56f6ac0d21ac ++ Author: Gary V. Vaughan ++ Date: Thu Aug 22 15:38:00 2013 +0700 ++ ++ libtool: refactor powerpc*le-linux case branch expressions. ++ ++ libtool (_LT_ENABLE_LOCK): make inner case branch expressions ++ consistent with outer case expression. ++ Reported by Peter Rosin. ++ ++ Signed-off-by: Gary V. Vaughan ++ ++ commit 03754a10041e86b2bd41b404a9ad824ef28bee7e ++ Author: Alan Modra ++ Date: Thu Jun 6 14:48:22 2013 +0930 ++ ++ libtool: fix mangled powerpc*le-linux support patch ++ ++ * m4/libtool.m4: unmangled badly pasted hunks from previous ++ changeset. ++ ++ commit f21c4d470423ab5b108918eaa5db295f644b12d1 ++ Author: Alan Modra ++ Date: Thu Jun 6 14:48:22 2013 +0930 ++ ++ libtool: initial powerpc*le-linux support ++ ++ * m4/libtool.m4 (ld -m flags): Remove non-canonical ppc host match. ++ Support little-endian powerpc linux host. ++ ++========================================================================== ++--- ++ libltdl/m4/libtool.m4 | 12 +++++++++--- ++ 1 files changed, 9 insertions(+), 3 deletions(-) ++ ++diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 ++index d812584..7aefebc 100644 ++--- a/libltdl/m4/libtool.m4 +++++ b/libltdl/m4/libtool.m4 ++@@ -1268,7 +1268,7 @@ ia64-*-hpux*) ++ rm -rf conftest* ++ ;; ++ ++-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +++x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ ++ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++@@ -1282,7 +1282,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++- ppc64-*linux*|powerpc64-*linux*) +++ powerpc64le-*linux*) +++ LD="${LD-ld} -m elf32lppclinux" +++ ;; +++ powerpc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++@@ -1301,7 +1304,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++- ppc*-*linux*|powerpc*-*linux*) +++ powerpcle-*linux*) +++ LD="${LD-ld} -m elf64lppc" +++ ;; +++ powerpc-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*|s390*-*tpf*) ++-- ++1.7.1 ++ +diff --git a/maint/darwin-ifort.patch b/maint/darwin-ifort.patch +index 7ce8b39211..42c7816200 100644 +--- a/maint/darwin-ifort.patch ++++ b/maint/darwin-ifort.patch +@@ -1,11 +1,11 @@ + --- confdb/libtool.m4~ 2014-12-23 10:59:38.000000000 -0600 + +++ confdb/libtool.m4 2014-12-23 11:05:54.000000000 -0600 +-@@ -1088,7 +1088,10 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], ++@@ -1097,7 +1097,10 @@ + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined ++ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in +-- ifort*|nagfor*) _lt_dar_can_shared=yes ;; +-+ ifort*|nagfor*) ++- ifort*) _lt_dar_can_shared=yes ;; +++ ifort*) + + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + + _lt_dar_can_shared=yes + + ;; +diff --git a/maint/libtool.m4.patch b/maint/libtool.m4.patch +new file mode 100644 +index 0000000000..4ad76286cb +--- /dev/null ++++ b/maint/libtool.m4.patch +@@ -0,0 +1,11 @@ ++--- confdb/libtool.m4 2013-03-29 16:26:23.162062517 -0500 +++++ confdb/libtool.m4 2013-06-21 14:22:05.138914413 -0500 ++@@ -4817,6 +4817,8 @@ ++ lf95*) # Lahey Fortran 8.1 ++ _LT_TAGVAR(whole_archive_flag_spec, $1)= ++ tmp_sharedflag='--shared' ;; +++ nagfor*) # NAGFOR 5.3 +++ tmp_sharedflag='-Wl,-shared' ;; ++ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) ++ tmp_sharedflag='-qmkshrobj' ++ tmp_addflag= ;; +-- +2.7.4 + diff --git a/SOURCES/0002-pm-gforker-include-MPL-when-linking.patch b/SOURCES/0002-pm-gforker-include-MPL-when-linking.patch new file mode 100644 index 00000000..d7ca01dd --- /dev/null +++ b/SOURCES/0002-pm-gforker-include-MPL-when-linking.patch @@ -0,0 +1,13 @@ +diff --git mpich-3.2/src/pm/gforker/Makefile.mk~ mpich-3.2/src/pm/gforker/Makefile.mk +index 3a156057b9..afb7b41a01 100644 +--- mpich-3.2/src/pm/gforker/Makefile.mk~ ++++ mpich-3.2/src/pm/gforker/Makefile.mk +@@ -22,7 +22,7 @@ src_pm_gforker_mpiexec_CPPFLAGS = $(common_pm_includes) $(AM_CPPFLAGS) + else !PRIMARY_PM_GFORKER + bin_PROGRAMS += src/pm/gforker/mpiexec.gforker + src_pm_gforker_mpiexec_gforker_SOURCES = src/pm/gforker/mpiexec.c +-src_pm_gforker_mpiexec_gforker_LDADD = src/pm/util/libmpiexec.a ++src_pm_gforker_mpiexec_gforker_LDADD = src/pm/util/libmpiexec.a $(mpllib) + # we may not want to add AM_CPPFLAGS for this program + src_pm_gforker_mpiexec_gforker_CPPFLAGS = $(common_pm_includes) $(AM_CPPFLAGS) + endif !PRIMARY_PM_GFORKER diff --git a/SOURCES/0003-soften-version-check.patch b/SOURCES/0003-soften-version-check.patch new file mode 100644 index 00000000..6d75cc6b --- /dev/null +++ b/SOURCES/0003-soften-version-check.patch @@ -0,0 +1,13 @@ +diff --git mpich-3.2/./src/binding/cxx/mpicxx.h.in~ mpich-3.2/./src/binding/cxx/mpicxx.h.in +index 375c081e0e..24f1d6c2cc 100644 +--- mpich-3.2/./src/binding/cxx/mpicxx.h.in~ ++++ mpich-3.2/./src/binding/cxx/mpicxx.h.in +@@ -17,7 +17,7 @@ + // between 3.2.3 and 3.4.3 (!!) Normally such changes + // should only occur at major releases (e.g., version 3 to 4) + #ifdef __GNUC__ +-# if __GNUC__ >= @GNUCXX_VERSION@ ++# if __GNUC__ >= @GNUCXX_VERSION@ && @GNUCXX_VERSION@ == 3 + # if __GNUC_MINOR__ > 2 && @GNUCXX_MINORVERSION@ == 2 + # error 'Please use the same version of GCC and g++ for compiling MPICH and user MPI programs' + # endif diff --git a/SOURCES/0003-unbundle-YAML-Tiny.patch b/SOURCES/0003-unbundle-YAML-Tiny.patch new file mode 100644 index 00000000..0bb66919 --- /dev/null +++ b/SOURCES/0003-unbundle-YAML-Tiny.patch @@ -0,0 +1,48 @@ +From e052dd9f07bdcf9c5ec738d64ee019b8a0b8b183 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Thu, 19 May 2016 18:16:05 +0200 +Subject: [PATCH 3/4] unbundle YAML::Tiny + +Newer YAML::Tiny is stricter, so fix YAML syntax error in bcast.c. +--- + maint/Makefile.mk | 3 --- + src/mpi/coll/bcast.c | 2 +- + 2 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/maint/Makefile.mk b/maint/Makefile.mk +index 83a9572daf..751025969c 100644 +--- a/maint/Makefile.mk ++++ b/maint/Makefile.mk +@@ -28,7 +28,6 @@ dist_noinst_SCRIPTS += \ + maint/extractcvars \ + maint/genstates.in \ + maint/getcoverage.in \ +- maint/local_perl/lib/YAML/Tiny.pm \ + maint/parse.sub \ + maint/parsetest \ + maint/release.pl \ +@@ -43,8 +42,6 @@ dist_noinst_DATA += \ + maint/errmsgdirs \ + maint/cvardirs \ + maint/gccimpgen.cpp \ +- maint/local_perl/README \ +- maint/local_perl/YAML-Tiny-1.41.tar.gz \ + maint/mpi1.lst \ + maint/setup.jpg \ + maint/structalign.c \ +diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c +index 64536a3494..8e55eb5268 100644 +--- a/src/mpi/coll/bcast.c ++++ b/src/mpi/coll/bcast.c +@@ -79,7 +79,7 @@ cvars: + class : device + verbosity : MPI_T_VERBOSITY_USER_BASIC + scope : MPI_T_SCOPE_ALL_EQ +- description : Enable SMP aware broadcast (See also: MPIR_CVAR_MAX_SMP_BCAST_MSG_SIZE) ++ description : "Enable SMP aware broadcast (See also: MPIR_CVAR_MAX_SMP_BCAST_MSG_SIZE)" + + - name : MPIR_CVAR_MAX_SMP_BCAST_MSG_SIZE + category : COLLECTIVE +-- +2.7.4 + diff --git a/SOURCES/0004-unbundle-hwloc-from-hydra.patch b/SOURCES/0004-unbundle-hwloc-from-hydra.patch new file mode 100644 index 00000000..89bba104 --- /dev/null +++ b/SOURCES/0004-unbundle-hwloc-from-hydra.patch @@ -0,0 +1,119 @@ +From c832b1ca5566b79e73e07e794b9724b86ade8fb3 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Thu, 19 May 2016 18:16:05 +0200 +Subject: [PATCH 4/4] unbundle hwloc from hydra + +--- + src/pm/hydra/autogen.sh | 3 -- + src/pm/hydra/configure.ac | 49 ++++++++----------------------- + src/pm/hydra/tools/topo/hwloc/Makefile.mk | 11 ------- + 3 files changed, 13 insertions(+), 50 deletions(-) + +diff --git a/src/pm/hydra/autogen.sh b/src/pm/hydra/autogen.sh +index e13fb9fb10..70429b1c3c 100755 +--- a/src/pm/hydra/autogen.sh ++++ b/src/pm/hydra/autogen.sh +@@ -9,9 +9,6 @@ fi + echo "=== running autoreconf in 'mpl' ===" + (cd mpl && $autoreconf ${autoreconf_args:-"-vif"}) || exit 1 + +-echo "=== running autoreconf in 'tools/topo/hwloc/hwloc' ===" +-(cd tools/topo/hwloc/hwloc && ./autogen.sh) || exit 1 +- + echo "=== running autoreconf in '.' ===" + $autoreconf ${autoreconf_args:-"-vif"} || exit 1 + +diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac +index d994d4bd1a..f7ca3f1845 100644 +--- a/src/pm/hydra/configure.ac ++++ b/src/pm/hydra/configure.ac +@@ -407,44 +407,23 @@ 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]) ++ 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]) ++ ++ # 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]) +@@ -476,9 +455,7 @@ else + AC_DEFINE(HYDRA_DEFAULT_TOPOLIB,NULL,[Default processor topology library]) + 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 --git a/src/pm/hydra/tools/topo/hwloc/Makefile.mk b/src/pm/hydra/tools/topo/hwloc/Makefile.mk +index 441ea1ad13..dc161daa5c 100644 +--- a/src/pm/hydra/tools/topo/hwloc/Makefile.mk ++++ b/src/pm/hydra/tools/topo/hwloc/Makefile.mk +@@ -7,14 +7,3 @@ + libhydra_la_SOURCES += tools/topo/hwloc/topo_hwloc.c + + noinst_HEADERS += tools/topo/hwloc/topo_hwloc.h +- +-if hydra_use_embedded_hwloc +-AM_CPPFLAGS += -I$(top_srcdir)/tools/topo/hwloc/hwloc/include \ +- -I$(top_builddir)/tools/topo/hwloc/hwloc/include +- +-# Append hwloc to the external subdirs, so it gets built first +-external_subdirs += tools/topo/hwloc/hwloc +-external_dist_subdirs += tools/topo/hwloc/hwloc +-external_ldflags += -L$(top_builddir)/tools/topo/hwloc/hwloc/src +-external_libs += -lhwloc_embedded +-endif +-- +2.7.4 + diff --git a/SOURCES/mpich-3.0.4-rh.patch b/SOURCES/mpich-3.0.4-rh.patch new file mode 100644 index 00000000..d786abe8 --- /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.in b/SOURCES/mpich.macros.in new file mode 100644 index 00000000..7232d2fc --- /dev/null +++ b/SOURCES/mpich.macros.in @@ -0,0 +1,7 @@ +%_@MACRONAME@_load \ + . /etc/profile.d/modules.sh; \ + module load mpi/@MODULENAME@; \ + export CFLAGS="$CFLAGS %{optflags}"; +%_@MACRONAME@_unload \ + . /etc/profile.d/modules.sh; \ + module unload mpi/@MODULENAME@; diff --git a/SOURCES/mpich.module.in b/SOURCES/mpich.module.in new file mode 100644 index 00000000..418e4ff2 --- /dev/null +++ b/SOURCES/mpich.module.in @@ -0,0 +1,20 @@ +#%Module 1.0 +# +# MPICH module for use with 'environment-modules' package: +# +conflict mpi +prepend-path PATH @LIBDIR@/bin +prepend-path LD_LIBRARY_PATH @LIBDIR@/lib +prepend-path PYTHONPATH @PYSITEARCH@ +prepend-path MANPATH @MANDIR@ +prepend-path PKG_CONFIG_PATH @LIBDIR@/lib/pkgconfig +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@ diff --git a/SPECS/mpich.spec b/SPECS/mpich.spec new file mode 100644 index 00000000..54d593da --- /dev/null +++ b/SPECS/mpich.spec @@ -0,0 +1,540 @@ +%{!?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.2 +Release: 2%{?dist} +License: MIT +Group: Development/Libraries +URL: http://www.mpich.org + +Source0: http://www.mpich.org/static/downloads/%{version}/%{name}-%{version}.tar.gz +Source1: mpich.macros.in +Source2: mpich.module.in +Patch1: https://trac.mpich.org/projects/mpich/raw-attachment/ticket/2299/0001-pm-remshell-include-MPL-when-linking.patch +Patch2: 0002-pm-gforker-include-MPL-when-linking.patch +Patch3: 0003-soften-version-check.patch +Patch4: 0001-hydra-improve-localhost-detection.patch +Patch5: 0001-Revert-require-automake-1.15.patch +Patch6: 0002-Revert-require-libtool-2.4.3.patch +Patch7: 0003-unbundle-YAML-Tiny.patch +Patch8: 0004-unbundle-hwloc-from-hydra.patch + +# Source100 derived from +# Source100: http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.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 +Source100: mpich-3.0.4-rh.tar.gz +Patch100: mpich-3.0.4-rh.patch + +BuildRequires: libXt-devel, bison, flex, libuuid-devel +BuildRequires: gcc-c++ gcc-gfortran +BuildRequires: hwloc-devel >= 1.5 +BuildRequires: perl, python, perl-Digest-MD5, perl-YAML-Tiny +BuildRequires: automake autoconf libtool gettext +%ifnarch s390 +BuildRequires: valgrind-devel +%endif + +%global common_desc MPICH is a high-performance and widely portable implementation of the Message\ +Passing Interface (MPI) standard (MPI-1, MPI-2 and MPI-3). The goals of MPICH\ +are: (1) to provide an MPI implementation that efficiently supports different\ +computation and communication platforms including commodity clusters (desktop\ +systems, shared-memory systems, multicore architectures), high-speed networks\ +(10 Gigabit Ethernet, InfiniBand, Myrinet, Quadrics) and proprietary high-end\ +computing systems (Blue Gene, Cray) and (2) to enable cutting-edge research in\ +MPI through an easy-to-extend modular framework for other derived\ +implementations.\ +\ +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. + +%description +%{common_desc} + +%package 3.2 +Summary: A high-performance implementation of MPI +Group: Development/Libraries +Obsoletes: mpich2 < 1.5-4 +Obsoletes: mpich-libs < 1.1.1 +Obsoletes: mpich-mpd < 1.4.1 +Obsoletes: mpich < 3.0.4-9 +Provides: mpi +Requires: environment-modules + +%description 3.2 +%{common_desc} + +%package 3.2-autoload +Summary: Load mpich 3.2 automatically into profile +Group: System Environment/Base +Requires: mpich-3.2 = %{version}-%{release} + +%description 3.2-autoload +This package contains profile files that make mpich 3.2 automatically loaded. + +%package 3.2-devel +Summary: Development files for mpich-3.2 +Group: Development/Libraries +Provides: mpi-devel +Obsoletes: mpich-devel < 3.0.4-9 +Requires: mpich-3.2 = %{version}-%{release} +Requires: pkgconfig +Requires: gcc-gfortran + +%description 3.2-devel +Contains development headers and libraries for mpich 3.2. + +%package 3.2-doc +Summary: Documentations and examples for mpich 3.2 +Group: Documentation +BuildArch: noarch +Obsoletes: mpich-doc < 3.0.4-9 +Requires: mpich-3.2-devel = %{version}-%{release} + +%description 3.2-doc +Contains documentations, examples and manpages for mpich 3.2. + +%package 3.0 +Summary: MPICH 3.0.x implementation of MPI +Group: Development/Libraries +Version: 3.0.4 +Release: 10%{?dist} +Obsoletes: mpich2 < 1.5-4 +Obsoletes: mpich-libs < 1.1.1 +Obsoletes: mpich-mpd < 1.4.1 +Obsoletes: mpich < 3.0.4-9 +Provides: mpi +Provides: mpich = %{version}-%{release} +Provides: mpich%{?_isa} = %{version}-%{release} +Requires: environment-modules + +%description 3.0 +%{common_desc} + +This package provides compatibility for applications compiled with MPICH 3.0.4. + +%package 3.0-autoload +Summary: Load mpich 3.0 automatically into profile +Group: System Environment/Base +Version: %{version} +Release: %{release} +Obsoletes: mpich-autoload < 3.0.4-9 +Provides: mpich-autoload = %{version}-%{release} +Requires: mpich-3.0 = %{version}-%{release} + +%description 3.0-autoload +This package contains profile files that make mpich 3.0 automatically loaded. + +%package 3.0-devel +Summary: Development files for mpich-3.0 +Group: Development/Libraries +Version: %{version} +Release: %{release} +Provides: mpi-devel +Obsoletes: mpich-devel < 3.0.4-9 +Provides: mpich-devel = %{version}-%{release} +Requires: mpich-3.0 = %{version}-%{release} +Requires: pkgconfig +Requires: gcc-gfortran + +%description 3.0-devel +Contains development headers and libraries for mpich 3.0. + +%package 3.0-doc +Summary: Documentations and examples for mpich 3.0 +Group: Documentation +Version: %{version} +Release: %{release} +BuildArch: noarch +Obsoletes: mpich-doc < 3.0.4-9 +Provides: mpich-doc = %{version}-%{release} +Requires: mpich-3.0-devel = %{version}-%{release} + +%description 3.0-doc +Contains documentations, examples and manpages for mpich 3.0. + +# 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}} + +%prep +%setup -q -b 100 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 + + # bundled knem module + rm -r contrib/ + # bundled YAML::Tiny + rm -r maint/local_perl/ + # bundled hwloc + rm -r src/pm/hydra/tools/topo/hwloc/hwloc/ + # HTML manpages + rm -r www/ + + ./autogen.sh +cd .. + +cd mpich-3.0.4 +%patch100 -p1 -b .rh + + ./autogen.sh + cd src/pm/hydra && ./autogen.sh && cd ../../.. +cd .. + +%build +cd .. + +%ifarch s390 +%global m_option -m31 +%else +%global m_option -m%{__isa_bits} +%endif + +%ifarch %{arm} aarch64 +%global m_option "" +%endif + +%global selected_channels ch3:nemesis + +%ifarch %{ix86} x86_64 s390 %{arm} aarch64 +%global XFLAGS -fPIC +%endif + +%global variant mpich-3.2 +%global libname %{variant} +%global namearch %{variant}-%{_arch} + +cd mpich-3.2 +%configure \ + --enable-sharedlibs=gcc \ + --enable-shared \ + --enable-static=no \ + --enable-lib-depend \ + --disable-rpath \ + --disable-silent-rules \ + --enable-fc \ + --with-device=%{selected_channels} \ + --with-pm=hydra:gforker \ + --sysconfdir=%{_sysconfdir}/%{namearch} \ + --includedir=%{_includedir}/%{namearch} \ + --bindir=%{_libdir}/%{libname}/bin \ + --libdir=%{_libdir}/%{libname}/lib \ + --datadir=%{_datadir}/%{libname} \ + --mandir=%{_mandir}/%{libname} \ + --docdir=%{_docdir}/%{libname} \ + --with-hwloc-prefix=system \ + FC=%{opt_fc} \ + F77=%{opt_f77} \ + CFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + CXXFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + FCFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + FFLAGS="%{m_option} %{optflags} %{?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}" \ + +# Remove rpath +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +make %{?_smp_mflags} V=1 +cd .. + + +%ifarch s390 +%global m_option -m31 +%else +%global m_option -m%{__isa_bits} +%endif + +%ifarch %{arm} aarch64 +%global m_option "" +%endif + +%ifarch %{ix86} x86_64 +%global selected_channels ch3:nemesis +%else +%global selected_channels ch3:sock +%endif + +%ifarch %{ix86} x86_64 s390 %{arm} +%global XFLAGS -fPIC +%endif + +%global variant mpich +%global libname %{variant} +%global namearch %{variant}-%{_arch} + +cd mpich-3.0.4 +%configure \ + --enable-sharedlibs=gcc \ + --enable-shared \ + --enable-lib-depend \ + --disable-rpath \ + --enable-fc \ + --with-device=%{selected_channels} \ + --with-pm=hydra:gforker \ + --sysconfdir=%{_sysconfdir}/%{namearch} \ + --includedir=%{_includedir}/%{namearch} \ + --bindir=%{_libdir}/%{libname}/bin \ + --libdir=%{_libdir}/%{libname}/lib \ + --datadir=%{_datadir}/%{libname} \ + --mandir=%{_mandir}/%{libname} \ + --docdir=%{_docdir}/%{libname} \ + --with-hwloc-prefix=system \ + FC=%{opt_fc} \ + F77=%{opt_f77} \ + CFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + CXXFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + FCFLAGS="%{m_option} %{optflags} %{?XFLAGS}" \ + FFLAGS="%{m_option} %{optflags} %{?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 V=1 +cd .. + +%install +cd .. + +finish_install() { + local VARIANT="$1" + local LIBNAME="$VARIANT" + local NAMEARCH="$VARIANT-%{_arch}" + + find %{buildroot}%{_libdir}/$LIBNAME/lib -name \*.la -delete + mkdir -p %{buildroot}/%{_fmoddir}/$NAMEARCH + mkdir -p %{buildroot}%{python_sitearch}/$LIBNAME + + # Make the environment-modules file + mkdir -p %{buildroot}%{_sysconfdir}/modulefiles/mpi + sed "s#@LIBDIR@#%{_libdir}/$LIBNAME#g; + s#@ETCDIR@#%{_sysconfdir}/$NAMEARCH#g; + s#@FMODDIR@#%{_fmoddir}/$NAMEARCH#g; + s#@INCDIR@#%{_includedir}/$NAMEARCH#g; + s#@MANDIR@#%{_mandir}/$LIBNAME#g; + s#@PYSITEARCH@#%{python_sitearch}/$LIBNAME#g; + s#@COMPILER@#$NAMEARCH#g; + s#@SUFFIX@#_$LIBNAME#g" \ + < %SOURCE2 \ + > %{buildroot}%{_sysconfdir}/modulefiles/mpi/$NAMEARCH + + # Make the profile script for autoload + mkdir -p %{buildroot}%{_sysconfdir}/profile.d + cat << EOF > %{buildroot}%{_sysconfdir}/profile.d/$NAMEARCH.sh +# Load mpich environment module +module load mpi/$NAMEARCH +EOF + cp -p %{buildroot}%{_sysconfdir}/profile.d/$NAMEARCH.{sh,csh} + + # Make the rpm macro file + mkdir -p %{buildroot}/%{_sysconfdir}/rpm + # do not expand _arch + sed "s#@MACRONAME@#${LIBNAME//[-.]/_}#g; + s#@MODULENAME@#$VARIANT-%%{_arch}#" \ + < %SOURCE1 \ + > %{buildroot}/%{_sysconfdir}/rpm/macros.$LIBNAME +} + +cd mpich-3.2 +%make_install +cd .. +finish_install mpich-3.2 + +cd mpich-3.0.4 +%make_install +cd .. +finish_install mpich +rm -f %{buildroot}%{_libdir}/mpich/lib/lib{*mpich*,opa,mpl}.a +ln -s mpich-%{_arch} %{buildroot}%{_sysconfdir}/modulefiles/mpi/mpich-3.0-%{_arch} +ln -s mpich-%{_arch} %{buildroot}%{_sysconfdir}/mpich-3.0-%{_arch} +# Silence rpmlint +sed -i '/^#! \//,1 d' %{buildroot}%{_sysconfdir}/mpich-%{_arch}/mpi*.conf + +%global variant mpich-3.2 +%global libname %{variant} +%global namearch %{variant}-%{_arch} + +%files 3.2 +%defattr(-,root,root,-) +%doc CHANGES COPYRIGHT README RELEASE_NOTES +%dir %{_libdir}/%{libname} +%dir %{_libdir}/%{libname}/lib +%dir %{_libdir}/%{libname}/bin +%{_libdir}/%{libname}/lib/*.so.* +%{_libdir}/%{libname}/bin/hydra* +%{_libdir}/%{libname}/bin/mpichversion +%{_libdir}/%{libname}/bin/mpiexec* +%{_libdir}/%{libname}/bin/mpirun +%{_libdir}/%{libname}/bin/mpivars +%dir %{python_sitearch}/%{libname} +%dir %{_fmoddir}/%{namearch} +%{_libdir}/%{libname}/bin/parkill +%dir %{_mandir}/%{libname} +%dir %{_mandir}/%{libname}/man1 +%{_mandir}/%{libname}/man1/mpiexec* +%{_mandir}/%{libname}/man1/hydra* +%dir %{_sysconfdir}/modulefiles/mpi +%{_sysconfdir}/modulefiles/mpi/%{namearch} + +%files 3.2-autoload +%defattr(-,root,root,-) +%{_sysconfdir}/profile.d/%{namearch}.* + +%files 3.2-devel +%defattr(-,root,root,-) +%{_libdir}/%{libname}/bin/mpicc +%{_libdir}/%{libname}/bin/mpicxx +%{_libdir}/%{libname}/bin/mpic++ +%{_libdir}/%{libname}/bin/mpif* +%{_mandir}/%{libname}/man1/mpic* +%{_mandir}/%{libname}/man1/mpif* +%{_includedir}/%{namearch}/ +%{_libdir}/%{libname}/lib/*.so +%{_libdir}/%{libname}/lib/pkgconfig/ +%config %{_sysconfdir}/rpm/macros.%{libname} + +%files 3.2-doc +%defattr(-,root,root,-) +%{_docdir}/%{libname} +%{_mandir}/%{libname}/man3/ + +%global variant mpich +%global libname %{variant} +%global namearch %{variant}-%{_arch} + +%files 3.0 +%defattr(-,root,root,-) +%doc COPYRIGHT +%dir %{_libdir}/%{libname} +%dir %{_libdir}/%{libname}/lib +%dir %{_libdir}/%{libname}/bin +%{_libdir}/%{libname}/lib/*.so.* +%{_libdir}/%{libname}/bin/hydra* +%{_libdir}/%{libname}/bin/mpichversion +%{_libdir}/%{libname}/bin/mpiexec* +%{_libdir}/%{libname}/bin/mpirun +%dir %{python_sitearch}/%{libname} +%dir %{_fmoddir}/%{namearch} +%{_libdir}/%{libname}/bin/parkill +%dir %{_mandir}/%{libname} +%dir %{_mandir}/%{libname}/man1 +%{_mandir}/%{libname}/man1/mpiexec* +%dir %{_sysconfdir}/modulefiles/mpi +%{_sysconfdir}/modulefiles/mpi/%{namearch} +%{_sysconfdir}/modulefiles/mpi/mpich-3.0-%{_arch} + +%files 3.0-autoload +%defattr(-,root,root,-) +%{_sysconfdir}/profile.d/%{namearch}.* + +%files 3.0-devel +%defattr(-,root,root,-) +%{_libdir}/%{libname}/bin/mpicc +%{_libdir}/%{libname}/bin/mpicxx +%{_libdir}/%{libname}/bin/mpic++ +%{_libdir}/%{libname}/bin/mpif* +%{_mandir}/%{libname}/man1/mpic* +%{_mandir}/%{libname}/man1/mpif* +%config %{_sysconfdir}/%{namearch}/ +%{_sysconfdir}/mpich-3.0-%{_arch} +%{_includedir}/%{namearch}/ +%{_libdir}/%{libname}/lib/*.so +%{_libdir}/%{libname}/lib/pkgconfig/ +%config %{_sysconfdir}/rpm/macros.%{libname} + +%files 3.0-doc +%defattr(-,root,root,-) +%{_docdir}/%{libname} +%{_mandir}/%{libname}/man3/ + +%changelog +* Fri Jul 29 2016 Michal Schmidt - 3.2-2 +- Remove bad rpath in two binaries in mpich-3.2. +- Restore trimming of shebang lines in config files in mpich-3.0-devel. +- Related: rhbz1091532 + +* Wed Jun 22 2016 Michal Schmidt - 3.2-1 +- Update to upstream version mpich-3.2 with patches from Fedora. +- Keep 3.0.4 as 'mpich-3.0' for backwards compatibility. +- Resolves: rhbz1091532 +- Resolves: rhbz1142117 +- Resolves: rhbz1148992 + +* Wed Sep 10 2014 Yaakov Selkowitz - 3.0.4-8 +- Do not use -m64 on AArch64 + Resolves: rhbz1077315 + +* Mon Mar 3 2014 Jay Fenlason - 3.0.4-7 +- Update build flags to fix + Resolves: rhbz1070778 + +* Fri Jan 24 2014 Daniel Mach - 3.0.4-6 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 3.0.4-5 +- Mass rebuild 2013-12-27 + +* 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. +