summaryrefslogtreecommitdiffstats
path: root/config/mpich
blob: 1ba62ff38e046ba3e29f3fdbcb849563be7cfef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#							-*- shell-script -*-
#
# Copyright by The HDF Group.
# 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://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.

# 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.

# mpich2 do not support it correctly.  But mpich2 reports small version number
# indistiguishable from mpich.  Some mpich2 reports blank, some reports 1.0.2.

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'
		;;
	    1.0.2)
		# mpich2 is recycling the version number, some report
		# 1.0.2, some report blank.
		hdf5_mpi_complex_derived_datatype_works='no'
		;;
	    "")
		# got blank ccversion.  Assume it is bad a mpich2.
		hdf5_mpi_complex_derived_datatype_works='no'
		;;
	    *)
		# assume okay
		;;
	esac
    fi
fi

if [ -z "$hdf5_mpi_special_collective_io_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-6]*)
		hdf5_mpi_special_collective_io_works='no'
		;;
	    1.0.2)
		# mpich2 is recycling the version number, some report
		# 1.0.2, some report blank.
		hdf5_mpi_special_collective_io_works='no'
		;;
	    "")
		# got blank ccversion.  Assume it is bad a mpich2.
		hdf5_mpi_special_collective_io_works='no'
		;;
	    *)
		# assume okay
		;;
	esac
    fi
fi