diff --git a/.gitignore b/.gitignore index 2743583..9f6606b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/mpich-3.0.4-rh.tar.gz +SOURCES/mpich-3.2.tar.gz diff --git a/.mpich.metadata b/.mpich.metadata index 47dc177..bfe99f2 100644 --- a/.mpich.metadata +++ b/.mpich.metadata @@ -1 +1,2 @@ c86b71e38ff3ebb50b411166d0aafd1f988c8edd SOURCES/mpich-3.0.4-rh.tar.gz +5fae7df02f750b6966837b554f9985a9c574236f SOURCES/mpich-3.2.tar.gz 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 0000000..e10c38b --- /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 0000000..c200c48 --- /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 0000000..2cd912f --- /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 0000000..d7ca01d --- /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 0000000..6d75cc6 --- /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 0000000..0bb6691 --- /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 0000000..89bba10 --- /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-module.patch b/SOURCES/mpich-3.0.4-module.patch deleted file mode 100644 index 5aba59e..0000000 --- a/SOURCES/mpich-3.0.4-module.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- 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.macros b/SOURCES/mpich.macros deleted file mode 100644 index 85443f4..0000000 --- a/SOURCES/mpich.macros +++ /dev/null @@ -1,7 +0,0 @@ -%_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/SOURCES/mpich.macros.in b/SOURCES/mpich.macros.in new file mode 100644 index 0000000..7232d2f --- /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 0000000..418e4ff --- /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 index 191710d..54d593d 100644 --- a/SPECS/mpich.spec +++ b/SPECS/mpich.spec @@ -2,14 +2,26 @@ Summary: A high-performance implementation of MPI Name: mpich -Version: 3.0.4 -Release: 8%{?dist} +Version: 3.2 +Release: 2%{?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 +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* @@ -26,73 +38,137 @@ URL: http://www.mpich.org # 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 +Source100: mpich-3.0.4-rh.tar.gz +Patch100: mpich-3.0.4-rh.patch BuildRequires: libXt-devel, bison, flex, libuuid-devel -BuildRequires: gcc-gfortran +BuildRequires: gcc-c++ gcc-gfortran BuildRequires: hwloc-devel >= 1.5 -BuildRequires: perl, python, perl-Digest-MD5, hwloc-devel +BuildRequires: perl, python, perl-Digest-MD5, perl-YAML-Tiny BuildRequires: automake autoconf libtool gettext -%ifnarch s390 s390x %{arm} +%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 -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. +%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 -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. +%description 3.0 +%{common_desc} -%package autoload -Summary: Load mpich automatically into profile +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 -Requires: mpich = %{version}-%{release} +Version: %{version} +Release: %{release} +Obsoletes: mpich-autoload < 3.0.4-9 +Provides: mpich-autoload = %{version}-%{release} +Requires: mpich-3.0 = %{version}-%{release} -%description autoload -This package contains profile files that make mpich automatically loaded. +%description 3.0-autoload +This package contains profile files that make mpich 3.0 automatically loaded. -%package devel -Summary: Development files for mpich +%package 3.0-devel +Summary: Development files for mpich-3.0 Group: Development/Libraries -Provides: %{name}-devel-static = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +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 -Requires(pre): chkconfig -#Requires chkconfig for /usr/sbin/alternatives -%description devel -Contains development headers and libraries for mpich +%description 3.0-devel +Contains development headers and libraries for mpich 3.0. -%package doc -Summary: Documentations and examples for mpich +%package 3.0-doc +Summary: Documentations and examples for mpich 3.0 Group: Documentation +Version: %{version} +Release: %{release} BuildArch: noarch -Requires: %{name}-devel = %{version}-%{release} +Obsoletes: mpich-doc < 3.0.4-9 +Provides: mpich-doc = %{version}-%{release} +Requires: mpich-3.0-devel = %{version}-%{release} -%description doc -Contains documentations, examples and manpages for mpich +%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. @@ -106,6 +182,39 @@ Contains documentations, examples and manpages for mpich #%{!?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 @@ -116,31 +225,88 @@ Contains documentations, examples and manpages for mpich %global m_option "" %endif -%ifarch %{ix86} x86_64 %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 selected_channels ch3:sock +%global m_option -m%{__isa_bits} %endif -%ifarch x86_64 ia64 ppc64 s390x sparc64 -%global priority 41 +%ifarch %{arm} aarch64 +%global m_option "" +%endif + +%ifarch %{ix86} x86_64 +%global selected_channels ch3:nemesis %else -%global priority 40 +%global selected_channels ch3:sock %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 ../../.. +%global variant mpich +%global libname %{variant} +%global namearch %{variant}-%{_arch} -%build +cd mpich-3.0.4 %configure \ --enable-sharedlibs=gcc \ --enable-shared \ @@ -149,21 +315,20 @@ cd src/pm/hydra && ./autogen.sh && cd ../../.. --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 \ + --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}" \ + 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}" \ @@ -178,116 +343,176 @@ cd src/pm/hydra && ./autogen.sh && cd ../../.. # FCFLAGS="%{?opt_fc_fflags} -I%{_fmoddir}/%{name} %{?XFLAGS}" \ #make %{?_smp_mflags} doesn't work -make VERBOSE=1 +make V=1 +cd .. %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 +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/%{name}-%{_arch} +module load mpi/$NAMEARCH 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} - + 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}/%{name}-%{_arch}/mpi*.conf - -# The uninstall script here is not needed/necesary for rpm packaging -rm -rf %{buildroot}%{_sbindir}/mpe* +sed -i '/^#! \//,1 d' %{buildroot}%{_sysconfdir}/mpich-%{_arch}/mpi*.conf -find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' -rm -f %{buildroot}%{_libdir}/%{name}/lib/lib{*mpich*,opa,mpl}.a +%global variant mpich-3.2 +%global libname %{variant} +%global namearch %{variant}-%{_arch} -%post -/sbin/ldconfig +%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} -%postun -/sbin/ldconfig +%files 3.2-autoload +%defattr(-,root,root,-) +%{_sysconfdir}/profile.d/%{namearch}.* -%pre -if [ $1 -gt 1 ] ; then - if [ -e %{_bindir}/mpiexec.py ] ; then - /usr/sbin/alternatives --remove mpi-run %{_bindir}/mpiexec.py - fi -fi +%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/ -%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 +%global variant mpich +%global libname %{variant} +%global namearch %{variant}-%{_arch} -%files +%files 3.0 %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* +%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/%{name}-%{_arch} +%{_sysconfdir}/modulefiles/mpi/%{namearch} +%{_sysconfdir}/modulefiles/mpi/mpich-3.0-%{_arch} -%files autoload +%files 3.0-autoload %defattr(-,root,root,-) -%{_sysconfdir}/profile.d/mpich-%{_arch}.* +%{_sysconfdir}/profile.d/%{namearch}.* -%files devel +%files 3.0-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 +%{_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,-) -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/doc/ -%{_mandir}/%{name}/man3/ +%{_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