Feature #1983: Made CmiWallTimer monotonic in the common case
[charm.git] / src / libs / ck-libs / ampi / romio / aclocal.m4
blobb2d640120a29947ccb93dadeee42600892bf512f
1 dnl
2 dnl This files contains additional macros for using autoconf to 
3 dnl build configure scripts.
4 dnl
5 dnl Almost all of this file is taken from the aclocal.m4 of MPICH
6 dnl
7 dnl Get the format of Fortran names.  Uses F77, FFLAGS, and sets WDEF.
8 dnl If the test fails, sets NOF77 to 1, HAVE_FORTRAN to 0.
9 dnl
10 dnl
11 define(PAC_GET_FORTNAMES,[
12    rm -f confftest.f confftest.o
13    cat > confftest.f <<EOF
14        subroutine mpir_init_fop( a )
15        integer a
16        a = 1
17        return
18        end
19 EOF
20    $F77 $FFLAGS -c confftest.f > /dev/null 2>&1
21    if test ! -s confftest.o ; then
22         print_error "Unable to test Fortran compiler"
23         print_error "(compiling a test program failed to produce an "
24         print_error "object file)."
25         NOF77=1
26    elif test -z "$FORTRANNAMES" ; then
27     if test $arch_CRAY ; then
28      # Cray doesn't accept -a ...
29      nameform1=`strings confftest.o | grep mpir_init_fop_  | head -1`
30      nameform2=`strings confftest.o | grep MPIR_INIT_FOP   | head -1`
31      nameform3=`strings confftest.o | grep mpir_init_fop   | head -1`
32      nameform4=`strings confftest.o | grep mpir_init_fop__ | head -1`
33     else
34      nameform1=`strings -a confftest.o | grep mpir_init_fop_  | head -1`
35      nameform2=`strings -a confftest.o | grep MPIR_INIT_FOP   | head -1`
36      nameform3=`strings -a confftest.o | grep mpir_init_fop   | head -1`
37      nameform4=`strings -a confftest.o | grep mpir_init_fop__ | head -1`
38     fi
39     rm -f confftest.f confftest.o
40     if test -n "$nameform4" ; then
41         echo "Fortran externals are lower case and have two trailing underscores"
42         FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
43     elif test -n "$nameform1" ; then
44         # We don't set this in CFLAGS; it is a default case
45         echo "Fortran externals have a trailing underscore and are lowercase"
46         FORTRANNAMES="FORTRANUNDERSCORE"
47     elif test -n "$nameform2" ; then
48         echo "Fortran externals are uppercase"     
49         FORTRANNAMES="FORTRANCAPS" 
50     elif test -n "$nameform3" ; then
51         echo "Fortran externals are lower case"
52         FORTRANNAMES="FORTRANNOUNDERSCORE"
53     else
54         print_error "Unable to determine the form of Fortran external names"
55         print_error "Make sure that the compiler $F77 can be run on this system"
56         print_error "Turning off Fortran (-nof77 being assumed)."
57         NOF77=1
58     fi
59     fi
60     if test -n "$FORTRANNAMES" ; then
61         WDEF="-D$FORTRANNAMES"
62     fi
63     ])dnl
64 dnl
65 dnl
66 dnl
67 dnl PAC_GETWD(varname [, filename ] )
68 dnl
69 dnl This is from the aclocal.m4 of MPICH. 
70 dnl Set varname to current directory.  Use filename (relative to current
71 dnl directory) if provided to double check.
72 dnl
73 dnl Need a way to use "automounter fix" for this.
74 dnl
75 define(PAC_GETWD,[
76 $1=$PWD
77 if test "${$1}" != "" -a -d "${$1}" ; then 
78     if test -r ${$1}/.foo$$ ; then
79         /bin/rm -f ${$1}/.foo$$
80         /bin/rm -f .foo$$
81     fi
82     if test -r ${$1}/.foo$$ -o -r .foo$$ ; then
83         $1=
84     else
85         echo "test" > ${$1}/.foo$$
86         if test ! -r .foo$$ ; then
87             /bin/rm -f ${$1}/.foo$$
88             $1=
89         else
90             /bin/rm -f ${$1}/.foo$$
91         fi
92     fi
94 if test "${$1}" = "" ; then
95     $1=`pwd | sed -e 's%/tmp_mnt/%/%g'`
97 dnl
98 dnl First, test the PWD is sensible
99 ifelse($2,,,
100 if test ! -r ${$1}/$2 ; then
101     dnl PWD must be messed up
102     $1=`pwd`
103     if test ! -r ${$1}/$2 ; then
104         print_error "Cannot determine the root directory!" 
105         exit 1
106     fi
107     $1=`pwd | sed -e 's%/tmp_mnt/%/%g'`
108     if test ! -d ${$1} ; then 
109         print_error "Warning: your default path uses the automounter; this may"
110         print_error "cause some problems if you use other NFS-connected systems.
112         $1=`pwd`
113     fi
115 if test -z "${$1}" ; then
116     $1=`pwd | sed -e 's%/tmp_mnt/%/%g'`
117     if test ! -d ${$1} ; then 
118         print_error "Warning: your default path uses the automounter; this may"
119         print_error "cause some problems if you use other NFS-connected systems.
121         $1=`pwd`
122     fi
127 dnl PAC_GET_TYPE_SIZE(typename,var_for_size)
129 dnl sets var_for_size to the size.  Ignores if the size cannot be determined
130 dnl (see aclocal.m4 in MPICH)
132 define(PAC_GET_TYPE_SIZE,
133 [Pac_name="$1"
134  Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
135 eval Pac_testval=\$"${Pac_varname}_len"
136 if test -z "$Pac_testval" ; then
137    changequote(<<,>>)
138    define(<<AC_TYPE_NAME>>,translit(CROSS_SIZEOF_$1,[a-z *],[A-Z_P]))dnl
139    changequote([,])
140    eval Pac_testval=\$"AC_TYPE_NAME"
142 if test -n "$Pac_testval" ; then
143     Pac_CV_NAME=$Pac_testval
144 else
145 AC_MSG_CHECKING([for size of $1])
146 dnl Check for existing size or for CROSS_SIZEOF_name
147 /bin/rm -f conftestval
148 AC_TEST_PROGRAM([#include <stdio.h>
149 main() { 
150   FILE *f=fopen("conftestval","w");
151   if (!f) exit(1);
152   fprintf( f, "%d\n", sizeof($1));
153   exit(0);
154 }],Pac_CV_NAME=`cat conftestval`,Pac_CV_NAME="")
155 /bin/rm -f conftestval
156 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
157     AC_MSG_RESULT($Pac_CV_NAME)
158     eval ${Pac_varname}_len=$Pac_CV_NAME
159 else
160     AC_MSG_RESULT(unavailable)
163 $2=$Pac_CV_NAME
164 ])dnl
168 define(PAC_INT_LT_POINTER,[
169 if test -z "$intsize" ; then
170     PAC_GET_TYPE_SIZE(int,intsize)
172 if test -z "$pointersize" ; then
173     PAC_GET_TYPE_SIZE(void *,pointersize)
175 AC_MSG_CHECKING([for int large enough for pointers])
176 if test -n "$pointersize" -a -n "$intsize" ; then
177     if test $pointersize -le $intsize ; then
178        AC_MSG_RESULT(yes)
179     else
180        AC_DEFINE(INT_LT_POINTER,,[Define if int smaller than pointer])
181        AC_MSG_RESULT(no)
182     fi
183 else
184     AC_MSG_RESULT(cannot determine; assuming it is;)
185     echo "use '-intsize' and '-ptrsize' to indicate otherwise"
187 ])dnl
190 dnl Check whether to use -n, \c, or newline-tab to separate
191 dnl checking messages from result messages.
192 dnl from MPICH
193 define(AC_PROG_ECHO_N,
194 ac_echo_n=yes
195 [if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
196   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
197     ac_n= ac_c='
198 ' ac_t='        '
199   else
200     ac_n=-n ac_c= ac_t=
201   fi
202 else
203   ac_n= ac_c='\c' ac_t=
205 ac_echo_test=`echo foo 1>&1`
206 if test -z "$ac_echo_test" ; then
207      print_error "Your sh shell does not handle the output redirection"
208      print_error "1>&1 correctly.  Configure will work around this problem,"
209      print_error "but you should report the problem to your vendor."
211 ])dnl
212 dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
213 define(AC_FD_MSG,1)dnl
214 define(AC_MSG_CHECKING,[dnl
215 if test -z "$ac_echo_n" ; then
216 AC_PROG_ECHO_N
218 if test -z "$ac_echo_test" -a AC_FD_MSG = 1 ; then
219 echo $ac_n "checking $1""... $ac_c"
220 else
221 echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG
222 fi])dnl
224 dnl AC_MSG(msg)
225 dnl generates "msg..." (no newline)
226 define(AC_MSG,[dnl
227 if test -z "$ac_echo_n" ; then
228 AC_PROG_ECHO_N
230 if test -z "$ac_echo_test" -a AC_FD_MSG = 1 ; then
231 echo $ac_n "$1""... $ac_c"
232 else
233 echo $ac_n "$1""... $ac_c" 1>&AC_FD_MSG
234 fi])dnl
236 dnl AC_CHECKING(FEATURE-DESCRIPTION)
237 define(AC_CHECKING,dnl
238 [echo "checking $1" 1>&AC_FD_MSG])dnl
240 dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
241 define(AC_MSG_RESULT,dnl
242 if test -z "$ac_echo_test" -a AC_FD_MSG = 1 ; then
243 [echo "$ac_t""$1"]
244 else
245 [echo "$ac_t""$1" 1>&AC_FD_MSG]
246 fi)dnl
248 define(PAC_GET_SPECIAL_SYSTEM_INFO,[
250 if test -n "$arch_IRIX"; then
251    AC_MSG_CHECKING(for IRIX OS version)
252    dnl This block of code replaces a generic "IRIX" arch value with
253    dnl  IRIX_<version>_<chip>
254    dnl  For example
255    dnl  IRIX_5_4400 (IRIX 5.x, using MIPS 4400)
256    osversion=`uname -r | sed 's/\..*//'`
257    dnl Note that we need to allow brackets here, so we briefly turn off 
258    dnl the macro quotes
259    changequote(,)dnl
260    dnl Get the second field (looking for 6.1)
261    osvminor=`uname -r | sed 's/[0-9]\.\([0-9]*\)\..*/\1/'`
262    AC_MSG_RESULT($osversion)
263    dnl Get SGI processor count by quick hack
264    AC_MSG_CHECKING(for IRIX cpucount)
265    cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
266    if test "$cpucount" = "" ; then
267      cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
268    fi
269    changequote([,])dnl
270    if test "$cpucount" = "" ; then
271      print_error "Could not determine cpucount."
272      print_error "Please send "
273      hinv
274      print_error "to romio-maint@mcs.anl.gov"
275      exit 1
276    fi
277    AC_MSG_RESULT($cpucount)
278    dnl
279    AC_MSG_CHECKING(for IRIX cpumodel)
280    dnl The tail -1 is necessary for multiple processor SGI boxes
281    dnl We might use this to detect SGI multiprocessors and recommend
282    dnl -comm=shared
283    cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '`
284    if test -z "$cputype" ; then
285         print_error "Could not get cputype from hinv -t cpu command."
286         print_error "Please send "
287         hinv -t cpu 2>&1
288         hinv -t cpu | cut -f 3 -d' ' 2>&1
289         print_error "to romio-maint@mcs.anl.gov" 
290         exit 1
291    fi
292    AC_MSG_RESULT($cputype)
293    dnl echo "checking for osversion and cputype"
294    dnl cputype may contain R4400, R2000A/R3000, or something else.  
295    dnl We may eventually need to look at it.
296    if test -z "$osversion" ; then
297         print_error "Could not determine OS version.  Please send" 
298         print_error " " 
299         uname -a
300         print_error "to romio-maint@mcs.anl.gov" 
301         exit 1
302    elif test $osversion = 4 ; then
303         true
304    elif test $osversion = 5 ; then
305         true
306    elif test $osversion = 6 ; then
307         true
308    else 
309        print_error "Could not recognize the version of IRIX (got $osversion)"
310        print_error "ROMIO knows about versions 4, 5 and 6; the version being"
311        print_error "returned from uname -r is $osversion."
312        print_error "Please send"
313        uname -a 2>&1
314        hinv 2>&1
315        print_error "to romio-maint@mcs.anl.gov"
316        exit 1
317    fi
318    AC_MSG_CHECKING(for cputype)
319    OLD_ARCH=IRIX
320    IRIXARCH="$ARCH_$osversion"
321    dnl Now, handle the chip set
322    changequote(,)dnl
323    cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"`
324    changequote([,])dnl
325    case $cputype in 
326         3000) ;;
327         4000) ;;
328         4400) ;;
329         4600) ;;
330         5000) ;;
331         8000) ;;
332         10000);;
333         12000);;
334         *)
335         print_error "Unexpected IRIX/MIPS chipset $cputype.  Please send the output"
336         print_error " "
337         uname -a 2>&1
338         hinv 2>&1 
339         print_error " " 
340         print_error "to romio-maint@mcs.anl.gov" 
341         print_error "ROMIO will continue and assume that the cputype is"
342         print_error "compatible with a MIPS 4400 processor."
343         print_error " " 
344         cputype=4400
345         ;;
346    esac
347    AC_MSG_RESULT($cputype)
348    IRIXARCH="$IRIXARCH_$cputype"
349    echo "IRIX-specific architecture is $IRIXARCH"
351 ])dnl
354 dnl On an SGI check whether to link 32 bit objects or 64 bit objects
355 dnl for the MPI-2 datatype accessor functions
357 define(PAC_CHECK_SGI_3264,[
358 AC_MSG_CHECKING(for 32-bit or 64-bit objects)
359 cat <<EOF >bittest.c
360 main()
362   int i;
363   i = 0;
366 $CC $CFLAGS -c bittest.c > /dev/null 2>&1
367 if test $MIPS = 4 ; then
368     testlink='$CC $CFLAGS -o bittest bittest.o adio/sgi/mpi2/mips4.64/get_contents.o $MPI_LIB >/dev/null 2>&1'
369     if eval $testlink ; then
370        BITS=64
371     else
372         testlink='$CC $CFLAGS -o bittest bittest.o adio/sgi/mpi2/mips4.32/get_contents.o $MPI_LIB >/dev/null 2>&1'
373         if eval $testlink ; then
374            BITS=32
375         else
376             echo "Error: Can't link with either 32-bit or 64-bit"
377             echo "Send email to romio-maint@mcs.anl.gov"
378             exit 1
379         fi
380     fi
381 else
382     testlink='$CC $CFLAGS -o bittest bittest.o adio/sgi/mpi2/mips3.64/get_contents.o $MPI_LIB >/dev/null 2>&1'
383     if eval $testlink ; then
384        BITS=64
385     else
386         testlink='$CC $CFLAGS -o bittest bittest.o adio/sgi/mpi2/mips3.32/get_contents.o $MPI_LIB >/dev/null 2>&1'
387         if eval $testlink ; then
388            BITS=32
389         else
390             echo "Error: Can't link with either 32-bit or 64-bit"
391             echo "Send email to romio-maint@mcs.anl.gov"
392             exit 1
393         fi
394     fi
396 rm -f bittest*
397 AC_MSG_RESULT($BITS bit)
402 define(PAC_TEST_MPI,[
403   AC_MSG_CHECKING(if a simple MPI program compiles and links)
404   rm -f mpitest.c
405   cat > mpitest.c <<EOF
406 #include "mpi.h"
407      int main(int argc, char **argv)
408      {
409          MPI_Init(&argc,&argv);
410          MPI_Finalize(); 
411      }
413   rm -f conftest
414   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
415   if test ! -x conftest ; then
416       echo " "
417       print_error "Unable to compile a simple MPI program"
418       print_error "Use the -mpi, -mpiincdir, and -mpilib options to configure to specify the"
419       print_error "MPI implementation, the include path for mpi.h, and the MPI library to link"
420       rm -f conftest mpitest.c
421       exit 1
422   else
423       rm -f conftest mpitest.c
424   fi
425 AC_MSG_RESULT(yes)
426 ])dnl
430 define(PAC_NEEDS_FINT,[
431   AC_MSG_CHECKING(if MPI_Fint is defined in the MPI implementation)
432   cat > mpitest1.c <<EOF
433 #include "mpi.h"
434      main()
435      {
436          MPI_Fint i;
437          i = 0;
438      }
440   rm -f mpitest1.o
441   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -c mpitest1.c > /dev/null 2>&1
442   if test ! -s mpitest1.o ; then
443       NEEDS_MPI_FINT="#define NEEDS_MPI_FINT"
444       CFLAGS="$CFLAGS -DNEEDS_MPI_FINT"
445       AC_MSG_RESULT(no)
446       rm -f mpitest1.o mpitest1.c
447   else
448       NEEDS_MPI_FINT=""
449       AC_MSG_RESULT(yes)
450       rm -f mpitest1.o mpitest1.c
451   fi
452 ])dnl
456 define(PAC_LONG_64,[
457 if test -z "$longsize" ; then
458     PAC_GET_TYPE_SIZE(long,longsize)
460 if test -n "$longsize" ; then
461    if test $longsize = 8 ; then
462        AC_DEFINE(HAVE_LONG_64,,[Define if long is 64 bits])
463    fi
464 else
465    echo "assuming size of long is NOT 8 bytes; use '-longsize' to indicate otherwise"
467 ])dnl
470 define(PAC_MPI_LONG_LONG_INT,[
471   AC_MSG_CHECKING(if MPI_LONG_LONG_INT is defined in mpi.h)
472   rm -f mpitest.c
473   cat > mpitest.c <<EOF
474 #include "mpi.h"
475      main(int argc, char **argv)
476      {
477          long long i;   
478          MPI_Init(&argc,&argv);
479          MPI_Send(&i, 1, MPI_LONG_LONG_INT, 0, 0, MPI_COMM_WORLD);
480          MPI_Finalize(); 
481      }
483   rm -f conftest
484   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
485   if test -x conftest ; then
486       AC_MSG_RESULT(yes)
487       AC_DEFINE(HAVE_MPI_LONG_LONG_INT,,[Define if mpi has long long it])
488   else
489       AC_MSG_RESULT(no)
490   fi
491   rm -f conftest mpitest.c
492 ])dnl
494 dnl Check that the compile accepts ANSI prototypes. 
495 dnl PAC_CHECK_CC_PROTOTYPES()
497 define(PAC_CHECK_CC_PROTOTYPES,[
498 AC_MSG_CHECKING(that the compiler $CC accepts ANSI prototypes)
499 AC_COMPILE_CHECK(,[int f(double a){return 0;}],,eval "ac_cv_ccworks=yes",eval "ac_cv_ccworks=no")
500 AC_MSG_RESULT($ac_cv_ccworks)
501 if test $ac_cv_ccworks = "yes" ; then
502    AC_DEFINE(HAVE_PROTOTYPES,,[Define if C compiler supports prototypes])
504 ])dnl
507 dnl PAC_TEST_LONG_LONG()
509 dnl tests if the compiler prints long long correctly and whether to use
510 dnl %ld or %lld. Called from within PAC_LONG_LONG_64.
512 define(PAC_TEST_LONG_LONG,
513 [AC_MSG_CHECKING([if the compiler prints long longs correctly with %lld])
514 rm -f conftestll
515 AC_TEST_PROGRAM([#include <stdio.h>
516 main() {
517   long long i=8; 
518   FILE *f=fopen("conftestll","w");
519   if (!f) exit(1);
520   fprintf( f, "%lld\n", i);
521   exit(0);
522 }],Pac_CV_NAME=`cat conftestll`,Pac_CV_NAME="")
523 rm -f conftestll
524 if test "$Pac_CV_NAME" = 8 ; then
525     AC_MSG_RESULT(yes)
526     AC_DEFINE(HAVE_LONG_LONG_64,,[Define if have 64 bit long long])
527     DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
528     FORTRAN_MPI_OFFSET="integer*8"
529     echo "defining MPI_Offset as long long in C and integer*8 in Fortran"
530     LL="\%lld"
531 else
532     AC_MSG_RESULT(no)
533     AC_MSG_CHECKING([if the compiler prints long longs correctly with %ld])
534     AC_TEST_PROGRAM([#include <stdio.h>
535     main() {
536       long long i=8; 
537       FILE *f=fopen("conftestll","w");
538       if (!f) exit(1);
539       fprintf( f, "%ld\n", i);
540       exit(0);
541     }],Pac_CV_NAME=`cat conftestll`,Pac_CV_NAME="")
542     rm -f conftestll
543     if test "$Pac_CV_NAME" = 8 ; then
544        AC_MSG_RESULT(yes)
545        AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits])
546        DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
547        FORTRAN_MPI_OFFSET="integer*8"
548        echo "defining MPI_Offset as long long in C and integer*8 in Fortran"
549        LL="\%ld"
550     else
551        AC_MSG_RESULT(no!!)
552        echo "the compiler doesn't print long longs correctly!"
553        echo "defining MPI_Offset as long in C and integer in Fortran" 
554        DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
555        FORTRAN_MPI_OFFSET="integer"
556        LL="\%ld"
557        MPI_OFFSET_KIND1="!"
558        MPI_OFFSET_KIND2="!"
559     fi
561 ])dnl
564 dnl PAC_LONG_LONG_64: check if there is a 64-bit long long
566 define(PAC_LONG_LONG_64,[
567 if test -n "$longlongsize" ; then
568     if test "$longlongsize" = 8 ; then
569        echo "defining MPI_Offset as long long in C and integer*8 in Fortran" 
570        AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits])
571        DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
572        FORTRAN_MPI_OFFSET="integer*8"
573        LL="\%lld"
574     elif test "$longlongsize" = "int" ; then  # a hack to set MPI_Offset as int
575        echo "defining MPI_Offset as int in C and integer in Fortran"
576        DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
577        FORTRAN_MPI_OFFSET="integer"
578        AC_DEFINE(MPI_OFFSET_IS_INT,,[Define if MPI_Offset is int])
579        LL="\%d"
580        MPI_OFFSET_KIND1="!"
581        MPI_OFFSET_KIND2="!"
582     else 
583        echo "defining MPI_Offset as long in C and integer in Fortran" 
584        DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
585        FORTRAN_MPI_OFFSET="integer"
586        LL="\%ld"
587        MPI_OFFSET_KIND1="!"
588        MPI_OFFSET_KIND2="!"
589     fi
590 else
591    PAC_GET_TYPE_SIZE(long long, longlongsize)
592    if test -n "$longlongsize" ; then
593       if test "$longlongsize" = 8 ; then
594          PAC_TEST_LONG_LONG()
595       else
596          echo "defining MPI_Offset as long in C and integer in Fortran" 
597          DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
598          FORTRAN_MPI_OFFSET="integer"
599          LL="\%ld"
600          MPI_OFFSET_KIND1="!"
601          MPI_OFFSET_KIND2="!"
602       fi
603    else 
604 dnl   check if longlong is not supported or only its size cannot be determined
605 dnl   because the program cannot be run.
606       rm -f ltest.c
607       cat > ltest.c <<EOF
608         main()
609         {
610            long long i=8;
611            return 0;
612         }
614       rm -f conftest
615       $CC $USER_CFLAGS -o conftest ltest.c > /dev/null 2>&1
616       if test -x conftest ; then
617          echo "assuming size of long long is 8bytes; use '-longlongsize' to indicate otherwise"
618          rm -f conftest ltest.c
619          echo "defining MPI_Offset as long long in C and integer*8 in Fortran" 
620          AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits])
621          DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
622          FORTRAN_MPI_OFFSET="integer*8"
623          LL="\%lld"
624       else 
625          echo "assuming long long is not available; use '-longlongsize' to indicate otherwise"
626          echo "defining MPI_Offset as long in C and integer in Fortran" 
627          DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
628          FORTRAN_MPI_OFFSET="integer"
629          LL="\%ld"
630          MPI_OFFSET_KIND1="!"
631          MPI_OFFSET_KIND2="!"
632       fi
633    fi
635 ])dnl
638 define(PAC_MPI_INFO,[
639   AC_MSG_CHECKING(if MPI_Info functions are defined in the MPI implementation)
640   rm -f mpitest.c
641   cat > mpitest.c <<EOF
642 #include "mpi.h"
643      main(int argc, char **argv)
644      {
645          MPI_Info info;
646          MPI_Init(&argc,&argv);
647          MPI_Info_create(&info);
648          MPI_Finalize(); 
649      }
651   rm -f conftest
652   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
653   if test -x conftest ; then
654       AC_MSG_RESULT(yes)
655       AC_DEFINE(HAVE_MPI_INFO,,[Define if MPI_Info available])
656       HAVE_MPI_INFO="#define HAVE_MPI_INFO"
657       MPI_FINFO1="!"
658       MPI_FINFO2="!"
659       MPI_FINFO3="!"
660       MPI_FINFO4="!"
661   else
662       AC_MSG_RESULT(no)
663       BUILD_MPI_INFO=1
664       MPI_FINFO1="      INTEGER MPI_MAX_INFO_KEY, MPI_MAX_INFO_VAL"
665       MPI_FINFO2="      PARAMETER (MPI_MAX_INFO_KEY=255, MPI_MAX_INFO_VAL=1024)"
666       MPI_FINFO3="      INTEGER MPI_INFO_NULL"
667       MPI_FINFO4="      PARAMETER (MPI_INFO_NULL=0)"
668   fi
669   rm -f conftest mpitest.c
670 ])dnl
673 define(PAC_MPI_DARRAY_SUBARRAY,[
674   AC_MSG_CHECKING(if darray and subarray constructors are defined in the MPI implementation)
675   rm -f mpitest.c
676   cat > mpitest.c <<EOF
677 #include "mpi.h"
678      main(int argc, char **argv)
679      {
680          int i=MPI_DISTRIBUTE_CYCLIC;
681          MPI_Datatype t;
682          MPI_Init(&argc,&argv);
683          MPI_Type_create_darray(i, i, i, &i, &i, &i, &i, i, MPI_INT, &t);
684          MPI_Type_create_subarray(i, &i, &i, &i, i, MPI_INT, &t);
685          MPI_Finalize(); 
686      }
688   rm -f conftest
689   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
690   if test -x conftest ; then
691       AC_MSG_RESULT(yes)
692       AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,,[Define if MPI Darray available])
693       HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
694       MPI_FARRAY1="!"
695       MPI_FARRAY2="!"
696       MPI_FARRAY3="!"
697       MPI_FARRAY4="!"
698       MPI_FARRAY5="!"
699       MPI_FARRAY6="!"
700       MPI_FARRAY7="!"
701   else
702       AC_MSG_RESULT(no)
703       BUILD_MPI_ARRAY=1
704       MPI_FARRAY1="      INTEGER MPI_ORDER_C, MPI_ORDER_FORTRAN"
705       MPI_FARRAY2="      PARAMETER (MPI_ORDER_C=56, MPI_ORDER_FORTRAN=57)"
706       MPI_FARRAY3="      INTEGER MPI_DISTRIBUTE_BLOCK, MPI_DISTRIBUTE_CYCLIC"
707       MPI_FARRAY4="      INTEGER MPI_DISTRIBUTE_NONE, MPI_DISTRIBUTE_DFLT_DARG"
708       MPI_FARRAY5="      PARAMETER (MPI_DISTRIBUTE_BLOCK=121, MPI_DISTRIBUTE_CYCLIC=122)"
709       MPI_FARRAY6="      PARAMETER (MPI_DISTRIBUTE_NONE=123)"
710       MPI_FARRAY7="      PARAMETER (MPI_DISTRIBUTE_DFLT_DARG=-49767)"
711   fi
712   rm -f conftest mpitest.c
713 ])dnl
716 define(PAC_CHECK_MPI_SGI_INFO_NULL,[
717   AC_MSG_CHECKING(if MPI_INFO_NULL is defined in mpi.h)
718   rm -f mpitest.c
719   cat > mpitest.c <<EOF
720 #include "mpi.h"
721      main(int argc, char **argv)
722      {
723         int i;
724         i = MPI_INFO_NULL;
725      }
727   rm -f conftest
728   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
729   if test -x conftest ; then
730       AC_MSG_RESULT(yes)
731       cp adio/sgi/mpi3.1/*.h include
732   else
733       AC_MSG_RESULT(no)
734   fi
735   rm -f conftest mpitest.c
736 ])dnl
740 define(PAC_CHECK_MPIOF_H,[
741   AC_MSG_CHECKING(if mpiof.h is included in mpif.h)
742   rm -f mpitest.f
743   cat > mpitest.f <<EOF
744       program main
745       implicit none
746       include 'mpif.h'
747       integer i
748       i = MPI_MODE_RDWR
749       stop
750       end
752   rm -f conftest
753   $F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.f $MPI_LIB > /dev/null 2>&1
754   if test -x conftest ; then
755       AC_MSG_RESULT(yes)
756       MPIOF_H_INCLUDED=1
757   else
758       AC_MSG_RESULT(no)
759   fi
760   rm -f conftest mpitest.f
761 ])dnl
764 dnl check if pread64 is defined in IRIX. needed on IRIX 6.5
766 define(PAC_HAVE_PREAD64,[
767   AC_MSG_CHECKING(if pread64 is defined)
768   rm -f conftest.c
769   cat > conftest.c <<EOF
770 #include <unistd.h>
771      main()
772      {
773          int fd=0, buf=0, i=0;
774          off64_t off=0;
775          pread64(fd, &buf, i, off);
776      }
778   rm -f conftest
779   $CC $USER_CFLAGS -o conftest conftest.c > /dev/null 2>&1
780   if test -x conftest ; then
781       AC_MSG_RESULT(yes)
782       AC_DEFINE(HAVE_PREAD64,,[Define if pread64 available])
783   else
784       AC_MSG_RESULT(no)
785   fi
786 rm -f conftest conftest.c
787 ])dnl
790 define(PAC_TEST_MPI_SGI_type_is_contig,[
791   AC_MSG_CHECKING(if MPI_SGI_type_is_contig is defined)
792   rm -f mpitest.c
793   cat > mpitest.c <<EOF
794 #include "mpi.h"
795      main(int argc, char **argv)
796      {
797          MPI_Datatype type;
798          int i;
800          MPI_Init(&argc,&argv);
801          i = MPI_SGI_type_is_contig(type);
802          MPI_Finalize(); 
803      }
805   rm -f conftest
806   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
807   if test -x conftest ; then
808      AC_MSG_RESULT(yes)
809   else
810      AC_MSG_RESULT(no)
811      AC_DEFINE(NO_MPI_SGI_type_is_contig,,[Define if no MPI type is contig])
812   fi
813   rm -f conftest mpitest.c
814 ])dnl
818 define(PAC_TEST_MPI_COMBINERS,[
819   AC_MSG_CHECKING(if MPI-2 combiners are defined in mpi.h)
820   rm -f mpitest.c
821   cat > mpitest.c <<EOF
822 #include "mpi.h"
823      main(int argc, char **argv)
824      {
825          int i;
827          MPI_Init(&argc,&argv);
828          i = MPI_COMBINER_STRUCT;
829          MPI_Finalize(); 
830      }
832   rm -f conftest
833   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
834   if test -x conftest ; then
835      AC_MSG_RESULT(yes)
836      AC_DEFINE(HAVE_MPI_COMBINERS,,[Define if MPI combiners available])
837   else
838      AC_MSG_RESULT(no)
839   fi
840   rm -f conftest mpitest.c
841 ])dnl
844 dnl PAC_MPI_OFFSET_KIND()
846 dnl tries to determine the Fortran 90 kind parameter for 8-byte integers
848 define(PAC_MPI_OFFSET_KIND,
849 [AC_MSG_CHECKING([for Fortran 90 KIND parameter for 8-byte integers])
850 rm -f kind.f kind.o kind
851 cat <<EOF > kind.f
852       program main
853       integer i
854       i = selected_int_kind(16)
855       open(8, file="k.out", form="formatted")
856       write (8,*) i
857       close(8)
858       stop
859       end
861 if test -z "$F90" ; then
862    F90=f90
864 KINDVAL=""
865 if $F90 -o kind kind.f >/dev/null 2>&1 ; then
866     ./kind >/dev/null 2>&1
867     if test -s k.out ; then 
868         KINDVAL=`cat k.out`
869     fi
871 rm -f kind k.out kind.f kind.o k.out
872 if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
873    AC_MSG_RESULT($KINDVAL)
874    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
875    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
876 else
877     AC_MSG_RESULT(unavailable)
879 ])dnl
882 define(PAC_TEST_MPI_HAVE_OFFSET_KIND,[
883   AC_MSG_CHECKING(if MPI_OFFSET_KIND is defined in mpif.h)
884   rm -f mpitest.f
885   cat > mpitest.f <<EOF
886       program main
887       implicit none
888       include 'mpif.h'
889       integer i
890       i = MPI_OFFSET_KIND
891       stop
892       end
894   rm -f conftest
895   $F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.f $MPI_LIB > /dev/null 2>&1
896   if test -x conftest ; then
897      AC_MSG_RESULT(yes)
898      MPI_OFFSET_KIND1="!"
899      MPI_OFFSET_KIND2="!"
900   else
901      AC_MSG_RESULT(no)
902   fi
903   rm -f conftest mpitest.f
904 ])dnl
907 dnl PAC_GET_XFS_MEMALIGN
908 dnl 
910 define(PAC_GET_XFS_MEMALIGN,
911 [AC_MSG_CHECKING([for memory alignment needed for direct I/O])
912 /bin/rm -f memalignval
913 /bin/rm -f /tmp/romio_tmp.bin
914 AC_TEST_PROGRAM([#include <stdio.h>
915 #include <unistd.h>
916 #include <fcntl.h>
917 #include <stdio.h>
918 main() { 
919   struct dioattr st;
920   int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
921   FILE *f=fopen("memalignval","w");
922   if (fd == -1) exit(1);
923   if (!f) exit(1);
924   fcntl(fd, F_DIOINFO, &st);
925   fprintf( f, "%u\n", st.d_mem);
926   exit(0);
927 }],Pac_CV_NAME=`cat memalignval`,Pac_CV_NAME="")
928 /bin/rm -f memalignval
929 /bin/rm -f /tmp/romio_tmp.bin
930 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
931     AC_MSG_RESULT($Pac_CV_NAME)
932     CFLAGS="$CFLAGS -DXFS_MEMALIGN=$Pac_CV_NAME"
933 else
934     AC_MSG_RESULT(unavailable, assuming 128)
935     CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
937 ])dnl
940 dnl Look for a style of VPATH.  Known forms are
941 dnl VPATH = .:dir
942 dnl .PATH: . dir
944 dnl Defines VPATH or .PATH with . $(srcdir)
945 dnl Requires that vpath work with implicit targets
946 dnl NEED TO DO: Check that $< works on explicit targets.
948 define(PAC_MAKE_VPATH,[
949 AC_SUBST(VPATH)
950 AC_MSG_CHECKING(for virtual path format)
951 rm -rf conftest*
952 mkdir conftestdir
953 cat >conftestdir/a.c <<EOF
954 A sample file
956 cat > conftest <<EOF
957 all: a.o
958 VPATH=.:conftestdir
959 .c.o:
960         @echo \$<
962 ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
963 if test -n "$ac_out" ; then 
964     AC_MSG_RESULT(VPATH)
965     VPATH='VPATH=.:$(srcdir)'
966 else
967     rm -f conftest
968     cat > conftest <<EOF
969 all: a.o
970 .PATH: . conftestdir
971 .c.o:
972         @echo \$<
974     ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
975     if test -n "$ac_out" ; then 
976         AC_MSG_RESULT(.PATH)
977         VPATH='.PATH: . $(srcdir)'
978     else
979         AC_MSG_RESULT(neither VPATH nor .PATH works)
980     fi
982 rm -rf conftest*
983 ])dnl
986 dnl There is a bug in AC_PREPARE that sets the srcdir incorrectly (it
987 dnl is correct in configure, but it puts an absolute path into config.status,
988 dnl which is a big problem for scripts like mpireconfig that are wrappers
989 dnl around config.status).  The bug is in not recognizing that ./ and .//
990 dnl are the same  directory as . (in fact, ./[/]* is the same).
992 define(PAC_FIXUP_SRCDIR,[
993 # Find the source files, if location was not specified.
994 if test "$srcdirdefaulted" = "yes" ; then
995   srcdir=""
996   # Try the directory containing this script, then `..'.
997   prog=[$]0
998 changequote(,)dnl
999   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
1000   # Remove all trailing /'s 
1001   confdir=`echo $confdir|sed 's%[/*]$%%'`
1002 changequote([,])dnl
1003   test "X$confdir" = "X$prog" && confdir=.
1004   srcdir=$confdir
1005   if test ! -r $srcdir/$unique_file; then
1006     srcdir=..
1007   fi
1009 if test ! -r $srcdir/$unique_file; then
1010   if test x$srcdirdefaulted = xyes; then
1011     echo "configure: Cannot find sources in \`${confdir}' or \`..'." 1>&2
1012   else
1013     echo "configure: Cannot find sources in \`${srcdir}'." 1>&2
1014   fi
1015   exit 1
1017 # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
1018 # (and preserve ./ and .//)
1019 # But we can't avoid them for `..', to make subdirectories work.
1020 case $srcdir in
1021   .|./|.//|/*|~*) ;;
1022   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
1023 esac
1027 dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
1028 dnl             ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
1029 define(AC_TRY_LINK,
1030 if test -z "$ac_ext" ; then 
1031     ac_ext=c
1033 [cat > conftest.$ac_ext <<EOF
1034 dnl This sometimes fails to find confdefs.h, for some reason.
1035 dnl [#]line __oline__ "[$]0"
1036 dnl [#]line __oline__ "configure"
1037 #include "confdefs.h"
1038 [$1]
1039 int main() { return 0; }
1040 int t() {
1041 [$2]
1042 ; return 0; }
1044 rm -f conftest.out
1045 if test -z "$ac_link" ; then
1046 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
1048 if eval $ac_link; then
1049   ifelse([$3], , :, [rm -rf conftest*
1050   $3])
1051 else
1052   if test -s conftest.out ; then cat conftest.out >> config.log ; fi
1053 ifelse([$4], , , [rm -rf conftest*
1054   $4
1055 ])dnl
1057 rm -f conftest*]
1058 )dnl
1061 define(PAC_HAVE_MOUNT_NFS,[
1062   AC_MSG_CHECKING([if MOUNT_NFS is defined in the include files])
1063   rm -f conftest.c
1064   cat > conftest.c <<EOF
1065 #include <sys/param.h>
1066 #include <sys/mount.h>
1067      main()
1068      {
1069          int i=MOUNT_NFS;
1070      }
1072   rm -f conftest
1073   $CC $USER_CFLAGS -o conftest conftest.c > /dev/null 2>&1
1074   if test -x conftest ; then
1075      AC_MSG_RESULT(yes)
1076      AC_DEFINE(HAVE_MOUNT_NFS,,[Define if MOUNT_NFS defined])
1077   else
1078      AC_MSG_RESULT(no)
1079   fi
1080   rm -f conftest conftest.c
1081 ])dnl
1084 dnl PAC_MPI_OFFSET_KIND_4BYTE()
1086 dnl tries to determine the Fortran 90 kind parameter for 4-byte integers
1088 define(PAC_MPI_OFFSET_KIND_4BYTE,
1089 [AC_MSG_CHECKING([for Fortran 90 KIND parameter for 4-byte integers])
1090 rm -f kind.f kind.o kind
1091 cat <<EOF > kind.f
1092       program main
1093       integer i
1094       i = selected_int_kind(8)
1095       open(8, file="k.out", form="formatted")
1096       write (8,*) i
1097       close(8)
1098       stop
1099       end
1101 if test -z "$F90" ; then
1102    F90=f90
1104 KINDVAL=""
1105 if $F90 -o kind kind.f >/dev/null 2>&1 ; then
1106     ./kind >/dev/null 2>&1
1107     if test -s k.out ; then 
1108         KINDVAL=`cat k.out`
1109     fi
1111 rm -f kind k.out kind.f kind.o
1112 if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
1113    AC_MSG_RESULT($KINDVAL)
1114    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
1115    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
1116 else
1117     AC_MSG_RESULT(unavailable)
1119 ])dnl
1122 define(PAC_FUNC_STRERROR,[
1123   AC_MSG_CHECKING([for strerror()])
1124   rm -f conftest.c
1125   cat > conftest.c <<EOF
1126 #include <string.h>
1127      main()
1128      {
1129         char *s = strerror(5);
1130      }
1132   rm -f conftest
1133   $CC $USER_CFLAGS -o conftest conftest.c >> config.log 2>&1
1134   if test -x conftest ; then
1135      AC_MSG_RESULT(yes)
1136      AC_DEFINE(HAVE_STRERROR,,[Define if strerror available])
1137   else
1138      AC_MSG_RESULT(no)
1139      AC_MSG_CHECKING([for sys_errlist])
1140      rm -f conftest.c
1141 changequote(,)
1142      cat > conftest.c <<EOF
1143 #include <stdio.h>
1144         main()
1145         {
1146            extern char *sys_errlist[];
1147            printf("%s\n", sys_errlist[34]);
1148         }
1150 changequote([,])
1151      rm -f conftest
1152      $CC $USER_CFLAGS -o conftest conftest.c > config.log 2>&1
1153      if test -x conftest ; then
1154         AC_MSG_RESULT(yes)
1155         AC_DEFINE(HAVE_SYSERRLIST,,[Define if syserrlist available])
1156      else
1157         AC_MSG_RESULT(no)
1158      fi
1159   fi
1160   rm -f conftest conftest.c
1161 ])dnl
1165 define(PAC_C_INLINE,[
1166 AC_MSG_CHECKING([for inline])
1167 if eval "test \"`echo '$''{'pac_cv_c_inline'+set}'`\" = set"; then
1168    AC_MSG_RESULT([(cached)])
1169 else
1170   AC_COMPILE_CHECK(,[inline int a( int b ){return b+1;}],[int a;],
1171 pac_cv_c_inline="yes",pac_cv_c_inline="no")
1173 AC_MSG_RESULT($pac_cv_c_inline)
1174 if test "$pac_cv_c_inline" = "no" ; then
1175     AC_DEFINE(inline,,[Define if inline is not supported])
1177 ])dnl
1178 define(AC_MSG_WARN,[AC_MSG_RESULT([Warning: $1])])
1180 dnl PAC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND],
1181 dnl PRE-REQ-HEADERS )
1183 dnl BUG: AIX 4.1 can't handle a \055 (octal for -) in a tr string (sometimes;
1184 dnl it works from the shell but not within a file)
1185 dnl I've removed that and hoped that no header will include a - in the
1186 dnl name
1188 dnl This can fail if the header needs OTHER headers for the compile
1189 dnl to succeed.  Those headers should be specified in the "pre-req-headers"
1190 dnl For example 
1191 dnl PAC_CHECK_HEADER(sys/vfs.h,AC_DEFINE(HAVE_SYS_VFS_H),,
1192 dnl                  [#include <sys/types.h>])
1194 define(PAC_CHECK_HEADER,dnl
1195 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
1196 changequote(,)dnl
1197 ac_safe=`echo "$1" | tr '[a-z]./' '[A-Z]__'`
1198 changequote([,])dnl
1199 AC_MSG_CHECKING([for $1])
1200 dnl AC_CACHE_VAL(ac_cv_header_$ac_safe,[dnl
1201 AC_COMPILE_CHECK(,[$4]
1202 [#include <$1>],main();,eval "ac_cv_header_$ac_safe=yes",
1203   eval "ac_cv_header_$ac_safe=no")dnl])dnl
1204 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1205   AC_MSG_RESULT(yes)
1206   ifelse([$2], , :, [$2])
1207 else
1208   AC_MSG_RESULT(no)
1209 ifelse([$3], , , [$3
1210 ])dnl
1212 ])dnl
1214 dnl PAC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1215 define(PAC_CHECK_HEADERS,[for ac_hdr in $1
1217 PAC_CHECK_HEADER($ac_hdr,
1218 [changequote(, )dnl
1219   ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
1220 changequote([, ])dnl
1221   AC_DEFINE($ac_tr_hdr) $2], $3)dnl
1222 done
1223 ])dnl
1225 define(PAC_TEST_MPIR_STATUS_SET_BYTES,[
1226   AC_MSG_CHECKING(if MPIR_Status_set_bytes is defined)
1227   rm -f mpitest.c
1228   cat > mpitest.c <<EOF
1229 #include "mpi.h"
1230      main(int argc, char **argv)
1231      {
1232          MPI_Status status;
1233          MPI_Datatype type;
1234          int err;
1236          MPI_Init(&argc,&argv);
1237          MPIR_Status_set_bytes(status,type,err);
1238          MPI_Finalize(); 
1239      }
1241   rm -f conftest
1242   $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
1243   if test -x conftest ; then
1244      AC_MSG_RESULT(yes)
1245      AC_DEFINE(HAVE_STATUS_SET_BYTES,,[Define if status set bytes available])
1246   else
1247      AC_MSG_RESULT(no)
1248   fi
1249   rm -f conftest mpitest.c
1250 ])dnl