1
# -*- Mode: shell-script -*-
3
# autoconf --localdir=../confdb configure.in
4
# (or wherever the confdb is)
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
19
# if this blows up, it's because you forgot to run autoheader
20
AC_INIT(adio/include/romioconf.h.in)
22
# AC_MSG_RESULT([Configuring ROMIO Version $VERSION])
24
if test -n "$CONFIGURE_ARGS" ; then
25
echo "Configuring with args $CONFIGURE_ARGS"
28
AC_CONFIG_HEADER(adio/include/romioconf.h)
30
# Open MPI: added AH_TOP
31
AH_TOP([#include "romioconf-undefs.h"])
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])
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
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).
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"
50
AC_MSG_RESULT([in Open MPI source tree -- good])
51
AC_SUBST(top_ompi_srcdir)
52
AC_SUBST(top_ompi_builddir)
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])
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
72
# Do not set variables to empty that may be communicated from the
73
# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME)
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])
83
FROM_LAM=${FROM_LAM:-no}
84
if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi
88
DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST"
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)"
118
FORTRAN_MPI_OFFSET=""
124
# Open MPI: don't want a profiling layer... - change weak from 1 to 0
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"
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"
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"
147
--enable-aio - Request use of asynchronous I/O routines (default)],
149
if test "x$enableval" = "xno" ; then
156
[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
158
[--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes)
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)
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],,)
168
--with-mpi=name - Specify MPI implementation to build ROMIO for],,)
170
if test "$enable_f77" != "yes" ; then
173
if test "$enable_f90" != "yes" ; then
176
if test "$enable_debug" = "yes" ; then
179
if test "$enable_weak_symbols" = "no" ; then
183
FILE_SYSTEM=$with_file_system
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.
191
AC_CONFIG_AUX_DIR(confdb)
193
# Open MPI: Init automake
194
AM_INIT_AUTOMAKE(io-romio, 1.0.0, 'no')
197
# Check that an arch was set
198
# If it wasn't set, try to guess using "util/tarch"
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
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])
216
# check for valid architecture. Use __ so that _ALPHA_ does not match
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])
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
229
# Take advantage of autoconf2 features
230
if test -n "$ac_confdir" ; then
231
ROMIO_HOME_TRIAL=$ac_confdir
233
if test -s configure ; then
234
ROMIO_HOME_TRIAL=`pwd`
236
ac_confdir=`dirname "$0" 2>/dev/null`
237
if test -n "$ac_confdir" ; then
238
ROMIO_HOME_TRIAL=$ac_confdir
243
AC_MSG_RESULT([ROMIO home directory is $ROMIO_HOME_TRIAL])
244
ROMIO_HOME=$ROMIO_HOME_TRIAL
246
# get a fully qualified pathname for our build directory
248
# used in romioinstall
249
AC_SUBST(top_build_dir)
251
# Open MPI: these shouldn't be needed with AM
253
# Create the "autoconf" style directory names...
254
# Most of these are done for us; add the documentation directories
256
# mandir is the root for the man pages
257
#if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
259
#if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
261
#if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
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
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
280
eval "file_system_`echo $x`=1"
284
if test "$found" = "no" ; then
285
AC_MSG_WARN([Unknown file system $x... proceeding anyway])
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
295
WITHIN_KNOWN_MPI_IMPL=no
298
# Open MPI: Make it think we're a known MPI implementation
299
WITHIN_KNOWN_MPI_IMPL=yes
301
# check for valid MPI implementation
302
if test -n "$MPI" ; then
304
for mpi in $known_mpi_impls ; do
305
if test "${MPI}_mpi" = "$mpi" ; then
310
if test $found = no ; then
311
AC_MSG_WARN([Unknown MPI implementation $MPI... proceeding anyway])
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])
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
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])
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
347
# Open MPI - don't set make
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"
355
USER_CFLAGS="$CFLAGS -O"
356
USER_FFLAGS="$FFLAGS -O"
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.
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
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"
387
if test -n "$OPTFLAGSC" ; then
388
C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGSC"
390
# Open MPI: ignore all setting of CC, f77, FC, etc. in this section
395
if test "$CC" != "gcc" ; then
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)
412
CFLAGS="$CFLAGS -cougar -D__PUMA"
413
if test "$CC" = "pgcc" ; then
414
C_OPT_FLAG="-Knoieee -Mvect -O3"
418
freebsd|LINUX|netbsd|openbsd|LINUX_ALPHA)
420
# Let the prog_f77 file g77/f77/others
427
#if test $DEBUG != "yes" ; then
428
# USER_FFLAGS="$FFLAGS -Chopt"
429
# F77_OPT_FLAG="-Chopt"
434
C_DEBUG_FLAG="-g +w1"
440
#dnl CFLAGS="$CFLAGS -g -std1 -warnprotos -verbose"
441
#C_DEBUG_FLAG="-g -verbose"
448
CFLAGS="$CFLAGS -D_UNICOS"
451
sgi|IRIX64|IRIX32|IRIXN32)
455
#C_DEBUG_FLAG="-g -fullwarn"
462
# Fall-through case. Take FC
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.
474
if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then
475
C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes"
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
481
# CFLAGS="$CFLAGS $C_OPT_FLAG"
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
492
if test $MPI = "mpich" ; then
499
#OMPI: Bad for automake: AR="ar cr"
500
# solaris does not have l option to ar
504
if test -n "$arch_rs6000"; then
505
if test -z "$MPI" ; then
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)"
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"
522
if test -z "$MPI" ; then
526
if test -z "$FILE_SYSTEM" ; then
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
537
# Find the CPP before the header check
539
if test -z "$MPI" ; then
545
if test -n "$arch_SX4" ; then
547
AC_DEFINE(SX4,1,[Define for NEC SX4])
548
if test -z "$MPI" ; then
552
if test -z "$FILE_SYSTEM" ; then
555
FILE_SYSTEM="sfs nfs"
557
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
558
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
561
if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
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"
569
echo "assuming that you want to use ROMIO with MPICH"
573
if test $MPI = "mpich" ; then
575
MPI_LIB="$MPI_LIB -lV3"
579
if test $MPI = "hp" ; then
582
F77=${FC:-mpif77 +U77}
584
if test $MPI = "lam" && test "$FC" != ""; then
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}
597
AC_DEFINE(SPPUX,1,[Define for SPPUX (Convex)])
600
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
601
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
602
if test "$CC" != "gcc" ; then
605
if test "$F77" != "g77" ; then
610
if test -n "$arch_alpha" || test -n "$arch_ALPHA" ; then
611
if test -z "$MPI" ; then
616
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
617
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
618
ROMIO_LIBLIST="$ROMIO_LIBLIST -laio"
621
if test -n "$arch_CRAY" ; then
623
FTESTDEFINE="integer ilen"
624
F77GETARG="call pxfgetarg(i, str, ilen, ierr)"
626
# OMPI: bad for automake: RANLIB=":"
627
AC_DEFINE(CRAY,1,[Define if Cray])
628
if test -z "$MPI" || test -n "$mpi_sgi" ; then
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])
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.
641
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
642
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
645
if test -n "$arch_sgi" ; then
649
if test -n "$arch_IRIX64" || test -n "$arch_IRIX32" || test -n "$arch_IRIXN32" ; then
652
if test -n "$arch_sgi5" ; then
657
PAC_GET_SPECIAL_SYSTEM_INFO
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
662
if test -n "$arch_sgi5"; then
665
IRIXARCH="$ARCH_$osversion"
666
IRIXARCH="$IRIXARCH_$cputype"
667
# now set arch_IRIX to 1
669
echo "IRIX-specific architecture is $IRIXARCH"
670
AC_DEFINE(IRIX,1,[Define if IRIX])
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])
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])
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
689
elif test -f "/usr/include/mpi.h" ; then
690
AC_MSG_WARN([assuming that you want to use ROMIO with SGI\'s MPI])
694
AC_MSG_WARN([assuming that you want to use ROMIO with MPICH])
699
#OMPI: Bad for automake: RANLIB=":"
700
AC_DEFINE(AIO_SIGNOTIFY_NONE,1,[Define if no signotify])
701
if test $cputype -ge 5000 ; then
707
if test -n "$mpi_sgi" && test -z "$MPI_LIB" ; then
710
# check if pread64 is defined
713
if test -z "$FILE_SYSTEM" ; then
716
AC_MSG_CHECKING(for xfs)
719
[aiocb64_t *t1;],file_system_xfs=1;FILE_SYSTEM="xfs $FILE_SYSTEM";)
720
if test "$file_system_xfs" = 1 ; then
725
FILE_SYSTEM="ufs $FILE_SYSTEM"
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)"
733
AC_HAVE_FUNCS(memalign)
736
# Question: Should ROMIO under MPICH2 ignore the Fortran tests, since
737
# MPICH2 provides all of the Fortran interface routines?
739
if test $NOF77 = 0 ; then
740
echo "checking Fortran external names"
742
if test -n "$WDEF" ; then
743
CFLAGS="$CFLAGS $WDEF"
745
dnl PAC_PROG_F77_NAME_MANGLE
746
dnl (need to set the new name format)
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
756
# Open MPI: We already do this test top-level
760
# Find the CPP before the header check
762
AC_CHECK_HEADERS(unistd.h fcntl.h malloc.h stddef.h)
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
776
pac_cv_int_hold_pointer=yes
779
if test "$pac_cv_int_hold_pointer" != yes ; then
780
AC_DEFINE(INT_LT_POINTER,1,[Define if int smaller than pointer])
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"
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])
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"
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"
826
if test -n "$longlongsize"; then
827
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
828
PAC_MPI_LONG_LONG_INT
830
AC_DEFINE(HAVE_MPI_LONG_LONG_INT,1,[Define if supports long long int])
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)"
838
if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
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
847
# check if MPI_Info functions are defined in the MPI implementation
848
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
851
AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI Info is available])
852
HAVE_MPI_INFO="#define HAVE_MPI_INFO"
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?
863
PAC_TEST_MPI_SGI_type_is_contig
864
PAC_TEST_MPI_COMBINERS
865
PAC_TEST_MPI_HAVE_OFFSET_KIND
868
# check if darray and subarray constructors are defined in the MPI
870
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
871
PAC_MPI_DARRAY_SUBARRAY
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"
890
# Test for weak symbol support...
891
# We can't put # in the message because it causes autoconf to generate
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.
901
if test $TRY_WEAK_SYMBOLS = 1 ; then
902
AC_MSG_CHECKING([for weak symbol support])
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)
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
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])
918
cat >>conftest1.c <<EOF
919
extern int PFoo(int);
920
#pragma weak PFoo = Foo
922
int Foo(int a) { return a; }
924
cat >>conftest2.c <<EOF
925
extern int PFoo(int);
926
int main(int argc, char **argv) {
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
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
943
if test "$has_pragma_weak" = 1 ; then
945
AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Define if pragma weak available])
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])
955
AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[Define for HP weak pragma])
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])
965
AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Define for CRAY weak dup])
972
if test "$HAVE_WEAK_SYMBOLS" = 1 ; then
973
AC_DEFINE(HAVE_WEAK_SYMBOLS,1,[Define if weak symbols available])
975
AC_SUBST(HAVE_WEAK_SYMBOLS)
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>],
984
$MPI_OFFSET_TYPE a=1;
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>],
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])
1003
# FIXME. Solaris header files define off_t as a UNION if 64bit file
1004
# sizes are selected. Gah!
1008
# if FILE_SYSTEM is not set above, use ufs and nfs as default
1010
if test -z "$FILE_SYSTEM" ; then
1013
FILE_SYSTEM="ufs nfs"
1016
# no matter what, always build testfs
1017
file_system_testfs=1
1018
FILE_SYSTEM="testfs $FILE_SYSTEM"
1021
# Print list of configured file systems
1023
# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW?
1025
AC_MSG_CHECKING([configured file systems])
1026
AC_MSG_RESULT([$FILE_SYSTEM])
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])
1034
if test -n "$file_system_panfs"; then
1035
AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS])
1037
if test -n "$file_system_ufs"; then
1038
AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])
1040
if test -n "$file_system_hfs"; then
1041
AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS])
1043
if test -n "$file_system_sfs"; then
1044
AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS])
1047
if test -n "$file_system_pfs"; then
1048
AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS])
1051
if test -n "$file_system_testfs"; then
1052
AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS])
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],
1061
/bin/rm -f confmemalignval
1062
/bin/rm -f /tmp/romio_tmp.bin
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);
1074
fcntl(fd, F_DIOINFO, &st);
1075
fprintf( f, "%u\n", st.d_mem);
1079
pac_cv_memalignval=`cat confmemalignval`,
1080
pac_cv_memalignval="unknown",pac_cv_memalignval="unknown"
1082
/bin/rm -f confmemalignval
1083
/bin/rm -f /tmp/romio_tmp.bin
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"
1089
AC_MSG_RESULT(assuming 128 for memory alignment)
1090
CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
1095
# Verify presence of pvfs.h, issue with int64
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])
1103
# Check for missing int64_t (intel version 8 compiler and -no-gcc
1105
AC_MSG_CHECKING([that pvfs.h can be compiled])
1109
],pvfs_header_ok=yes,pvfs_header_ok=no
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
1116
typedef long long int int64_t;
1120
pvfs_header_ok="yes with int64 definition"
1122
AC_MSG_RESULT($pvfs_header_ok)
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])
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.])
1131
AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support)
1136
# Verify presence of pvfs2.h
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])
1147
if test -n "$file_system_gridftp"; then
1148
AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp])
1152
# Check for presence and characteristics of async. I/O calls if
1155
# Q: Do we need to list some "other libs" to get things to link?
1160
# Some systems need pthreads to get AIO to work
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"
1168
AC_SEARCH_LIBS(aio_write,aio rt,
1169
ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
1170
MPI_LIB="$MPI_LIB $LIBS"
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])
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])
1189
AC_MSG_CHECKING([if sys/aio.h exists and can be compiled])
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])
1199
if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" ; then
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.
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)
1214
#include <sys/types.h>
1215
#ifdef HAVE_SIGNAL_H
1221
#ifdef HAVE_SYS_AIO_H
1222
#include <sys/aio.h>
1224
int main(int argc, char **argv)
1226
struct aiocb *aiocbp;
1227
if (argc > 10) aio_write(aiocbp);
1236
AC_MSG_RESULT(unknown)
1238
if test "$aio_runs" != "no" ; then
1239
AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
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
1252
AC_MSG_CHECKING([for obsolete two-argument aio_write])
1254
#include <sys/types.h>
1255
#ifdef HAVE_SIGNAL_H
1261
#ifdef HAVE_SYS_AIO_H
1262
#include <sys/aio.h>
1264
int main(int argc, char **argv)
1267
struct aiocb *aiocbp;
1268
if (argc > 10) aio_write(fd, aiocbp);
1272
aio_two_arg_write=yes
1274
aio_two_arg_write=no
1276
aio_two_arg_write=unknown
1277
AC_MSG_RESULT(unknown)
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)
1285
AC_MSG_CHECKING([for obsolete two-argument aio_suspend])
1287
#include <sys/types.h>
1288
#ifdef HAVE_SIGNAL_H
1294
#ifdef HAVE_SYS_AIO_H
1295
#include <sys/aio.h>
1297
int main(int argc, char **argv)
1299
struct aiocb *aiocbp;
1300
if (argc > 10) aio_suspend(1, &aiocbp);
1304
aio_two_arg_suspend=yes
1306
aio_two_arg_suspend=no
1308
aio_two_arg_suspend=unknown
1309
AC_MSG_RESULT(unknown)
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)
1318
AC_MSG_CHECKING([for aio_fildes member of aiocb structure])
1320
#ifdef HAVE_SIGNAL_H
1326
#ifdef HAVE_SYS_AIO_H
1327
#include <sys/aio.h>
1334
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]),
1337
AC_MSG_CHECKING(for aio_whence member of aiocb structure)
1339
#ifdef HAVE_SIGNAL_H
1345
#ifdef HAVE_SYS_AIO_H
1346
#include <sys/aio.h>
1348
#include <sys/types.h>
1352
a.aio_whence = SEEK_SET;
1355
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]),
1358
AC_MSG_CHECKING(for aio_handle member of aiocb structure)
1360
#ifdef HAVE_SIGNAL_H
1366
#ifdef HAVE_SYS_AIO_H
1367
#include <sys/aio.h>
1376
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]),
1379
AC_MSG_CHECKING(for aio_reqprio member of aiocb structure)
1381
#ifdef HAVE_SIGNAL_H
1387
#ifdef HAVE_SYS_AIO_H
1388
#include <sys/aio.h>
1396
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]),
1399
AC_MSG_CHECKING(for aio_sigevent member of aiocb structure)
1401
#ifdef HAVE_SIGNAL_H
1407
#ifdef HAVE_SYS_AIO_H
1408
#include <sys/aio.h>
1413
a.aio_sigevent.sigev_signo = 0;
1416
AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]),
1421
# End of aio-related tests
1424
# Check for statfs (many) and specifically f_fstypename field (BSD)
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])
1429
#ifdef HAVE_SYS_VFS_H
1430
#include <sys/vfs.h>
1432
#ifdef HAVE_SYS_STATVFS_H
1433
#include <sys/statvfs.h>
1435
#ifdef HAVE_SYS_PARAM_H
1436
#include <sys/param.h>
1438
#ifdef HAVE_SYS_MOUNT_H
1439
#include <sys/mount.h>
1444
pac_cv_have_statfs=yes,pac_cv_have_statfs=no
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)
1451
if test "$pac_cv_have_statfs" = yes ; then
1452
AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
1455
AC_MSG_CHECKING([for f_fstypename member of statfs structure])
1457
#include <sys/param.h>
1458
#include <sys/mount.h>
1462
memset(&f, 0, sizeof(f));
1463
strncmp("nfs", f.f_fstypename, 3);
1465
pac_cv_have_statfs_f_fstypename=yes,
1466
pac_cv_have_statfs_f_fstypename=no
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])
1474
# Check for stat and st_fstype field (NEC SX4)
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])
1481
#ifdef HAVE_SYS_TYPES_H
1482
#include <sys/types.h>
1484
#ifdef HAVE_SYS_STAT_H
1485
#include <sys/stat.h>
1487
#ifdef HAVE_UNISTD_H
1496
AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member),
1502
# Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.)
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])
1509
#ifdef HAVE_SYS_TYPES_H
1510
#include <sys/types.h>
1512
#ifdef HAVE_SYS_VFS_H
1513
#include <sys/vfs.h>
1515
#ifdef HAVE_SYS_STATVFS_H
1516
#include <sys/statvfs.h>
1521
foo.f_basetype = NULL;
1524
AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member),
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
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,[
1540
#ifndef _LFS64_LARGEFILE
1541
#error no largefile defines
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,[
1548
#define _LARGEFILE64_SOURCE
1549
#define _FILE_OFFSET_BITS 64
1550
#include <sys/types.h>
1552
],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)])
1554
if test "$ac_cv_off64_t_scalar" = "yes" ; then
1555
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
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
####################################################################
1566
if test -n "$mpi_mpich"; then
1567
if test -z "$arch_SX4" ; then
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])
1576
if test -n "$mpi_sgi"; then
1577
AC_DEFINE(MPISGI,1,[Define if SGI MPI])
1580
if test -n "$mpi_lam"; then
1581
AC_DEFINE(MPILAM,1,[Define if using LAM/MPI])
1584
if test -n "$mpi_hp"; then
1585
AC_DEFINE(MPIHP,1,[Define if using HP MPI])
1586
if test "$NOF77" = 0; then
1591
AC_CHECK_FUNCS(strerror)
1592
if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi
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])
1602
AC_SUBST(master_top_srcdir)
1604
# Get the master builddir (which may be imported from above)
1605
if test -z "$master_top_builddir" ; then
1606
master_top_builddir=`pwd`
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)
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])
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"
1629
if test ! -d $top_build_dir/lib ; then
1630
mkdir $top_build_dir/lib
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
1638
LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a"
1642
if test "$FROM_MPICH2" != no ; then
1643
# use the error handlers from MPICH2
1645
MPIO_EXTRA_TMP_POBJECTS=
1646
MPIO_EXTRA_REAL_POBJECTS=
1647
# Use generalized request to get the multiple-completion routines
1649
MPIO_REQ_TMP_POBJECTS=
1650
MPIO_REQ_REAL_POBJECTS=
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)
1659
# Use DOCTEXT instead of doctext
1660
AC_CHECK_PROGS(DOCTEXT,doctext,true)
1663
if test $NOF77 = 1 ; then
1666
FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test"
1669
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
1676
if test "$MPI_INCLUDE_DIR" = "." ; then
1677
ROMIO_INCLUDE="-I../include"
1679
ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR"
1682
TEST_LIBNAME=$LIBNAME
1685
if test "$MPI" = "open_mpi" ; then
1687
# Open MPI does have the status set bytes functionality
1689
AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
1691
# Used in the tests/ subdirectory for after ROMIO is built
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])
1708
# if MPICH, use mpicc in test programs
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
1719
MPIRUN=$MPI_BIN_DIR/mpirun
1720
if test -n "$arch_SX4" || test -n "$arch_hpux" ; then
1721
TEST_F77=$MPI_BIN_DIR/mpif90
1723
TEST_F77=$MPI_BIN_DIR/mpif77
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])
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])
1742
# Used in the tests/ subdirectory for after ROMIO is built
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"
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
1767
#CC=${top_build_dir}/bin/mpicc
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
1776
MPIRUN=${master_top_builddir}/bin/mpiexec
1778
# Turn off the building of the Fortran interface and the Info routines
1780
AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if status_set_bytes available])
1781
DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST"
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
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])
1794
if test -z "$TEST_CC" ; then
1797
if test -z "$TEST_F77" ; then
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)
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)
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)
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)
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)
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)
1832
# Create the directory lists for the Makefile
1834
for dir in $FILE_SYSTEM ; do
1835
FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$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"
1844
GLUE_DIR="mpi-io/glue/default"
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"
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"
1858
if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
1859
EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran"
1861
AC_SUBST(EXTRA_SRC_DIRS)
1862
AC_SUBST(FILE_SYS_DIRS)
1866
CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
1869
if test -n "$MPIOF_H_INCLUDED"; then
1872
F77MPIOINC="include 'mpiof.h'"
1878
dnl CFLAGS="$CFLAGS $DEFS"
1879
CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
1881
# Open MPI: we need libtool
1884
# Open MPI: setup the AM_CONDITIONALs to build the different adio devices
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["])])
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"
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'
1901
# Open MPI - AM doesn't want the following:
1902
# VPATH, CC, CPPFLAGS, CFLAGS, AR, RANLIB, F77, MAKE
1903
#VPATH='VPATH = .:${srcdir}'
1906
AC_SUBST(FILE_SYSTEM)
1910
AC_SUBST(USER_CFLAGS)
1911
AC_SUBST(USER_FFLAGS)
1917
AC_SUBST(MPI_INCLUDE_DIR)
1924
AC_SUBST(ROMIO_HOME)
1926
AC_SUBST(TEST_LIBNAME)
1930
AC_SUBST(F77MPIOINC)
1931
AC_SUBST(FTESTDEFINE)
1932
AC_SUBST(FORTRAN_MPI_OFFSET)
1933
AC_SUBST(FROM_MPICH)
1934
AC_SUBST(FROM_MPICH2)
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)
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)
1968
AC_SUBST(FORTRAN_TEST)
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...
1975
#dnl Support shared libraries
1976
#if test -z "$ENABLE_SHLIB" ; then
1979
#AC_SUBST(ENABLE_SHLIB)
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)
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
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
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
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
2039
mpi-io/glue/openmpi/Makefile
2045
# Open MPI - don't need to remove this...
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.])
2052
dnl PAC_SUBDIR_CACHE_CLEANUP