~ubuntu-branches/ubuntu/hardy/openmpi/hardy-updates

« back to all changes in this revision

Viewing changes to ompi/mca/io/romio/romio/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-10-15 00:46:11 UTC
  • Revision ID: james.westby@ubuntu.com-20061015004611-uuhxnaxyjmuxfd5h
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: shell-script -*-
 
2
# build with
 
3
# autoconf --localdir=../confdb configure.in
 
4
# (or wherever the confdb is)
 
5
#
 
6
 
 
7
# Open MPI: Modifications to this file were done on an "let's do the
 
8
# minimum possible" basis, not so that we can skip on the work or
 
9
# provide any less functionality, but more from a perspective that we
 
10
# want to be able to import new versions of ROMIO in as easy a fashion
 
11
# as possible.  Hence, there are some things in this file that are
 
12
# irrelevant / unnecessary in an Open MPI environment, but are
 
13
# harmless and are left here solely for the sake of ease of future
 
14
# patching/importing.
 
15
 
 
16
 
 
17
AC_PREREQ(2.59)
 
18
 
 
19
# if this blows up, it's because you forgot to run autoheader
 
20
AC_INIT(adio/include/romioconf.h.in)
 
21
# VERSION=1.2.6
 
22
# AC_MSG_RESULT([Configuring ROMIO Version $VERSION])
 
23
CONFIGURE_ARGS="$*"
 
24
if test -n "$CONFIGURE_ARGS" ; then
 
25
    echo "Configuring with args $CONFIGURE_ARGS"
 
26
fi
 
27
 
 
28
AC_CONFIG_HEADER(adio/include/romioconf.h)
 
29
 
 
30
# Open MPI: added AH_TOP
 
31
AH_TOP([#include "romioconf-undefs.h"])
 
32
 
 
33
# Open MPI: this configure script doesn't seem to define these
 
34
# anywhere, so just do them manually here because "we know better"
 
35
# (i.e., Open MPI can be hard-wired to these values).
 
36
AC_DEFINE([HAVE_MPI_OFFSET], [1], [Will always be 1 - OMPI has MPI_OFFSET])
 
37
                           
 
38
# Open MPI: look for top Open MPI directory
 
39
AC_MSG_CHECKING([for Open MPI support files])
 
40
if test -f "$srcdir/../../../../../config/mca_configure.ac"; then
 
41
 
 
42
    # This is needed for VPATH builds, so that it will -I the
 
43
    # appropriate include directory (don't know why automake
 
44
    # doesn't do this # automatically).
 
45
 
 
46
    top_ompi_srcdir='$(top_srcdir)/../../../../..'
 
47
    top_ompi_builddir='$(top_builddir)/../../../../..'
 
48
    OMPI_CFLAGS='-I$(top_srcdir)/include -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal -I$(top_builddir)/opal -I$(top_srcdir)/orte -I$(top_builddir)/orte -I$(top_srcdir)/ompi -I$(top_builddir)/ompi'" $CPPFLAGS"
 
49
    found_ompi_headers=1
 
50
    AC_MSG_RESULT([in Open MPI source tree -- good])
 
51
    AC_SUBST(top_ompi_srcdir)
 
52
    AC_SUBST(top_ompi_builddir)
 
53
else
 
54
    AC_MSG_RESULT([not found])
 
55
    AC_MSG_WARN([*** Could not find Open MPI support files])
 
56
    AC_MSG_WARN([*** Can only build this version of ROMIO in an Open MPI source tree])
 
57
    AC_MSG_ERROR([*** Cannot continue])
 
58
fi
 
59
 
 
60
dnl
 
61
# Open MPI: disable the f77 and f90 tests, as we provide our own
 
62
# MPI interface and use only the C parts of ROMIO
 
63
NOF77=1
 
64
NOF90=1
 
65
ARCH=""
 
66
arch_IRIX=""
 
67
MPI=""
 
68
MPI_INCLUDE_DIR=""
 
69
ROMIO_INCLUDE=""
 
70
TEST_LIBNAME=""
 
71
FILE_SYSTEM=""
 
72
# Do not set variables to empty that may be communicated from the
 
73
# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME)
 
74
DEBUG=no
 
75
MIPS=0
 
76
BITS=0
 
77
FROM_MPICH=${FROM_MPICH:-no}
 
78
FROM_MPICH2=${FROM_MPICH2:-no}
 
79
if test "$FROM_MPICH" = yes -a "$FROM_MPICH2" = yes ; then
 
80
    AC_MSG_WARN([Both FROM_MPICH and FROM_MPICH set to yes; at most one should  be yes])
 
81
    
 
82
fi
 
83
FROM_LAM=${FROM_LAM:-no}
 
84
if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi
 
85
CFLAGS=${CFLAGS:-""}
 
86
LL="lld"
 
87
AR_LOCAL=""
 
88
DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST"
 
89
HAVE_MPI_INFO=""
 
90
BUILD_MPI_INFO=""
 
91
MPI_FINFO1=""
 
92
MPI_FINFO2=""
 
93
MPI_FINFO3=""
 
94
MPI_FINFO4=""
 
95
MPI_FARRAY1=""
 
96
MPI_FARRAY2=""
 
97
MPI_FARRAY3=""
 
98
MPI_FARRAY4=""
 
99
MPI_FARRAY5=""
 
100
MPI_FARRAY6=""
 
101
MPI_FARRAY7=""
 
102
DEFS=""
 
103
ROMIO_LFLAGS=""
 
104
ROMIO_LIBLIST=""
 
105
ROMIO_TCFLAGS=""
 
106
ROMIO_TCPPFLAGS=""
 
107
ROMIO_TFFLAGS=""
 
108
NOPROFILE=0
 
109
MPIRUN=""
 
110
FORTRAN_TEST=""
 
111
# Open MPI: This (setting make) is a Bad Thing to do in Automake-based build systems
 
112
# MAKE=${MAKE:-"make"}
 
113
# foll. needed for f77 test programs
 
114
F77GETARG="call getarg(i,str)"
 
115
F77IARGC="iargc()"
 
116
F77MPIOINC=""
 
117
FTESTDEFINE=""
 
118
FORTRAN_MPI_OFFSET=""
 
119
MPIOF_H_INCLUDED=0
 
120
MPI_OFFSET_KIND1="!"
 
121
MPI_OFFSET_KIND2="!"
 
122
TEST_CC=""
 
123
TEST_F77=""
 
124
# Open MPI: don't want a profiling layer... - change weak from 1 to 0
 
125
TRY_WEAK_SYMBOLS=0
 
126
#
 
127
# Error handlers (not used with MPICH2, which provides its own routines)
 
128
MPIO_EXTRA_OBJECTS="get_errh.o set_errh.o"
 
129
MPIO_EXTRA_TMP_POBJECTS="get_errh.p set_errh.p"
 
130
MPIO_EXTRA_REAL_POBJECTS="_get_errh.o _set_errh.o"
 
131
#
 
132
# Completion routines for MPIO_Requests.  MPI Implementations with
 
133
# generalized requests do not need these
 
134
# ioreq_c2f and ioreq_f2c are not MPIO_Requests; rather, they 
 
135
MPIO_REQOBJECTS="iotest.o iotestall.o iotestany.o iotestsome.o iowait.o iowaitall.o iowaitany.o iowaitsome.o ioreq_c2f.o ioreq_f2c.o"
 
136
MPIO_REQ_TMP_POBJECTS="iotest.p iowait.p iowaitall.p iowaitany.p iotestall.p iotestany.p iowaitsome.p iotestsome.p"
 
137
MPIO_REQ_REAL_POBJECTS="_iotest.o _iowait.o _iowaitall.o _iowaitany.o _iotestall.o _iotestany.o _iowaitsome.o _iotestsome.o"
 
138
#
 
139
have_aio=no
 
140
#
 
141
known_filesystems="nfs ufs pfs pvfs pvfs2 testfs xfs panfs gridftp"
 
142
# Open MPI: added "open_mpi_mpi"
 
143
known_mpi_impls="mpich2_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi open_mpi_mpi"
 
144
#
 
145
# Defaults
 
146
AC_ARG_ENABLE(aio,[
 
147
--enable-aio - Request use of asynchronous I/O routines (default)],
 
148
 
149
  if test "x$enableval" = "xno" ; then
 
150
    disable_aio=yes
 
151
  else
 
152
    disable_aio=no
 
153
  fi
 
154
], disable_aio=no)
 
155
AC_ARG_ENABLE(echo, 
 
156
[--enable-echo  - Turn on strong echoing. The default is enable=no.] ,set -x)
 
157
AC_ARG_ENABLE(f77,
 
158
[--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes)
 
159
AC_ARG_ENABLE(f90,
 
160
[--enable-f90 - Turn on support for Fortran 90 (default)],,enable_f90=yes)
 
161
AC_ARG_ENABLE(weak-symbols,
 
162
[--enable-weak-symbols - Turn on support for weak symbols],,enable_weak_symbols=yes)
 
163
AC_ARG_ENABLE(debug,
 
164
[--enable-debug - Build a debugging version],,)
 
165
AC_ARG_WITH(file-system,[
 
166
--with-file-system=name - Build with support for the named file systems],,)
 
167
AC_ARG_WITH(mpi,[
 
168
--with-mpi=name - Specify MPI implementation to build ROMIO for],,)
 
169
dnl
 
170
if test "$enable_f77" != "yes" ; then
 
171
   NOF77=1
 
172
fi
 
173
if test "$enable_f90" != "yes" ; then
 
174
   NOF90=1
 
175
fi
 
176
if test "$enable_debug" = "yes" ; then
 
177
    DEBUG=yes
 
178
fi
 
179
if test "$enable_weak_symbols" = "no" ; then
 
180
    TRY_WEAK_SYMBOLS=0
 
181
fi
 
182
MPI=$with_mpi
 
183
FILE_SYSTEM=$with_file_system
 
184
#
 
185
dnl AC_CONFIG_AUX_DIR(../../../confdb)
 
186
dnl Set the directory that contains the required install-sh, config.sub,
 
187
dnl and config.guess .  Make sure that these are updated (in MPICH2, use
 
188
dnl the top-level confdb files).  This separate directory is used for
 
189
dnl the moment to allow ROMIO to be separatedly distributed.
 
190
dnl scripts.
 
191
AC_CONFIG_AUX_DIR(confdb)
 
192
 
 
193
# Open MPI: Init automake
 
194
AM_INIT_AUTOMAKE(io-romio, 1.0.0, 'no')
 
195
 
 
196
#
 
197
# Check that an arch was set
 
198
# If it wasn't set, try to guess using "util/tarch"
 
199
#
 
200
# Sometimes tarch looses its execute bit (!)
 
201
if test -s $srcdir/util/tarch -a ! -x $srcdir/util/tarch ; then
 
202
    chmod a+x $srcdir/util/tarch
 
203
fi
 
204
if test -z "$ARCH" -a -x $srcdir/util/tarch ; then
 
205
    AC_MSG_CHECKING(for architecture)
 
206
    ARCH=`$srcdir/util/tarch | sed s/-/_/g`
 
207
    if test -z "$ARCH" ; then
 
208
       AC_MSG_RESULT(Unknown!)
 
209
       AC_MSG_ERROR([Error: Couldn\'t guess target architecture, you must 
 
210
set an architecture type with the environment variable ARCH]) 
 
211
    fi 
 
212
    eval "arch_$ARCH=1"
 
213
    AC_MSG_RESULT($ARCH)
 
214
fi
 
215
#
 
216
# check for valid architecture.  Use __ so that _ALPHA_ does not match
 
217
# LINUX_ALPHA_
 
218
#### WE SHOULD REMOVE THIS SOON
 
219
grep __"$ARCH"_ $srcdir/.config_params > /dev/null 2>&1
 
220
if test $? != 0 ; then
 
221
   AC_MSG_WARN([Unknown architecture $arch... proceeding anyway])
 
222
fi
 
223
#
 
224
#
 
225
# Find the home directory if not specified
 
226
if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then 
 
227
    ROMIO_HOME_TRIAL=$srcdir
 
228
else
 
229
    # Take advantage of autoconf2 features
 
230
    if test -n "$ac_confdir" ; then
 
231
        ROMIO_HOME_TRIAL=$ac_confdir
 
232
    else
 
233
        if test -s configure ; then
 
234
            ROMIO_HOME_TRIAL=`pwd`
 
235
        else
 
236
            ac_confdir=`dirname "$0" 2>/dev/null`
 
237
            if test -n "$ac_confdir" ; then
 
238
                ROMIO_HOME_TRIAL=$ac_confdir
 
239
            fi
 
240
        fi
 
241
    fi
 
242
fi
 
243
AC_MSG_RESULT([ROMIO home directory is $ROMIO_HOME_TRIAL])
 
244
ROMIO_HOME=$ROMIO_HOME_TRIAL
 
245
 
 
246
# get a fully qualified pathname for our build directory
 
247
top_build_dir=`pwd`
 
248
# used in romioinstall
 
249
AC_SUBST(top_build_dir)
 
250
 
 
251
# Open MPI: these shouldn't be needed with AM
 
252
#
 
253
# Create the "autoconf" style directory names...
 
254
# Most of these are done for us; add the documentation directories
 
255
#
 
256
# mandir is the root for the man pages
 
257
#if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
 
258
#AC_SUBST(mandir)
 
259
#if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
 
260
#AC_SUBST(docdir)
 
261
#if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
 
262
#AC_SUBST(htmldir) 
 
263
#
 
264
# check for valid file system
 
265
if test -n "$FILE_SYSTEM" ; then
 
266
   # if multiple filesystems are passed in, they are '+'-delimited
 
267
   # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var
 
268
   # is used in multiple places in the build system: get rid of the '+'s so we
 
269
   # can use the 'for x in $FILE_SYSTEM ...' idiom 
 
270
   FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'`
 
271
   for x in $FILE_SYSTEM
 
272
   do
 
273
      found=no
 
274
      # We could also do test -d "ad_$y" to test for known file systems
 
275
      # based on having access to the adio code.  Then adding a file 
 
276
      # system would not require changing configure to change known_filesystems
 
277
      for y in $known_filesystems ; do 
 
278
          if test $x = $y ; then
 
279
              found=yes
 
280
              eval "file_system_`echo $x`=1"
 
281
              break
 
282
          fi
 
283
      done
 
284
      if test "$found" = "no" ; then
 
285
         AC_MSG_WARN([Unknown file system $x... proceeding anyway])
 
286
      fi
 
287
   done
 
288
fi
 
289
#
 
290
# If we are building within a known MPI implementation, we must avoid the
 
291
# tests about an existing implementation
 
292
if test "$FROM_MPICH" != no -o "$FROM_MPICH2" != no -o "$FROM_LAM" != no ; then
 
293
    WITHIN_KNOWN_MPI_IMPL=yes
 
294
else
 
295
    WITHIN_KNOWN_MPI_IMPL=no
 
296
fi
 
297
 
 
298
# Open MPI: Make it think we're a known MPI implementation
 
299
WITHIN_KNOWN_MPI_IMPL=yes
 
300
 
 
301
# check for valid MPI implementation
 
302
if test -n "$MPI" ; then
 
303
   found=no
 
304
   for mpi in $known_mpi_impls ; do
 
305
      if test "${MPI}_mpi" = "$mpi" ; then
 
306
          found=yes
 
307
          break
 
308
      fi
 
309
   done
 
310
   if test $found = no ; then
 
311
      AC_MSG_WARN([Unknown MPI implementation $MPI... proceeding anyway])
 
312
   fi
 
313
fi
 
314
#
 
315
# check for valid MPI include directory if specified
 
316
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
317
   if test -n "$MPI_INCLUDE_DIR"; then
 
318
      if test ! -f "$MPI_INCLUDE_DIR/mpi.h" ; then
 
319
         AC_MSG_ERROR([Include file $MPI_INCLUDE_DIR/mpi.h not found])
 
320
      fi
 
321
   else
 
322
#     assume that mpi.h is in the default path
 
323
#     set MPI_INCLUDE_DIR to ".", so that it translates to -I. in the
 
324
#     compile command. Some compilers complain if it's only -I
 
325
      MPI_INCLUDE_DIR=.
 
326
   fi
 
327
else 
 
328
   MPI_INCLUDE_DIR=.
 
329
fi
 
330
#
 
331
# check for valid MPI library if specified
 
332
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
333
   if test -n "$MPI_LIB" ; then
 
334
      if test ! -f "$MPI_LIB" ; then
 
335
         AC_MSG_ERROR([MPI library $MPI_LIB not found])
 
336
      fi
 
337
   fi
 
338
fi
 
339
#
 
340
#
 
341
# Open MPI - bad for Automake
 
342
#AR="${AR:-ar} cr$AR_LOCAL"
 
343
# Open MPI - don't test for ranlib - use AC_PROG_RANLIB all the time
 
344
#if test -z "$RANLIB" ; then
 
345
    AC_PROG_RANLIB
 
346
#fi
 
347
# Open MPI - don't set make
 
348
# MAKE=${MAKE:-make}
 
349
#
 
350
# USER_CFLAGS and USER_FFLAGS are used only in test/Makefile.in
 
351
if test $DEBUG = "yes"; then
 
352
    USER_CFLAGS="$CFLAGS -g"
 
353
    USER_FFLAGS="$FFLAGS -g"
 
354
else
 
355
    USER_CFLAGS="$CFLAGS -O"
 
356
    USER_FFLAGS="$FFLAGS -O"
 
357
fi
 
358
#
 
359
# Here begin the architecture-specific tests.  
 
360
# --------------------------------------------------------------------------
 
361
# We must first select the C and Fortran compilers.  Because of the 
 
362
# way that the PROG_CC autoconf macro works (and all of the macros that
 
363
# require it, including CHECK_HEADERS), that macro must occur exactly
 
364
# once in the configure.in file, at least as of autoconf 2.57 .  
 
365
# Unfortunately, this requirement is not enforced.  To handle this,
 
366
# we first case on the architecture; then use PROG_CC, then case on the
 
367
# architecture again for any arch-specific features.  We also set the
 
368
# C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected.
 
369
 
370
# For the MPICH and MPICH2 configures, the compilers will already be
 
371
# selected, so most of the compiler-selection code will be bypassed.
 
372
# --------------------------------------------------------------------------
 
373
# For historical reasons
 
374
if test -z "$FC" ; then 
 
375
    FC=$F77
 
376
fi
 
377
#
 
378
C_DEBUG_FLAG="-g"
 
379
F77_DEBUG_FLAG="-g"
 
380
C_OPT_FLAG=${CFLAGS:-"-O"}
 
381
# MPICH1 uses OPTFLAGS and OPTFLAGSC to specify separate optimization
 
382
# flags for the C compiler (this is better that adding it to the
 
383
# undifferentiated CFLAGS, at least on input).
 
384
if test -n "$OPTFLAGS" ; then
 
385
    C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGS"
 
386
fi
 
387
if test -n "$OPTFLAGSC" ; then
 
388
    C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGSC"
 
389
fi
 
390
# Open MPI: ignore all setting of CC, f77, FC, etc. in this section
 
391
case $ARCH in 
 
392
     solaris|solaris86)
 
393
     #CC=${CC:-cc}
 
394
     #F77=${FC:-f77}
 
395
     if test "$CC" != "gcc" ; then
 
396
        C_DEBUG_FLAG="-g -v"
 
397
     fi
 
398
     ;;
 
399
     
 
400
     rs6000)
 
401
     #F77=${FC}
 
402
     # Try to use mpcc if no CC specified
 
403
     #AC_PROGRAMS_CHECK(CC, mpcc, cc)
 
404
     #if test $NOF77 = 0 && test -z "$F77"; then 
 
405
     #   AC_PROGRAMS_CHECK(F77, mpxlf, f77)
 
406
     #fi
 
407
     ;;
 
408
 
 
409
     tflop|tflops)
 
410
     #CC=${CC:-pgcc}
 
411
     #F77=${FC:-pgf77}
 
412
     CFLAGS="$CFLAGS -cougar -D__PUMA"
 
413
     if test "$CC" = "pgcc" ; then
 
414
         C_OPT_FLAG="-Knoieee -Mvect -O3"
 
415
     fi
 
416
     ;;
 
417
     
 
418
     freebsd|LINUX|netbsd|openbsd|LINUX_ALPHA)
 
419
     #CC=${CC:-gcc}
 
420
     # Let the prog_f77 file g77/f77/others
 
421
     #F77=${FC} 
 
422
     ;;
 
423
 
 
424
     SX4)
 
425
     #CC=${CC:-mpicc}
 
426
     #F77=${FC:-mpif90}
 
427
     #if test $DEBUG != "yes" ; then
 
428
     #   USER_FFLAGS="$FFLAGS -Chopt"
 
429
     #   F77_OPT_FLAG="-Chopt"
 
430
     #fi
 
431
    ;;
 
432
 
 
433
    hpux|sppux)
 
434
    C_DEBUG_FLAG="-g +w1"
 
435
    ;;
 
436
 
 
437
    alpha|ALPHA)
 
438
    #CC=${CC:-cc}
 
439
    #F77=${FC:-f77}
 
440
    #dnl CFLAGS="$CFLAGS -g -std1 -warnprotos -verbose"
 
441
    #C_DEBUG_FLAG="-g -verbose"
 
442
    ;;
 
443
 
 
444
    CRAY)
 
445
    #CC=${CC:-cc}
 
446
    #F77=${FC:-f90}
 
447
    #NOF77=1
 
448
    CFLAGS="$CFLAGS -D_UNICOS"
 
449
    ;;
 
450
 
 
451
    sgi|IRIX64|IRIX32|IRIXN32)
 
452
    arch_IRIX=1
 
453
    #CC=${CC:-cc}
 
454
    #F77=${FC:-f77}
 
455
    #C_DEBUG_FLAG="-g -fullwarn"
 
456
    ;;
 
457
 
 
458
    sgi5)
 
459
    ;;
 
460
 
 
461
    *)
 
462
    # Fall-through case.  Take FC 
 
463
    #F77=${FC:-f77}
 
464
    ;;
 
465
esac
 
466
 
 
467
AC_PROG_CC
 
468
if test "$NOF77" != 1 ; then
 
469
    # Grrr.   The autoconf test for F77 will abort the configure
 
470
    # if no compiler is found.  We'd prefer to simply turn off
 
471
    # support for Fortran, and/or give a more informative message.
 
472
    AC_PROG_F77
 
473
fi
 
474
if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then
 
475
     C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes"
 
476
fi
 
477
if test $DEBUG = "yes" ; then
 
478
    CFLAGS="$CFLAGS $C_DEBUG_FLAG"
 
479
# Open MPI: don't add optflags - they'll come from the top-level configure
 
480
#else 
 
481
#    CFLAGS="$CFLAGS $C_OPT_FLAG"
 
482
fi
 
483
 
 
484
# ---------------------------------------------------------------------------
 
485
# Here go the rest of the tests
 
486
# ---------------------------------------------------------------------------
 
487
if test -n "$arch_solaris" || test -n "$arch_solaris86" ; then
 
488
    if test -z "$MPI" ; then
 
489
        MPI=mpich
 
490
        mpi_mpich=1
 
491
    fi
 
492
    if test $MPI = "mpich" ; then
 
493
        TEST_CC=mpicc
 
494
        TEST_F77=mpif77
 
495
    else
 
496
        TEST_CC="$CC"
 
497
        TEST_F77="$F77"
 
498
    fi
 
499
    #OMPI: Bad for automake: AR="ar cr"
 
500
# solaris does not have l option to ar
 
501
fi
 
502
 
 
503
 
 
504
if test -n "$arch_rs6000"; then
 
505
    if test -z "$MPI" ; then
 
506
        MPI=mpich
 
507
        mpi_mpich=1
 
508
    fi
 
509
    AC_DEFINE(AIX,1,[Define for AIX])
 
510
# assume long long exists.
 
511
    longlongsize=${longlongsize:-8} 
 
512
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
513
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
514
fi    
 
515
#
 
516
 
 
517
if test -n "$arch_tflop" || test -n "$arch_tflops"; then
 
518
    # TFLOP_FLAGS="-cougar -D__PUMA"
 
519
    #OMPI: Bad for automake: AR="xar cr$AR_LOCAL"
 
520
    #OMPI: Bad for automake: RANLIB="xranlib"
 
521
    MPI_LIB="$MPI_LIB"
 
522
    if test -z "$MPI" ; then
 
523
        MPI=mpich
 
524
        mpi_mpich=1
 
525
    fi
 
526
    if test -z "$FILE_SYSTEM" ; then
 
527
        file_system_ufs=1
 
528
        FILE_SYSTEM="ufs"
 
529
    fi
 
530
fi
 
531
#
 
532
if test -n "$arch_freebsd" || test -n "$arch_LINUX" || test -n "$arch_LINUX_ALPHA" || test -n "$arch_netbsd" || test -n "$arch_openbsd" ; then
 
533
    if test -n "$arch_freebsd" || test -n "$arch_netbsd" || test -n "$arch_openbsd"; then
 
534
        longlongsize=${longlongsize:-0}
 
535
        # printf doesn't work properly and no integer*8 as far as I can tell
 
536
    fi
 
537
    # Find the CPP before the header check
 
538
    AC_PROG_CPP
 
539
    if test -z "$MPI" ; then
 
540
        MPI=mpich
 
541
        mpi_mpich=1
 
542
    fi
 
543
fi    
 
544
#
 
545
if test -n "$arch_SX4" ; then
 
546
    have_aio=no
 
547
    AC_DEFINE(SX4,1,[Define for NEC SX4])
 
548
    if test -z "$MPI" ; then
 
549
        MPI=mpich
 
550
        mpi_mpich=1
 
551
    fi
 
552
    if test -z "$FILE_SYSTEM" ; then
 
553
        file_system_sfs=1
 
554
        file_system_nfs=1
 
555
        FILE_SYSTEM="sfs nfs"
 
556
    fi
 
557
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
558
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
559
fi
 
560
#
 
561
if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
 
562
    have_aio=no
 
563
    #OMPI: Bad for automake: RANLIB=":"
 
564
    if test -z "$MPI"; then
 
565
        if test -f "/opt/mpi/include/mpi.h" ; then
 
566
            echo "assuming that you want to use ROMIO with HP MPI"
 
567
            MPI=hp
 
568
        else 
 
569
            echo "assuming that you want to use ROMIO with MPICH"
 
570
            MPI=mpich
 
571
        fi            
 
572
    fi
 
573
    if test $MPI = "mpich" ; then
 
574
        mpi_mpich=1
 
575
        MPI_LIB="$MPI_LIB -lV3"
 
576
        CC=${CC:-cc -Ae}
 
577
        F77=${FC:-f77 +U77}
 
578
    fi
 
579
    if test $MPI = "hp" ; then
 
580
        mpi_hp=1
 
581
        CC=${CC:-mpicc -Ae}
 
582
        F77=${FC:-mpif77 +U77}
 
583
    fi
 
584
    if test $MPI = "lam" && test "$FC" != ""; then
 
585
        F77="$F77 +U77"
 
586
    fi
 
587
    FTESTDEFINE="external iargc, getarg"
 
588
    if test -n "$arch_hpux" ; then
 
589
        CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
 
590
        AC_DEFINE(HPUX,1,[Define for HPUX])
 
591
        if test $MPI = "hp" ; then
 
592
           F77=${FC:-mpif90 +U77}
 
593
        else
 
594
           F77=${FC:-f90 +U77}
 
595
        fi
 
596
    else
 
597
        AC_DEFINE(SPPUX,1,[Define for SPPUX (Convex)])
 
598
    fi
 
599
 
 
600
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
601
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
602
    if test "$CC" != "gcc" ; then
 
603
        ROMIO_TCFLAGS="-Ae"
 
604
    fi
 
605
    if test "$F77" != "g77" ; then
 
606
        ROMIO_TFFLAGS="+U77"
 
607
    fi
 
608
fi
 
609
#
 
610
if test -n "$arch_alpha" || test -n "$arch_ALPHA" ; then
 
611
    if test -z "$MPI" ; then
 
612
        MPI=mpich
 
613
        mpi_mpich=1
 
614
    fi
 
615
 
 
616
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
617
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
618
    ROMIO_LIBLIST="$ROMIO_LIBLIST -laio"
 
619
fi    
 
620
#
 
621
if test -n "$arch_CRAY" ; then
 
622
    NOF77=1
 
623
    FTESTDEFINE="integer ilen"
 
624
    F77GETARG="call pxfgetarg(i, str, ilen, ierr)"
 
625
    have_aio=no
 
626
    # OMPI: bad for automake: RANLIB=":"
 
627
    AC_DEFINE(CRAY,1,[Define if Cray])
 
628
    if test -z "$MPI" || test -n "$mpi_sgi" ; then
 
629
        MPI=cray
 
630
        mpi_cray=1
 
631
        mpi_sgi=""
 
632
# above is to disable configure tests specific to SGI MPI
 
633
        AC_DEFINE(MPISGI,1,[Define if SGI MPI])
 
634
        AC_DEFINE(HAVE_MPI_COMBINERS,1,[Define if MPI supports datatype combiners])
 
635
        AC_DEFINE(NO_MPI_SGI_type_is_contig,1,[Define if no types show contig])
 
636
    fi
 
637
#       MPISGI needed because of error in Cray's and SGI's 
 
638
#       MPI_Type_get_contents (does not increment reference count).
 
639
#       Others needed because MPISGI needed.
 
640
 
 
641
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
642
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
643
fi
 
644
#
 
645
if test -n "$arch_sgi" ; then
 
646
    arch_IRIX=1
 
647
    ARCH=IRIX
 
648
fi
 
649
if test -n "$arch_IRIX64" || test -n "$arch_IRIX32" || test -n "$arch_IRIXN32" ; then
 
650
    arch_IRIX=1
 
651
fi
 
652
if test -n "$arch_sgi5" ; then
 
653
    arch_IRIX5=1
 
654
    ARCH=IRIX
 
655
fi
 
656
#
 
657
PAC_GET_SPECIAL_SYSTEM_INFO
 
658
#
 
659
# special case 'sgi5' for use on MESHINE which is much like an SGI running
 
660
# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
 
661
# work
 
662
if test -n "$arch_sgi5"; then
 
663
   osversion=5
 
664
   cputype=4400
 
665
   IRIXARCH="$ARCH_$osversion"
 
666
   IRIXARCH="$IRIXARCH_$cputype"
 
667
# now set arch_IRIX to 1
 
668
   arch_IRIX=1
 
669
   echo "IRIX-specific architecture is $IRIXARCH"
 
670
   AC_DEFINE(IRIX,1,[Define if IRIX])
 
671
fi
 
672
#
 
673
if test -n "$arch_IRIX"; then
 
674
   if test $osversion = 4 ; then
 
675
        # OMPI: Bad for automake:RANLIB="ar ts"
 
676
        if test -n "$mpi_sgi"; then
 
677
            AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 4.x])
 
678
        fi
 
679
   elif test $osversion = 5 ; then
 
680
        if test -n "$mpi_sgi"; then
 
681
            AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 5.x])
 
682
        fi
 
683
   elif test $osversion = 6 ; then
 
684
        if test -z "$MPI"; then
 
685
            if test "$FROM_MPICH2" = "yes" ; then
 
686
                # Building with MPICH2.  Distinguish from MPICH-1
 
687
                MPI=mpich2
 
688
                mpi_mpich2=1
 
689
            elif test -f "/usr/include/mpi.h" ; then
 
690
                AC_MSG_WARN([assuming that you want to use ROMIO with SGI\'s MPI])
 
691
                MPI=sgi
 
692
                mpi_sgi=1
 
693
            else 
 
694
                AC_MSG_WARN([assuming that you want to use ROMIO with MPICH])
 
695
                MPI=mpich
 
696
                mpi_mpich=1
 
697
            fi            
 
698
        fi
 
699
        #OMPI: Bad for automake: RANLIB=":"
 
700
        AC_DEFINE(AIO_SIGNOTIFY_NONE,1,[Define if no signotify])
 
701
        if test $cputype -ge 5000 ; then
 
702
            MIPS=4
 
703
        else 
 
704
            MIPS=3
 
705
        fi
 
706
   fi
 
707
   if test -n "$mpi_sgi" && test -z "$MPI_LIB" ; then
 
708
       MPI_LIB="-lmpi"
 
709
   fi
 
710
#  check if pread64 is defined
 
711
   PAC_HAVE_PREAD64
 
712
#
 
713
   if test -z "$FILE_SYSTEM" ; then
 
714
       file_system_nfs=1
 
715
       FILE_SYSTEM="nfs"
 
716
       AC_MSG_CHECKING(for xfs)
 
717
       AC_TRY_COMPILE([
 
718
#include <aio.h>],
 
719
[aiocb64_t *t1;],file_system_xfs=1;FILE_SYSTEM="xfs $FILE_SYSTEM";)
 
720
       if test "$file_system_xfs" = 1 ; then 
 
721
          AC_MSG_RESULT(yes)
 
722
       else
 
723
          AC_MSG_RESULT(no)
 
724
          file_system_ufs=1
 
725
          FILE_SYSTEM="ufs $FILE_SYSTEM"
 
726
       fi
 
727
   fi
 
728
   AC_DEFINE(IRIX,1,[Define if IRIX])
 
729
   MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
 
730
   MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
 
731
fi
 
732
 
 
733
AC_HAVE_FUNCS(memalign)
 
734
 
 
735
#
 
736
# Question: Should ROMIO under MPICH2 ignore the Fortran tests, since 
 
737
# MPICH2 provides all of the Fortran interface routines?
 
738
#
 
739
if test $NOF77 = 0 ; then
 
740
    echo "checking Fortran external names"
 
741
    PAC_GET_FORTNAMES
 
742
    if test -n "$WDEF" ; then
 
743
        CFLAGS="$CFLAGS $WDEF"
 
744
    fi
 
745
    dnl PAC_PROG_F77_NAME_MANGLE
 
746
    dnl (need to set the new name format)
 
747
    rm -f test/mpif.h
 
748
    if test "$MPI_INCLUDE_DIR" != "." && test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
749
        if test ! -d test ; then mkdir test ; fi
 
750
        ln -s $MPI_INCLUDE_DIR/mpif.h test
 
751
    fi
 
752
else 
 
753
    F77=":"
 
754
fi
 
755
#
 
756
# Open MPI: We already do this test top-level
 
757
dnl AC_C_INLINE
 
758
 
 
759
# Header files
 
760
# Find the CPP before the header check
 
761
AC_PROG_CPP
 
762
AC_CHECK_HEADERS(unistd.h fcntl.h malloc.h stddef.h)
 
763
#
 
764
CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-0}
 
765
CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-0}
 
766
AC_CHECK_SIZEOF(int,$CROSS_SIZEOF_INT)
 
767
AC_CHECK_SIZEOF(void*,$CROSS_SIZEOF_VOID_P)
 
768
AC_CACHE_CHECK([for int large enough for pointers],
 
769
pac_cv_int_hold_pointer,[
 
770
if test "$ac_cv_sizeof_int" = "0" -o \
 
771
        "$ac_cv_sizeof_voidp" = "0" ; then
 
772
    pac_cv_int_hold_pointer=unknown
 
773
elif test "$ac_cv_sizeof_int" -lt "$ac_cv_sizeof_voidp" ; then
 
774
    pac_cv_int_hold_pointer=no
 
775
else
 
776
    pac_cv_int_hold_pointer=yes
 
777
fi
 
778
])
 
779
if test "$pac_cv_int_hold_pointer" != yes ; then
 
780
    AC_DEFINE(INT_LT_POINTER,1,[Define if int smaller than pointer])
 
781
fi
 
782
#
 
783
dnl The original ROMIO configure used a set of complex tests here; this
 
784
dnl is a partial reworking using the autoconf2 sizeof macros, and allowing
 
785
dnl for the standardized CROSS_xxx varaibles for cross-compilation environments
 
786
# LL is the printf-style format name for output of a MPI_Offset.
 
787
# We have to match this to the type that we use for MPI_Offset.
 
788
CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-0}
 
789
AC_CHECK_SIZEOF(long long,$CROSS_SIZEOF_LONG_LONG)
 
790
if test "$ac_cv_sizeof_long_long" != 0 ; then
 
791
    if test "$ac_cv_sizeof_long_long" = "8" ; then
 
792
       AC_DEFINE(HAVE_LONG_LONG_64,1,[Define if long long is 64 bits])
 
793
       MPI_OFFSET_TYPE="long long"
 
794
       DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
 
795
       FORTRAN_MPI_OFFSET="integer*8"
 
796
       LL="lld"
 
797
    elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_int" ; then
 
798
       MPI_OFFSET_TYPE="int"
 
799
       DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
 
800
       FORTRAN_MPI_OFFSET="integer"
 
801
       AC_DEFINE(MPI_OFFSET_IS_INT,1,[Define if MPI_Offset is int])
 
802
       LL="d"
 
803
       MPI_OFFSET_KIND1="!"
 
804
       MPI_OFFSET_KIND2="!"
 
805
    else
 
806
       echo "defining MPI_Offset as long in C and integer in Fortran" 
 
807
       MPI_OFFSET_TYPE="long"
 
808
       DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
 
809
       FORTRAN_MPI_OFFSET="integer"
 
810
       LL="ld"
 
811
       MPI_OFFSET_KIND1="!"
 
812
       MPI_OFFSET_KIND2="!"
 
813
    fi
 
814
else
 
815
    echo "defining MPI_Offset as long in C and integer in Fortran" 
 
816
    MPI_OFFSET_TYPE="long"
 
817
    DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
 
818
    FORTRAN_MPI_OFFSET="integer"
 
819
    LL="ld"
 
820
    MPI_OFFSET_KIND1="!"
 
821
    MPI_OFFSET_KIND2="!"
 
822
fi
 
823
 
 
824
 
 
825
#
 
826
if test -n "$longlongsize"; then
 
827
   if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
828
       PAC_MPI_LONG_LONG_INT
 
829
   else
 
830
       AC_DEFINE(HAVE_MPI_LONG_LONG_INT,1,[Define if supports long long int])
 
831
   fi
 
832
fi
 
833
#
 
834
if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then 
 
835
  MPI_OFFSET_KIND1="        INTEGER MPI_OFFSET_KIND"
 
836
  MPI_OFFSET_KIND2="        PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)"
 
837
else
 
838
 if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
 
839
   PAC_MPI_OFFSET_KIND
 
840
 fi
 
841
 #
 
842
  if test "$FORTRAN_MPI_OFFSET" = "integer" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
 
843
   PAC_MPI_OFFSET_KIND_4BYTE
 
844
  fi
 
845
fi
 
846
#
 
847
# check if MPI_Info functions are defined in the MPI implementation
 
848
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
849
   PAC_MPI_INFO
 
850
else
 
851
   AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI Info is available])
 
852
   HAVE_MPI_INFO="#define HAVE_MPI_INFO"
 
853
   MPI_FINFO1="!"
 
854
   MPI_FINFO2="!"
 
855
   MPI_FINFO3="!"
 
856
   MPI_FINFO4="!"
 
857
fi   
 
858
#
 
859
if test -n "$mpi_sgi"; then
 
860
dnl   if test -z "$HAVE_MPI_INFO" ; then
 
861
dnl      PAC_CHECK_MPI_SGI_INFO_NULL  # is MPI_INFO_NULL defined in mpi.h?
 
862
dnl   fi
 
863
   PAC_TEST_MPI_SGI_type_is_contig
 
864
   PAC_TEST_MPI_COMBINERS
 
865
   PAC_TEST_MPI_HAVE_OFFSET_KIND
 
866
fi
 
867
#
 
868
# check if darray and subarray constructors are defined in the MPI 
 
869
# implementation 
 
870
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
871
   PAC_MPI_DARRAY_SUBARRAY
 
872
fi
 
873
if test $FROM_MPICH2 = yes ; then
 
874
   dnl Made this a message instead of a warning because the warning is
 
875
   dnl likely to confuse users.
 
876
   AC_MSG_RESULT([Overriding Array test for MPICH2])
 
877
   unset BUILD_MPI_ARRAY
 
878
   AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available])
 
879
   HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
 
880
   MPI_FARRAY1="!"
 
881
   MPI_FARRAY2="!"
 
882
   MPI_FARRAY3="!"
 
883
   MPI_FARRAY4="!"
 
884
   MPI_FARRAY5="!"
 
885
   MPI_FARRAY6="!"
 
886
   MPI_FARRAY7="!"
 
887
fi   
 
888
#
 
889
#
 
890
# Test for weak symbol support...
 
891
# We can't put # in the message because it causes autoconf to generate
 
892
# incorrect code
 
893
HAVE_WEAK_SYMBOLS=0
 
894
if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
 
895
# multiple secondary definitions not allowed by HP compilers
 
896
# Fortran interface for HP already uses one secondary defn. 
 
897
# therefore, do not use this method for profiling interface.
 
898
# build profiling interface explicitly.
 
899
   TRY_WEAK_SYMBOLS=0
 
900
fi
 
901
if test $TRY_WEAK_SYMBOLS = 1 ; then
 
902
  AC_MSG_CHECKING([for weak symbol support])
 
903
  AC_TRY_LINK([
 
904
extern int PFoo(int);
 
905
#pragma weak PFoo = Foo
 
906
int Foo(int a) { return a; }
 
907
],[return PFoo(1);],has_pragma_weak=1)
 
908
  #
 
909
  # Some systems (Linux ia64 and ecc, for example), support weak symbols
 
910
  # only within a single object file!  This tests that case.
 
911
  # Note that there is an extern int PFoo declaration before the
 
912
  # pragma.  Some compilers require this in order to make the weak symbol
 
913
  # extenally visible.  
 
914
if test "$has_pragma_weak" = 1 ; then
 
915
    AC_MSG_RESULT([pragma weak])
 
916
    AC_MSG_CHECKING([that weak symbols are visible to other files])
 
917
    rm -f conftest*
 
918
    cat >>conftest1.c <<EOF
 
919
extern int PFoo(int);
 
920
#pragma weak PFoo = Foo
 
921
int Foo(int);
 
922
int Foo(int a) { return a; }
 
923
EOF
 
924
    cat >>conftest2.c <<EOF
 
925
extern int PFoo(int);
 
926
int main(int argc, char **argv) {
 
927
return PFoo(0);}
 
928
EOF
 
929
    ac_link2='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
 
930
    if eval $ac_link2 ; then
 
931
        AC_MSG_RESULT(yes)
 
932
    else
 
933
      echo "$ac_link2" 1>&AC_FD_CC
 
934
      echo "Failed program was" 1>&AC_FD_CC
 
935
      cat conftest1.c 1>&AC_FD_CC
 
936
      cat conftest2.c 1>&AC_FD_CC
 
937
      if test -s conftest.out ; then cat conftest.out 1>&AC_FD_CC ; fi
 
938
      AC_MSG_RESULT(no)
 
939
      has_pragma_weak=0
 
940
    fi
 
941
    rm -f conftest*
 
942
  fi
 
943
  if test "$has_pragma_weak" = 1 ; then
 
944
    HAVE_WEAK_SYMBOLS=1
 
945
    AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Define if pragma weak available])
 
946
  else
 
947
    AC_TRY_LINK([
 
948
extern int PFoo(int);
 
949
#pragma _HP_SECONDARY_DEF Foo PFoo
 
950
int Foo(int a) { return a; }
 
951
],[return PFoo(1);],has_pragma_hp_secondary=1)
 
952
    if test "$has_pragma_hp_secondary" = 1 ; then 
 
953
        AC_MSG_RESULT([pragma _HP_SECONDARY_DEF])
 
954
        HAVE_WEAK_SYMBOLS=1
 
955
        AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[Define for HP weak pragma])
 
956
    else
 
957
        AC_TRY_LINK([
 
958
extern int PFoo(int);
 
959
#pragma _CRI duplicate PFoo as Foo
 
960
int Foo(int a) { return a; }
 
961
],[return PFoo(1);],has_pragma_cri_duplicate=1)
 
962
        if test "$has_pragma_cri_duplicate" = 1 ; then
 
963
            AC_MSG_RESULT([pragma _CRI duplicate x as y])
 
964
            HAVE_WEAK_SYMBOLS=1
 
965
            AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Define for CRAY weak dup])
 
966
        else    
 
967
            AC_MSG_RESULT(no)
 
968
        fi
 
969
    fi
 
970
  fi
 
971
fi
 
972
if test "$HAVE_WEAK_SYMBOLS" = 1 ; then
 
973
    AC_DEFINE(HAVE_WEAK_SYMBOLS,1,[Define if weak symbols available])
 
974
fi
 
975
AC_SUBST(HAVE_WEAK_SYMBOLS)
 
976
 
 
977
 
 
978
 
 
979
#
 
980
# Check whether the MPI Offset type is compatible with struct flock
 
981
AC_MSG_CHECKING([whether struct flock compatible with MPI_Offset])
 
982
AC_TRY_COMPILE([#include <fcntl.h>],
 
983
[struct flock l;
 
984
 $MPI_OFFSET_TYPE a=1;
 
985
 l.l_start = a; 
 
986
 l.l_len   = a;
 
987
],pac_cv_struct_flock_and_mpi_offset=yes,pac_cv_struct_flock_and_mpi_offset=no)
 
988
AC_MSG_RESULT($pac_cv_struct_flock_and_mpi_offset)
 
989
# FIXME: We should look for struct flock64 and the F_SETLK64/F_GETLK64
 
990
# ADIOI_Set_lock could use these instead.
 
991
if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then
 
992
    AC_MSG_CHECKING([whether struct flock compatible with int])
 
993
    AC_TRY_COMPILE([#include <fcntl.h>],
 
994
[struct flock l;
 
995
 int a=1;
 
996
 l.l_start = a; 
 
997
 l.l_len   = a;
 
998
],pac_cv_struct_flock_and_int=yes,pac_cv_struct_flock_and_int=no)
 
999
    AC_MSG_RESULT($pac_cv_struct_flock_and_int)
 
1000
    if test "$pac_cv_struct_flock_and_int" = yes ; then
 
1001
        AC_DEFINE(NEEDS_INT_CAST_WITH_FLOCK,1,[Define if l_start and l_len data should be cast as int])
 
1002
    fi
 
1003
    # FIXME.  Solaris header files define off_t as a UNION if 64bit file
 
1004
    # sizes are selected.  Gah!
 
1005
fi
 
1006
 
 
1007
#
 
1008
# if FILE_SYSTEM is not set above, use ufs and nfs as default
 
1009
#
 
1010
if test -z "$FILE_SYSTEM" ; then
 
1011
    file_system_ufs=1
 
1012
    file_system_nfs=1
 
1013
    FILE_SYSTEM="ufs nfs"
 
1014
fi
 
1015
 
 
1016
# no matter what, always build testfs
 
1017
file_system_testfs=1
 
1018
FILE_SYSTEM="testfs $FILE_SYSTEM"
 
1019
 
 
1020
#
 
1021
# Print list of configured file systems
 
1022
#
 
1023
# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW?
 
1024
#
 
1025
AC_MSG_CHECKING([configured file systems])
 
1026
AC_MSG_RESULT([$FILE_SYSTEM])
 
1027
 
 
1028
if test -n "$file_system_nfs" ; then
 
1029
    AC_DEFINE(ROMIO_NFS,1,[Define for ROMIO with NFS])
 
1030
    AC_MSG_WARN([File locks may not work with NFS.  See the Installation and
 
1031
users manual for instructions on testing and if necessary fixing this])
 
1032
fi
 
1033
 
 
1034
if test -n "$file_system_panfs"; then
 
1035
    AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS])
 
1036
fi
 
1037
if test -n "$file_system_ufs"; then
 
1038
    AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])
 
1039
fi
 
1040
if test -n "$file_system_hfs"; then
 
1041
    AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS])
 
1042
fi
 
1043
if test -n "$file_system_sfs"; then
 
1044
    AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS])
 
1045
fi
 
1046
 
 
1047
if test -n "$file_system_pfs"; then
 
1048
    AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS])
 
1049
fi
 
1050
 
 
1051
if test -n "$file_system_testfs"; then
 
1052
    AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS])
 
1053
fi
 
1054
 
 
1055
if test -n "$file_system_xfs"; then
 
1056
    AC_DEFINE(ROMIO_XFS,1,[Define for ROMIO with XFS])
 
1057
    # Check for memalign value
 
1058
    AC_CACHE_CHECK([for memory alignment needed for direct I/O],
 
1059
    pac_cv_memalignval,
 
1060
    [
 
1061
    /bin/rm -f confmemalignval
 
1062
    /bin/rm -f /tmp/romio_tmp.bin
 
1063
    AC_TRY_RUN([
 
1064
        #include <stdio.h>
 
1065
        #include <unistd.h>
 
1066
        #include <fcntl.h>
 
1067
        #include <stdio.h>
 
1068
        main() { 
 
1069
        struct dioattr st;
 
1070
        int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
 
1071
        FILE *f=fopen("confmemalignval","w");
 
1072
        if (fd == -1) exit(1);
 
1073
        if (!f) exit(1);
 
1074
        fcntl(fd, F_DIOINFO, &st);
 
1075
        fprintf( f, "%u\n", st.d_mem);
 
1076
        exit(0);
 
1077
        }
 
1078
        ],
 
1079
        pac_cv_memalignval=`cat confmemalignval`,
 
1080
        pac_cv_memalignval="unknown",pac_cv_memalignval="unknown"
 
1081
    )
 
1082
    /bin/rm -f confmemalignval
 
1083
    /bin/rm -f /tmp/romio_tmp.bin
 
1084
    ])
 
1085
    if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \
 
1086
        "$pac_cv_memalignval" != "unknown" ; then
 
1087
        CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval"
 
1088
    else
 
1089
        AC_MSG_RESULT(assuming 128 for memory alignment)
 
1090
        CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
 
1091
    fi
 
1092
fi
 
1093
 
 
1094
#
 
1095
# Verify presence of pvfs.h, issue with int64
 
1096
#
 
1097
if test -n "$file_system_pvfs"; then
 
1098
    CPPFLAGS="$CPPFLAGS $CFLAGS"
 
1099
    AC_CHECK_HEADERS(pvfs.h,
 
1100
        AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]),
 
1101
        AC_MSG_ERROR([PVFS support requested but cannot find pvfs.h header file])
 
1102
        )
 
1103
    # Check for missing int64_t (intel version 8 compiler and -no-gcc
 
1104
    # selected)
 
1105
    AC_MSG_CHECKING([that pvfs.h can be compiled])
 
1106
    AC_TRY_COMPILE([
 
1107
        #include <pvfs.h>
 
1108
        ],[
 
1109
        ],pvfs_header_ok=yes,pvfs_header_ok=no
 
1110
    )
 
1111
    AC_MSG_RESULT($pvfs_header_ok)
 
1112
    if test "$pvfs_header_ok" = no -a "$ac_cv_sizeof_long_long" = 8 ; then
 
1113
        AC_MSG_CHECKING([if pvfs.h can be compiled if we define int64_t])
 
1114
        # Try again, but with int64_t
 
1115
        AC_TRY_COMPILE([
 
1116
            typedef long long int int64_t;
 
1117
            #include <pvfs.h>
 
1118
            ],[
 
1119
            ],
 
1120
            pvfs_header_ok="yes with int64 definition"
 
1121
        )
 
1122
        AC_MSG_RESULT($pvfs_header_ok)
 
1123
    fi
 
1124
    if test "$pvfs_header_ok" = "yes with int64 definition" ; then
 
1125
        AC_DEFINE(ROMIO_PVFS_NEEDS_INT64_DEFINITION,1,[Define if int64_t must be defined for PVFS])
 
1126
    fi
 
1127
    if test "$pvfs_header_ok" != "no" ; then
 
1128
        AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS])
 
1129
        AC_DEFINE(HAVE_PVFS_SUPER_MAGIC, 1, [Define if PVFS_SUPER_MAGIC defined.])
 
1130
    else
 
1131
        AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support)
 
1132
    fi
 
1133
fi
 
1134
 
 
1135
#
 
1136
# Verify presence of pvfs2.h
 
1137
#
 
1138
if test -n "$file_system_pvfs2"; then
 
1139
    CPPFLAGS="$CPPFLAGS $CFLAGS"
 
1140
    AC_CHECK_HEADERS(pvfs2.h,
 
1141
        AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2])
 
1142
        AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]),
 
1143
        AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file])                                        
 
1144
    )
 
1145
fi
 
1146
 
 
1147
if test -n "$file_system_gridftp"; then
 
1148
        AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp])
 
1149
fi
 
1150
 
 
1151
#
 
1152
# Check for presence and characteristics of async. I/O calls if
 
1153
# not disabled.
 
1154
#
 
1155
# Q: Do we need to list some "other libs" to get things to link?
 
1156
#
 
1157
save_libs=$LIBS
 
1158
LIBS=
 
1159
#
 
1160
# Some systems need pthreads to get AIO to work
 
1161
#
 
1162
if test "x$disable_aio" = "xno" ; then
 
1163
    AC_SEARCH_LIBS(pthread_create,pthread,
 
1164
        ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
 
1165
        MPI_LIB="$MPI_LIB $LIBS"
 
1166
        )
 
1167
    LIBS=
 
1168
    AC_SEARCH_LIBS(aio_write,aio rt,
 
1169
        ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
 
1170
        MPI_LIB="$MPI_LIB $LIBS"
 
1171
        aio_write_found=yes
 
1172
    )
 
1173
fi
 
1174
LIBS=$save_libs
 
1175
 
 
1176
if test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then
 
1177
    AC_CHECK_HEADERS(signal.h)
 
1178
    # Just because aio.h is found by CPP doesn't mean that we can use it
 
1179
    # We try to compile it, not just read it.
 
1180
    AC_MSG_CHECKING([if aio.h exists and can be compiled])
 
1181
    AC_TRY_COMPILE([
 
1182
#include <aio.h>],
 
1183
[],have_aio_h=yes,have_aio_h=no)
 
1184
    AC_MSG_RESULT($have_aio_h)
 
1185
    if test "$have_aio_h" = yes ; then
 
1186
        AC_DEFINE(HAVE_AIO_H,1,[Define if aio.h exists and can be compiled])
 
1187
    fi
 
1188
 
 
1189
    AC_MSG_CHECKING([if sys/aio.h exists and can be compiled])
 
1190
    AC_TRY_COMPILE([
 
1191
#include <sys/aio.h>],
 
1192
[],have_sys_aio_h=yes,have_sys_aio_h=no)
 
1193
    AC_MSG_RESULT($have_sys_aio_h)
 
1194
    if test "$have_sys_aio_h" = yes ; then
 
1195
        AC_DEFINE(HAVE_SYS_AIO_H,1,[Define if sys/aio.h exists and can be compiled])
 
1196
    fi
 
1197
fi
 
1198
 
 
1199
if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then
 
1200
 
 
1201
    # Check that aio is available (many systems appear to have aio
 
1202
    # either installed improperly or turned off).
 
1203
    # The test is the following: if not cross compiling, try to run a 
 
1204
    # program that includes a *reference* to aio_write but does not call it
 
1205
    # If the libraries are not set up correctly, then this will fail.
 
1206
    save_libs=$LIBS
 
1207
    LIBS="$LIBS $ROMIO_LIBLIST"
 
1208
    AC_MSG_CHECKING([whether aio routines can be used])
 
1209
    # Include aio.h and the aiocb struct (since we'll need these to 
 
1210
    # actually use the aio_write interface).  Note that this will 
 
1211
    # fail for some pre-POSIX implementations of the aio interface 
 
1212
    # (an old IBM interface needs an fd argument as well)
 
1213
    AC_TRY_RUN([
 
1214
#include <sys/types.h>
 
1215
#ifdef HAVE_SIGNAL_H
 
1216
#include <signal.h>
 
1217
#endif
 
1218
#ifdef HAVE_AIO_H
 
1219
#include <aio.h>
 
1220
#endif
 
1221
#ifdef HAVE_SYS_AIO_H
 
1222
#include <sys/aio.h>
 
1223
#endif
 
1224
        int main(int argc, char **argv)
 
1225
        {
 
1226
            struct aiocb *aiocbp;
 
1227
            if (argc > 10) aio_write(aiocbp);
 
1228
            return 0;
 
1229
        }
 
1230
        ],
 
1231
        aio_runs=yes
 
1232
        AC_MSG_RESULT(yes),
 
1233
        aio_runs=no
 
1234
        AC_MSG_RESULT(no),
 
1235
        aio_runs=unknown
 
1236
        AC_MSG_RESULT(unknown)
 
1237
    )
 
1238
    if test "$aio_runs" != "no" ; then
 
1239
        AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
 
1240
    fi
 
1241
    
 
1242
    # now about that old IBM interface...
 
1243
    # modern AIO interfaces have the file descriptor in the aiocb structure,
 
1244
    # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES.  Old IBM
 
1245
    # implementations pass the file descriptor as an argument to aio_write and
 
1246
    # aio_read.  AIO still works on these platforms, but we have to test with
 
1247
    # two-argument aio_write to avoid a false negative.  no need to worry about
 
1248
    # the two-argument vs. one-argument aio_write and aio_read: ROMIO already
 
1249
    # uses ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES to call aio_write and
 
1250
    # aio_read correctly
 
1251
 
 
1252
    AC_MSG_CHECKING([for obsolete two-argument aio_write])
 
1253
    AC_TRY_RUN([
 
1254
#include <sys/types.h>
 
1255
#ifdef HAVE_SIGNAL_H
 
1256
#include <signal.h>
 
1257
#endif
 
1258
#ifdef HAVE_AIO_H
 
1259
#include <aio.h>
 
1260
#endif
 
1261
#ifdef HAVE_SYS_AIO_H
 
1262
#include <sys/aio.h>
 
1263
#endif
 
1264
        int main(int argc, char **argv)
 
1265
        {
 
1266
                int fd;
 
1267
                struct aiocb *aiocbp;
 
1268
                if (argc > 10) aio_write(fd, aiocbp);
 
1269
                return 0;
 
1270
        }
 
1271
        ],
 
1272
        aio_two_arg_write=yes
 
1273
        AC_MSG_RESULT(yes),
 
1274
        aio_two_arg_write=no 
 
1275
        AC_MSG_RESULT(no),
 
1276
        aio_two_arg_write=unknown
 
1277
        AC_MSG_RESULT(unknown)
 
1278
    )
 
1279
 
 
1280
    if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then
 
1281
        AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
 
1282
        AC_DEFINE(ROMIO_HAVE_AIO_CALLS_NEED_FILEDES, 1, Define if AIO calls need file descriptor)
 
1283
    fi
 
1284
 
 
1285
    AC_MSG_CHECKING([for obsolete two-argument aio_suspend])
 
1286
    AC_TRY_RUN([
 
1287
#include <sys/types.h>
 
1288
#ifdef HAVE_SIGNAL_H
 
1289
#include <signal.h>
 
1290
#endif
 
1291
#ifdef HAVE_AIO_H
 
1292
#include <aio.h>
 
1293
#endif
 
1294
#ifdef HAVE_SYS_AIO_H
 
1295
#include <sys/aio.h>
 
1296
#endif
 
1297
        int main(int argc, char **argv)
 
1298
        {
 
1299
                struct aiocb *aiocbp;
 
1300
                if (argc > 10) aio_suspend(1, &aiocbp);
 
1301
                return 0;
 
1302
        }
 
1303
        ],
 
1304
        aio_two_arg_suspend=yes
 
1305
        AC_MSG_RESULT(yes),
 
1306
        aio_two_arg_suspend=no 
 
1307
        AC_MSG_RESULT(no),
 
1308
        aio_two_arg_suspend=unknown
 
1309
        AC_MSG_RESULT(unknown)
 
1310
    )
 
1311
 
 
1312
    if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then
 
1313
        AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments)
 
1314
    fi
 
1315
 
 
1316
    LIBS=$save_libs
 
1317
 
 
1318
    AC_MSG_CHECKING([for aio_fildes member of aiocb structure])
 
1319
    AC_TRY_COMPILE([
 
1320
        #ifdef HAVE_SIGNAL_H
 
1321
        #include <signal.h>
 
1322
        #endif
 
1323
        #ifdef HAVE_AIO_H
 
1324
        #include <aio.h>
 
1325
        #endif
 
1326
        #ifdef HAVE_SYS_AIO_H
 
1327
        #include <sys/aio.h>
 
1328
        #endif
 
1329
        ],[
 
1330
        struct aiocb a;
 
1331
        a.aio_fildes = 0;
 
1332
        ],
 
1333
        AC_MSG_RESULT(yes)
 
1334
        AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]),
 
1335
        AC_MSG_RESULT(no)
 
1336
    )
 
1337
    AC_MSG_CHECKING(for aio_whence member of aiocb structure)
 
1338
    AC_TRY_COMPILE([
 
1339
        #ifdef HAVE_SIGNAL_H
 
1340
        #include <signal.h>
 
1341
        #endif
 
1342
        #ifdef HAVE_AIO_H
 
1343
        #include <aio.h>
 
1344
        #endif
 
1345
        #ifdef HAVE_SYS_AIO_H
 
1346
        #include <sys/aio.h>
 
1347
        #endif
 
1348
        #include <sys/types.h>
 
1349
        #include <unistd.h>
 
1350
        ],[
 
1351
        struct aiocb a;
 
1352
        a.aio_whence = SEEK_SET;
 
1353
        ],
 
1354
        AC_MSG_RESULT(yes)
 
1355
        AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]),
 
1356
        AC_MSG_RESULT(no)
 
1357
    )
 
1358
    AC_MSG_CHECKING(for aio_handle member of aiocb structure)
 
1359
    AC_TRY_COMPILE([
 
1360
        #ifdef HAVE_SIGNAL_H
 
1361
        #include <signal.h>
 
1362
        #endif
 
1363
        #ifdef HAVE_AIO_H
 
1364
        #include <aio.h>
 
1365
        #endif
 
1366
        #ifdef HAVE_SYS_AIO_H
 
1367
        #include <sys/aio.h>
 
1368
        #endif
 
1369
        ],[
 
1370
        struct aiocb a;
 
1371
        aio_handle_t h;
 
1372
 
 
1373
        a.aio_handle = h;
 
1374
        ],
 
1375
        AC_MSG_RESULT(yes)
 
1376
        AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]),
 
1377
        AC_MSG_RESULT(no)
 
1378
    )
 
1379
    AC_MSG_CHECKING(for aio_reqprio member of aiocb structure)
 
1380
    AC_TRY_COMPILE([
 
1381
        #ifdef HAVE_SIGNAL_H
 
1382
        #include <signal.h>
 
1383
        #endif
 
1384
        #ifdef HAVE_AIO_H
 
1385
        #include <aio.h>
 
1386
        #endif
 
1387
        #ifdef HAVE_SYS_AIO_H
 
1388
        #include <sys/aio.h>
 
1389
        #endif
 
1390
        ],[
 
1391
        struct aiocb a;
 
1392
 
 
1393
        a.aio_reqprio = 0;
 
1394
        ],
 
1395
        AC_MSG_RESULT(yes)
 
1396
        AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]),
 
1397
        AC_MSG_RESULT(no)
 
1398
    )   
 
1399
    AC_MSG_CHECKING(for aio_sigevent member of aiocb structure)
 
1400
    AC_TRY_COMPILE([
 
1401
        #ifdef HAVE_SIGNAL_H
 
1402
        #include <signal.h>
 
1403
        #endif
 
1404
        #ifdef HAVE_AIO_H
 
1405
        #include <aio.h>
 
1406
        #endif
 
1407
        #ifdef HAVE_SYS_AIO_H
 
1408
        #include <sys/aio.h>
 
1409
        #endif
 
1410
        ],[
 
1411
        struct aiocb a;
 
1412
 
 
1413
        a.aio_sigevent.sigev_signo = 0;
 
1414
        ],
 
1415
        AC_MSG_RESULT(yes)
 
1416
        AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]),
 
1417
        AC_MSG_RESULT(no)
 
1418
    )
 
1419
        
 
1420
fi
 
1421
# End of aio-related tests
 
1422
 
 
1423
#
 
1424
# Check for statfs (many) and specifically f_fstypename field (BSD)
 
1425
#
 
1426
AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h)
 
1427
AC_MSG_CHECKING([whether struct statfs properly defined])
 
1428
AC_TRY_COMPILE([
 
1429
    #ifdef HAVE_SYS_VFS_H
 
1430
    #include <sys/vfs.h>
 
1431
    #endif
 
1432
    #ifdef HAVE_SYS_STATVFS_H
 
1433
    #include <sys/statvfs.h>
 
1434
    #endif
 
1435
    #ifdef HAVE_SYS_PARAM_H
 
1436
    #include <sys/param.h>
 
1437
    #endif
 
1438
    #ifdef HAVE_SYS_MOUNT_H
 
1439
    #include <sys/mount.h>
 
1440
    #endif
 
1441
    ],[
 
1442
    struct statfs f;
 
1443
    ],
 
1444
    pac_cv_have_statfs=yes,pac_cv_have_statfs=no
 
1445
)
 
1446
AC_MSG_RESULT($pac_cv_have_statfs)
 
1447
# At this point, we could check for whether defining 
 
1448
# __SWORD_TYPE as sizet_t or int/long (size of pointer)
 
1449
# would help.  FIXME
 
1450
 
 
1451
if test "$pac_cv_have_statfs" = yes ; then
 
1452
    AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
 
1453
fi
 
1454
          
 
1455
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
 
1456
AC_TRY_COMPILE([
 
1457
    #include <sys/param.h>
 
1458
    #include <sys/mount.h>
 
1459
    #include <string.h>
 
1460
    ],[
 
1461
    struct statfs f;
 
1462
    memset(&f, 0, sizeof(f));
 
1463
    strncmp("nfs", f.f_fstypename, 3);
 
1464
    ],
 
1465
    pac_cv_have_statfs_f_fstypename=yes,
 
1466
    pac_cv_have_statfs_f_fstypename=no
 
1467
)
 
1468
AC_MSG_RESULT($pac_cv_have_statfs_f_fstypename)
 
1469
if test $pac_cv_have_statfs_f_fstypename = yes ; then
 
1470
    AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME, 1,[Define if statfs has f_fstypename])
 
1471
fi
 
1472
 
 
1473
#
 
1474
# Check for stat and st_fstype field (NEC SX4)
 
1475
#
 
1476
AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)
 
1477
AC_CHECK_FUNCS(stat,
 
1478
    [AC_DEFINE(HAVE_STAT, 1, Define if stat function is present)
 
1479
    AC_MSG_CHECKING([for st_fstype member of stat structure])
 
1480
    AC_TRY_COMPILE([
 
1481
        #ifdef HAVE_SYS_TYPES_H
 
1482
        #include <sys/types.h>
 
1483
        #endif
 
1484
        #ifdef HAVE_SYS_STAT_H
 
1485
        #include <sys/stat.h>
 
1486
        #endif
 
1487
        #ifdef HAVE_UNISTD_H
 
1488
        #include <unistd.h>
 
1489
        #endif
 
1490
        ],[
 
1491
        struct stat s;
 
1492
 
 
1493
        s.st_fstype = NULL;
 
1494
        ],
 
1495
        AC_MSG_RESULT(yes)
 
1496
        AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member),
 
1497
        AC_MSG_RESULT(no)
 
1498
    )
 
1499
])
 
1500
 
 
1501
#
 
1502
# Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.)
 
1503
#
 
1504
AC_CHECK_HEADERS(sys/types.h sys/statvfs.h sys/vfs.h)
 
1505
AC_CHECK_FUNCS(statvfs,
 
1506
    [AC_DEFINE(HAVE_STATVFS, 1, Define if statvfs function is present)
 
1507
    AC_MSG_CHECKING([for f_basetype member of statvfs structure])
 
1508
    AC_TRY_COMPILE([
 
1509
        #ifdef HAVE_SYS_TYPES_H
 
1510
        #include <sys/types.h>
 
1511
        #endif
 
1512
        #ifdef HAVE_SYS_VFS_H
 
1513
        #include <sys/vfs.h>
 
1514
        #endif
 
1515
        #ifdef HAVE_SYS_STATVFS_H
 
1516
        #include <sys/statvfs.h>
 
1517
        #endif
 
1518
        ], [
 
1519
        struct statvfs foo;
 
1520
 
 
1521
        foo.f_basetype = NULL;
 
1522
        ],
 
1523
        AC_MSG_RESULT(yes)
 
1524
        AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member),
 
1525
        AC_MSG_RESULT(no)
 
1526
    )
 
1527
])
 
1528
 
 
1529
#
 
1530
# Check for large file support.  Make sure that we can use the off64_t 
 
1531
# type (in some cases, it is an array, and the ROMIO code isn't prepared for
 
1532
# that).
 
1533
#
 
1534
AC_CHECK_HEADERS(unistd.h)
 
1535
if test "$ac_cv_header_unistd_h" = "yes" ; then
 
1536
    AC_CACHE_CHECK([for large file defines],ac_cv_has_large_file_defines,[
 
1537
    AC_TRY_COMPILE([
 
1538
#include <unistd.h>
 
1539
        ], [
 
1540
        #ifndef _LFS64_LARGEFILE
 
1541
        #error no largefile defines
 
1542
        #endif
 
1543
        ],ac_cv_has_large_file_defines=yes,ac_cv_has_large_file_defines=no)])
 
1544
    if test "$ac_cv_has_large_file_defines" = "yes" ; then
 
1545
        # See if we can use them
 
1546
    AC_CACHE_CHECK([whether off64_t is an scalar type],ac_cv_off64_t_scalar,[
 
1547
    AC_TRY_COMPILE([
 
1548
#define _LARGEFILE64_SOURCE
 
1549
#define _FILE_OFFSET_BITS 64
 
1550
#include <sys/types.h>
 
1551
#include <unistd.h>
 
1552
],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)])
 
1553
 
 
1554
        if test "$ac_cv_off64_t_scalar" = "yes" ; then
 
1555
            CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
 
1556
        fi
 
1557
    fi
 
1558
fi
 
1559
 
 
1560
 
 
1561
####################################################################
 
1562
# We're about to mess with CC etc.  No more feature tests past here,
 
1563
# because we may set CC to something that does not yet exist!
 
1564
####################################################################
 
1565
 
 
1566
if test -n "$mpi_mpich"; then
 
1567
   if test -z "$arch_SX4" ; then
 
1568
      MPIOF_H_INCLUDED=1
 
1569
   fi
 
1570
   if test "$FROM_MPICH2" = no; then
 
1571
      AC_DEFINE(NEEDS_MPI_TEST,1,[Define if mpi_test needed])
 
1572
      AC_DEFINE(MPICH,1,[Define if using MPICH])
 
1573
   fi
 
1574
fi
 
1575
 
 
1576
if test -n "$mpi_sgi"; then
 
1577
   AC_DEFINE(MPISGI,1,[Define if SGI MPI])
 
1578
fi
 
1579
 
 
1580
if test -n "$mpi_lam"; then
 
1581
   AC_DEFINE(MPILAM,1,[Define if using LAM/MPI])
 
1582
fi
 
1583
 
 
1584
if test -n "$mpi_hp"; then
 
1585
   AC_DEFINE(MPIHP,1,[Define if using HP MPI])
 
1586
   if test "$NOF77" = 0; then
 
1587
      PAC_CHECK_MPIOF_H
 
1588
   fi
 
1589
fi
 
1590
#
 
1591
AC_CHECK_FUNCS(strerror)
 
1592
if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi
 
1593
AC_SUBST(srcdir)
 
1594
# The master_top_srcdir is the location of the source for the building
 
1595
# package.  This is used only as part of the MPICH2 build, including 
 
1596
# the documentation targets mandoc, htmldoc, and latexdoc
 
1597
if test -z "$master_top_srcdir" ; then
 
1598
    if test "$FROM_MPICH2" = yes ; then
 
1599
        AC_MSG_WARN([Could not determine master_top_srcdir])
 
1600
    fi
 
1601
fi
 
1602
AC_SUBST(master_top_srcdir)
 
1603
#
 
1604
# Get the master builddir (which may be imported from above)
 
1605
if test -z "$master_top_builddir" ; then
 
1606
    master_top_builddir=`pwd`
 
1607
fi
 
1608
export master_top_builddir
 
1609
AC_SUBST(master_top_builddir)
 
1610
# Make sure the alternate spelling is used until we clean up all of the code
 
1611
master_topbuild_dir=$master_top_builddir
 
1612
export master_topbuild_dir
 
1613
AC_SUBST(master_topbuild_dir)
 
1614
 
 
1615
# The following definitions are needed within adio/common/status_setb.c
 
1616
if test "$FROM_MPICH" = yes ; then
 
1617
   AC_DEFINE(MPICH,1,[Define if compiling within MPICH])
 
1618
elif test "$FROM_MPICH2" = yes ; then 
 
1619
   AC_DEFINE(ROMIO_INSIDE_MPICH2,1,[Define if compiling within MPICH2])
 
1620
elif test "$FROM_MPILAM" = yes ; then
 
1621
   AC_DEFINE(MPILAM,1,[Define if compiling within LAM/MPI])
 
1622
fi
 
1623
 
 
1624
if test "$FROM_MPICH2" = no -a "$FROM_MPICH" = no ; then 
 
1625
    if test -z "$LIBNAME"; then
 
1626
        LIBNAME="$top_build_dir/lib/libmpio.a"
 
1627
    fi
 
1628
    #
 
1629
    if test ! -d $top_build_dir/lib ; then 
 
1630
        mkdir $top_build_dir/lib
 
1631
    fi
 
1632
else
 
1633
    MPILIBNAME=${MPILIBNAME:-mpich}
 
1634
    if test -z "$LIBNAME" ; then
 
1635
        if test -d "$master_top_builddir/lib" ; then
 
1636
            LIBNAME=$master_top_builddir/lib/lib${MPILIBNAME}.a
 
1637
        else
 
1638
            LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a"
 
1639
        fi
 
1640
    fi
 
1641
fi
 
1642
if test "$FROM_MPICH2" != no ; then
 
1643
    # use the error handlers from MPICH2
 
1644
    MPIO_EXTRA_OBJECTS=
 
1645
    MPIO_EXTRA_TMP_POBJECTS=
 
1646
    MPIO_EXTRA_REAL_POBJECTS=
 
1647
    # Use generalized request to get the multiple-completion routines
 
1648
    MPIO_REQOBJECTS=
 
1649
    MPIO_REQ_TMP_POBJECTS=
 
1650
    MPIO_REQ_REAL_POBJECTS=
 
1651
fi
 
1652
AC_SUBST(MPIO_EXTRA_OBJECTS)
 
1653
AC_SUBST(MPIO_EXTRA_TMP_POBJECTS)
 
1654
AC_SUBST(MPIO_EXTRA_REAL_POBJECTS)
 
1655
AC_SUBST(MPIO_REQOBJECTS)
 
1656
AC_SUBST(MPIO_REQ_TMP_POBJECTS)
 
1657
AC_SUBST(MPIO_REQ_REAL_POBJECTS)
 
1658
#
 
1659
# Use DOCTEXT instead of doctext
 
1660
AC_CHECK_PROGS(DOCTEXT,doctext,true)
 
1661
AC_SUBST(DOCTEXT)
 
1662
#
 
1663
if test $NOF77 = 1 ; then
 
1664
   F77=":"
 
1665
else
 
1666
   FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test" 
 
1667
fi
 
1668
#
 
1669
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
1670
   PAC_TEST_MPI
 
1671
   PAC_NEEDS_FINT
 
1672
else
 
1673
   NEEDS_MPI_FINT=""
 
1674
fi
 
1675
#
 
1676
if test "$MPI_INCLUDE_DIR" = "." ; then
 
1677
   ROMIO_INCLUDE="-I../include"
 
1678
else 
 
1679
   ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR"
 
1680
fi
 
1681
#
 
1682
TEST_LIBNAME=$LIBNAME
 
1683
MPIRUN=mpirun
 
1684
 
 
1685
if test "$MPI" = "open_mpi" ; then
 
1686
 
 
1687
   # Open MPI does have the status set bytes functionality
 
1688
 
 
1689
   AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
 
1690
 
 
1691
   # Used in the tests/ subdirectory for after ROMIO is built
 
1692
 
 
1693
   TEST_CC=mpicc
 
1694
   TEST_F77=mpif77
 
1695
   MPIRUN=mpirun
 
1696
   MPI_LIB=
 
1697
   NOPROFILE=1
 
1698
   ROMIO_INCLUDE=
 
1699
   USER_CFLAGS=
 
1700
   USER_FFLAGS=
 
1701
   TEST_LIBNAME=
 
1702
   AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available])
 
1703
   HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
 
1704
   # Open MPI: see comments in mpi-io/mpioprof.h
 
1705
   AC_DEFINE(MPIO_BUILD_PROFILING, 1, [hack to make ROMIO build without profiling])
 
1706
 
 
1707
#
 
1708
# if MPICH, use mpicc in test programs
 
1709
#
 
1710
elif test "$FROM_MPICH" = yes ; then
 
1711
   MPICH_HOME=`dirname $ROMIO_HOME`
 
1712
   if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
 
1713
   TEST_CC=$MPI_BIN_DIR/mpicc
 
1714
   MPI_LIB=""
 
1715
   ROMIO_INCLUDE=""
 
1716
   USER_CFLAGS=""
 
1717
   USER_FFLAGS=""
 
1718
   TEST_LIBNAME=""
 
1719
   MPIRUN=$MPI_BIN_DIR/mpirun
 
1720
   if test -n "$arch_SX4" || test -n "$arch_hpux" ; then
 
1721
      TEST_F77=$MPI_BIN_DIR/mpif90
 
1722
   else
 
1723
      TEST_F77=$MPI_BIN_DIR/mpif77
 
1724
   fi
 
1725
   CC=$MPI_BIN_DIR/mpicc
 
1726
   # A later test will insert the mpi2-other/info and array directories based
 
1727
   # on the value of BUILD_MPI_xxxx.  This lets MPICH2 turn these off,
 
1728
   # since MPICH2 provides these routines elsewhere
 
1729
   EXTRA_DIRS="mpi-io/fortran"
 
1730
   # Some older implementations of the ADI do not include the 
 
1731
   # MPID_Status_set_bytes routine.   This uses either the 
 
1732
   # environment variable ADI3_WITHOUT_SET_BYTES or the
 
1733
   # with arg --without-setbytes
 
1734
   if test "$ADI2_WITHOUT_SET_BYTES" != yes -a \
 
1735
           "$with_setbytes" != no ; then
 
1736
       AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
 
1737
   fi
 
1738
elif test $FROM_LAM = yes ; then
 
1739
   # LAM does have the status set bytes functionality
 
1740
   AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
 
1741
        
 
1742
   # Used in the tests/ subdirectory for after ROMIO is built
 
1743
   TEST_CC=mpicc
 
1744
   TEST_F77=mpif77
 
1745
   MPIRUN=mpirun 
 
1746
   MPI_LIB=
 
1747
   ROMIO_INCLUDE=
 
1748
   USER_CFLAGS=
 
1749
   USER_FFLAGS=
 
1750
   TEST_LIBNAME=
 
1751
   EXTRA_DIRS="mpi-io/fortran mpi2-other/info mpi2-other/info/fortran mpi2-other/array mpi2-other/array/fortran"
 
1752
elif test $FROM_MPICH2 = yes ; then
 
1753
   # For now, separate the mpich2 from mpich cases
 
1754
   MPICH_HOME=`dirname $ROMIO_HOME`
 
1755
   MPICH_HOME=`dirname $MPICH_HOME`
 
1756
   MPICH_HOME=`dirname $MPICH_HOME`
 
1757
   if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
 
1758
   # No special compiler script.
 
1759
   # BUT we need the include paths
 
1760
   # CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include"
 
1761
   # TEST_CC="$CC"
 
1762
   # MPI_LIB="$LIBNAME"
 
1763
   # To allow ROMIO to work with the LIBTOOL scripts, we want to 
 
1764
   # work directly with the CC, not the mpicc, compiler.
 
1765
   # Note that in the "FROM_MPICH2" case, the CPPFLAGS and INCLUDES are already
 
1766
   # properly set
 
1767
   #CC=${top_build_dir}/bin/mpicc
 
1768
   #
 
1769
   # set the compilers to the ones in MPICH2 bin directory (master_top_builddir/bin)
 
1770
   TEST_CC=${master_top_builddir}/bin/mpicc
 
1771
   TEST_F77=${master_top_builddir}/bin/mpif77
 
1772
   ROMIO_INCLUDE=""
 
1773
   USER_CFLAGS=""
 
1774
   USER_FFLAGS=""
 
1775
   TEST_LIBNAME=""
 
1776
   MPIRUN=${master_top_builddir}/bin/mpiexec
 
1777
   #
 
1778
   # Turn off the building of the Fortran interface and the Info routines
 
1779
   EXTRA_DIRS=""
 
1780
   AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if status_set_bytes available])
 
1781
   DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST"
 
1782
fi
 
1783
#
 
1784
#
 
1785
# feature tests:  we can't test features if building as part of MPICH because
 
1786
# we don't yet have an implementation against which we can test
 
1787
#
 
1788
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
 
1789
   PAC_TEST_MPIR_STATUS_SET_BYTES
 
1790
   PAC_TEST_MPI_GREQUEST
 
1791
   AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages])
 
1792
fi
 
1793
#
 
1794
if test -z "$TEST_CC" ; then
 
1795
   TEST_CC="$CC"
 
1796
fi
 
1797
if test -z "$TEST_F77" ; then
 
1798
   TEST_F77="$F77"
 
1799
fi
 
1800
#
 
1801
AC_CHECK_FUNCS(strdup)
 
1802
if test "$ac_cv_func_strdup" = "yes" ; then
 
1803
    # Do we need to declare strdup?
 
1804
    PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
 
1805
fi
 
1806
AC_CHECK_FUNCS(snprintf)
 
1807
if test "$ac_cv_func_snprintf" = "yes" ; then
 
1808
    # Do we need to declare snprintf?
 
1809
    PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
 
1810
fi
 
1811
AC_CHECK_FUNCS(lstat)
 
1812
if test "$ac_cv_func_lstat" = "yes" ; then
 
1813
    # Do we need to declare lstat?
 
1814
    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],lstat)
 
1815
fi
 
1816
AC_CHECK_FUNCS(readlink)
 
1817
if test "$ac_cv_func_readlink" = "yes" ; then
 
1818
    # Do we need to declare readlink?
 
1819
    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],readlink)
 
1820
fi
 
1821
AC_CHECK_FUNCS(fsync)
 
1822
if test "$ac_cv_func_fsync" = "yes" ; then
 
1823
    # Do we need to declare fsync?
 
1824
    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],fsync)
 
1825
fi
 
1826
AC_CHECK_FUNCS(ftruncate)
 
1827
if test "$ac_cv_func_ftruncate" = "yes" ; then
 
1828
    # Do we need to declare ftruncate?
 
1829
    PAC_FUNC_NEEDS_DECL([#include <unistd.h>],ftruncate)
 
1830
fi
 
1831
#
 
1832
# Create the directory lists for the Makefile
 
1833
FILE_SYS_DIRS=""
 
1834
for dir in $FILE_SYSTEM ; do
 
1835
    FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$dir"
 
1836
done
 
1837
EXTRA_SRC_DIRS=""
 
1838
GLUE_DIR=""
 
1839
if test "$FROM_MPICH2" = yes -o "${MPI}_mpi" = "mpich2_mpi"; then
 
1840
    GLUE_DIR="mpi-io/glue/mpich2"
 
1841
elif test "$FROM_MPICH" = yes -o "${MPI}_mpi" = "mpich_mpi"; then
 
1842
    GLUE_DIR="mpi-io/glue/mpich1"
 
1843
else
 
1844
    GLUE_DIR="mpi-io/glue/default"
 
1845
fi
 
1846
if test "$BUILD_MPI_INFO" = 1 ; then
 
1847
    EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info"
 
1848
    if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
 
1849
        EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info/fortran"
 
1850
    fi
 
1851
fi
 
1852
if test "$BUILD_MPI_ARRAY" = 1 ; then
 
1853
    EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array"
 
1854
    if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
 
1855
        EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array/fortran"
 
1856
    fi
 
1857
fi
 
1858
if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
 
1859
   EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran"
 
1860
fi
 
1861
AC_SUBST(EXTRA_SRC_DIRS)
 
1862
AC_SUBST(FILE_SYS_DIRS)
 
1863
AC_SUBST(GLUE_DIR)
 
1864
 
 
1865
#
 
1866
CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
 
1867
#
 
1868
 
 
1869
if test -n "$MPIOF_H_INCLUDED"; then
 
1870
   F77MPIOINC=""
 
1871
else 
 
1872
   F77MPIOINC="include 'mpiof.h'"
 
1873
fi
 
1874
 
 
1875
PAC_C_RESTRICT
 
1876
PAC_C_GNU_ATTRIBUTE
 
1877
#
 
1878
dnl CFLAGS="$CFLAGS $DEFS"
 
1879
CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
 
1880
#
 
1881
# Open MPI: we need libtool
 
1882
AM_PROG_LIBTOOL
 
1883
 
 
1884
# Open MPI: setup the AM_CONDITIONALs to build the different adio devices
 
1885
 m4_foreach([my_fs], 
 
1886
  [gridftp, hfs, nfs, panfs, pfs, piofs, pvfs, pvfs2, sfs, testfs, ufs, xfs],
 
1887
  [AM_CONDITIONAL(BUILD_[]AS_TR_CPP(my_fs), [test -n "$file_system_]my_fs["])])
 
1888
 
 
1889
echo "setting CC to $CC"
 
1890
echo "setting F77 to $F77"
 
1891
echo "setting TEST_CC to $TEST_CC"
 
1892
echo "setting TEST_F77 to $TEST_F77"
 
1893
echo "setting CFLAGS to $CFLAGS"
 
1894
echo "setting USER_CFLAGS to $USER_CFLAGS"
 
1895
echo "setting USER_FFLAGS to $USER_FFLAGS"
 
1896
 
 
1897
# Open MPI: Add on CFLAGS that we figured out up top.  They have
 
1898
# makefile macros in them, so we couldn't substitute them until now.
 
1899
CFLAGS="$CFLAGS $OMPI_CFLAGS "'-I$(top_builddir)/include'
 
1900
#
 
1901
# Open MPI - AM doesn't want the following:
 
1902
#   VPATH, CC, CPPFLAGS, CFLAGS, AR, RANLIB, F77, MAKE
 
1903
#VPATH='VPATH = .:${srcdir}'
 
1904
#AC_SUBST(VPATH)
 
1905
AC_SUBST(ARCH)
 
1906
AC_SUBST(FILE_SYSTEM)
 
1907
#AC_SUBST(CC)
 
1908
#AC_SUBST(CPPFLAGS)
 
1909
#AC_SUBST(CFLAGS)
 
1910
AC_SUBST(USER_CFLAGS)
 
1911
AC_SUBST(USER_FFLAGS)
 
1912
AC_SUBST(MIPS)
 
1913
AC_SUBST(BITS)
 
1914
AC_SUBST(MPI)
 
1915
#AC_SUBST(AR)
 
1916
#AC_SUBST(RANLIB)
 
1917
AC_SUBST(MPI_INCLUDE_DIR)
 
1918
AC_SUBST(MPI_LIB)
 
1919
#AC_SUBST(F77)
 
1920
AC_SUBST(NOF77)
 
1921
AC_SUBST(NOPROFILE)
 
1922
#AC_SUBST(MAKE)
 
1923
AC_SUBST(arch_IRIX)
 
1924
AC_SUBST(ROMIO_HOME)
 
1925
AC_SUBST(LIBNAME)
 
1926
AC_SUBST(TEST_LIBNAME)
 
1927
AC_SUBST(LL)
 
1928
AC_SUBST(F77GETARG)
 
1929
AC_SUBST(F77IARGC)
 
1930
AC_SUBST(F77MPIOINC)
 
1931
AC_SUBST(FTESTDEFINE)
 
1932
AC_SUBST(FORTRAN_MPI_OFFSET)
 
1933
AC_SUBST(FROM_MPICH)
 
1934
AC_SUBST(FROM_MPICH2)
 
1935
AC_SUBST(FROM_LAM)
 
1936
AC_SUBST(WITHIN_KNOWN_MPI_IMPL)
 
1937
AC_SUBST(NEEDS_MPI_FINT)
 
1938
AC_SUBST(HAVE_MPI_INFO)
 
1939
AC_SUBST(BUILD_MPI_INFO)
 
1940
AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY)
 
1941
AC_SUBST(BUILD_MPI_ARRAY)
 
1942
AC_SUBST(DEFINE_MPI_OFFSET)
 
1943
AC_SUBST(DEFINE_HAVE_MPI_GREQUEST)
 
1944
AC_SUBST(MPI_OFFSET_TYPE)
 
1945
AC_SUBST(MPI_FINFO1)
 
1946
AC_SUBST(MPI_FINFO2)
 
1947
AC_SUBST(MPI_FINFO3)
 
1948
AC_SUBST(MPI_FINFO4)
 
1949
AC_SUBST(MPI_FARRAY1)
 
1950
AC_SUBST(MPI_FARRAY2)
 
1951
AC_SUBST(MPI_FARRAY3)
 
1952
AC_SUBST(MPI_FARRAY4)
 
1953
AC_SUBST(MPI_FARRAY5)
 
1954
AC_SUBST(MPI_FARRAY6)
 
1955
AC_SUBST(MPI_FARRAY7)
 
1956
AC_SUBST(MPI_OFFSET_KIND1)
 
1957
AC_SUBST(MPI_OFFSET_KIND2)
 
1958
AC_SUBST(MPIO_REQOBJECTS)
 
1959
AC_SUBST(TEST_CC)
 
1960
AC_SUBST(TEST_F77)
 
1961
AC_SUBST(ROMIO_INCLUDE)
 
1962
AC_SUBST(ROMIO_LFLAGS)
 
1963
AC_SUBST(ROMIO_LIBLIST)
 
1964
AC_SUBST(ROMIO_TCFLAGS)
 
1965
AC_SUBST(ROMIO_TCPPFLAGS)
 
1966
AC_SUBST(ROMIO_TFFLAGS)
 
1967
AC_SUBST(MPIRUN)
 
1968
AC_SUBST(FORTRAN_TEST)
 
1969
dnl
 
1970
# Open MPI - not needed with AM
 
1971
#dnl Dependency handling
 
1972
#AC_SUBST(MAKE_DEPEND_C)
 
1973
# Open MPI - LT / AM does all this for us...
 
1974
#dnl
 
1975
#dnl Support shared libraries
 
1976
#if test -z "$ENABLE_SHLIB" ; then
 
1977
#   ENABLE_SHLIB=none
 
1978
#fi
 
1979
#AC_SUBST(ENABLE_SHLIB)
 
1980
#AC_SUBST(CC_SHL)
 
1981
#AC_SUBST(LIBTOOL)
 
1982
# Remove the .a from the library file name (so that we can use .so or
 
1983
# other appropriate suffix)
 
1984
#SHLIBNAME=`echo $LIBNAME | sed 's/\.a//'`
 
1985
#AC_SUBST(SHLIBNAME)
 
1986
#dnl
 
1987
# Open MPI: This is no longer necessary with modern versions of autotools
 
1988
#if test ! -d adio ; then mkdir adio ; fi
 
1989
#if test ! -d adio/include ; then mkdir adio/include ; fi
 
1990
#if test ! -d mpi2-other ; then mkdir mpi2-other ; fi
 
1991
#if test ! -d mpi-io ; then mkdir mpi-io ; fi
 
1992
#if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi
 
1993
 
1994
# Make sure we remove any configuration file incase there is out-of-date data.
 
1995
# We remove the version in include in case this is a vpath build
 
1996
# Open MPI: no longer needed with modern AC
 
1997
#rm -f adio/include/romioconf.h ${use_top_srcdir}/src/mpi/romio/adio/include/romioconf.h ${use_top_srcdir}/adio/include/romioconf.h
 
1998
#
 
1999
# Create makefiles for all of the adio devices.  Only the ones that 
 
2000
# are active will be called by the top level ROMIO make
 
2001
AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests])
 
2002
# Open MPI: revamp AC_OUTPUT lines to fit Makefile.am's
 
2003
AC_CONFIG_FILES([
 
2004
    Makefile
 
2005
    localdefs 
 
2006
 
 
2007
    adio/Makefile
 
2008
    adio/ad_gridftp/Makefile
 
2009
    adio/ad_hfs/Makefile
 
2010
    adio/ad_nfs/Makefile 
 
2011
    adio/ad_ntfs/Makefile
 
2012
    adio/ad_panfs/Makefile
 
2013
    adio/ad_pfs/Makefile
 
2014
    adio/ad_piofs/Makefile
 
2015
    adio/ad_pvfs/Makefile
 
2016
    adio/ad_pvfs2/Makefile
 
2017
    adio/ad_sfs/Makefile
 
2018
    adio/ad_testfs/Makefile
 
2019
    adio/ad_ufs/Makefile
 
2020
    adio/ad_xfs/Makefile
 
2021
    adio/common/Makefile
 
2022
    adio/include/Makefile
 
2023
 
 
2024
    doc/Makefile
 
2025
 
 
2026
    include/mpio.h
 
2027
    include/mpiof.h
 
2028
    include/Makefile
 
2029
 
 
2030
    mpi-io/Makefile 
 
2031
 
 
2032
    test/Makefile
 
2033
    test/misc.c
 
2034
    test/large_file.c
 
2035
    test/runtests
 
2036
 
 
2037
    util/romioinstall
 
2038
 
 
2039
    mpi-io/glue/openmpi/Makefile
 
2040
 
 
2041
    util/Makefile
 
2042
])
 
2043
AC_OUTPUT
 
2044
#
 
2045
# Open MPI - don't need to remove this...
 
2046
# rm -f *.o
 
2047
 
 
2048
# Open MPI - don't need this extra printf
 
2049
#if test $FROM_MPICH = no -a $FROM_MPICH2 = no ; then
 
2050
#   AC_MSG_RESULT([Configure done. Now type make.])
 
2051
#fi
 
2052
dnl PAC_SUBDIR_CACHE_CLEANUP
 
2053
exit 0