From 91715368236e3516f89f2fbdd85cfb21e76263c6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 26 Oct 2005 15:44:19 -0500 Subject: [svn-r11610] Purpose: Bug fix. Description: The previous way of detecting the MPICH version fails if the suspected $CC does not give the expected MPICH version information. Though no consequence, it generates error messages that alarm users. Also, mpich2 gives the version information as if it were mpich v1.0.2 which was incorrectly included as an earlier version of the origianl mpich. Solution: Implemented a more robust code to detect the version and narrow the recognition down to v1.2.0-v1.2.5. Also, the code were duplicated in two files (linux-gnulibc1 and ia64-linux-gnu). Combined them into a new file called mpich. Platforms tested: Tested in heping using mpicc and mpich2/mpicc and also in tg-ncsa. Misc. update: Updated MANIFEST. --- MANIFEST | 1 + config/ia64-linux-gnu | 17 ++--------------- config/linux-gnulibc1 | 18 ++---------------- config/mpich | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 config/mpich diff --git a/MANIFEST b/MANIFEST index cfba760..0829cd0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -91,6 +91,7 @@ ./config/linux-gnulibc1 ./config/linux-gnulibc2 ./config/lt_vers.am +./config/mpich ./config/nec-superux14.1 ./config/nv1-cray ./config/Makefile.am.blank diff --git a/config/ia64-linux-gnu b/config/ia64-linux-gnu index 28e4ff3..542f4cf 100644 --- a/config/ia64-linux-gnu +++ b/config/ia64-linux-gnu @@ -126,19 +126,6 @@ case $CXX_BASENAME in PROFILE_CPPFLAGS= ;; esac -# We know that for mpich 1.2.5 and previous version, complicated derived datatype is -# supported, we need to set the macro to hdf5_mpi_complex_derived_datatype_works to no. -# Notice that this fix will only work if the compiler name is mpicc and mpi package is -# mpich 1.x.x. -if [ -z "$hdf5_mpi_complex_derived_datatype_works" -a $CC_BASENAME = mpicc ]; then - ccversion=`$CC -v 2>&1 | sed -e 's/.*for //p'` - ccversion1=`echo $ccversion | cut -f1 -d.` - ccversion2=`echo $ccversion | cut -f2 -d.` - ccversiontemp=`echo $ccversion | cut -f3 -d.` - ccversion3=`echo $ccversiontemp | cut -c1` - ccversionval=`expr $ccversion1 \* 100 + $ccversion2 \* 10 + $ccversion3` - if [ $ccversionval -lt 126 ]; then - hdf5_mpi_complex_derived_datatype_works='no' - fi -fi +# Check MPICH settings +. $srcdir/config/mpich diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 719b915..11c51f7 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -109,19 +109,5 @@ if test -z "$CXX"; then CXX_BASENAME=g++ fi -# We know that for mpich 1.2.5 and previous version, complicated derived datatype is -# supported, we need to set the macro to hdf5_mpi_complex_derived_datatype_works to no. -# Notice that this fix will only work if the compiler name is mpicc and mpi package is -# mpich 1.x.x. - -if [ -z "$hdf5_mpi_complex_derived_datatype_works" -a \( $CC_BASENAME = mpicc -o $CC_BASENAME = mpiicc \) ]; then - ccversion=`$CC -v 2>&1 | sed -e 's/.*for //p'` - ccversion1=`echo $ccversion | cut -f1 -d.` - ccversion2=`echo $ccversion | cut -f2 -d.` - ccversiontemp=`echo $ccversion | cut -f3 -d.` - ccversion3=`echo $ccversiontemp | cut -c1` - ccversionval=`expr $ccversion1 \* 100 + $ccversion2 \* 10 + $ccversion3` - if [ $ccversionval -lt 126 ]; then - hdf5_mpi_complex_derived_datatype_works='no' - fi -fi +# Check MPICH settings +. $srcdir/config/mpich diff --git a/config/mpich b/config/mpich new file mode 100644 index 0000000..3e63e56 --- /dev/null +++ b/config/mpich @@ -0,0 +1,42 @@ +# -*- shell-script -*- +# +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. + +# This file should be sourced into configure if the compiler is the +# MPICH compiler script. It is careful not to do anything if the compiler +# is not MPICH. + +# Check if mpicc can support complicated derived datatype correctly. +# We know that mpich 1.2.4 and 1.2.5 do not support it correctly. We assume +# older versions do not work either. We don't know of a way of testing its +# correctness without the risk of hanging the configure process. So, we +# set the configure variable hdf5_mpi_complex_derived_datatype_works to no. +# Notice that this code works only if the mpicc compiler shows its $MPIVERSION +# properly. It is confirmed mpicc does that as far back as v1.2.3. + +if [ -z "$hdf5_mpi_complex_derived_datatype_works" ]; then + ccversion=`$CC -v 2>/dev/null` + # mpich compiler will give "mpicc for 1.2.x ..." + if echo "$ccversion" | grep '^mpicc for' > /dev/null ; then + # $CC is an MPICH compiler. Grab the version numbers. + ccversion=`echo $ccversion | cut -f3 -d' '` + case "$ccversion" in + 1.2.[0-5]*) + hdf5_mpi_complex_derived_datatype_works='no' + ;; + *) + # assume okay + ;; + esac + fi +fi -- cgit v0.12