-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
622 lines (545 loc) · 18.6 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
AC_REVISION($Id: configure.in 1089 2012-09-21 21:14:47Z robl $)dnl
dnl -*- Mode: shell-script-mode; -*-
dnl Process this file with GNU autoconf(1) to produce a configure script.
dnl
dnl Defaults:
CPPFLAGS=${CFLAGS}
CFLAGS=${CFLAGS--O}
FPPFLAGS=${FPPFLAGS-}
FFLAGS=${FFLAGS-}
AC_INIT(src/lib/ncconfig.in)
AC_PREREQ(2.59)
UD_SRCDIR
dnl AC_PREFIX_DEFAULT(`(cd ..; pwd)`)
PNETCDF_VERSION_MAJOR=1
PNETCDF_VERSION_MINOR=3
PNETCDF_VERSION_SUB=1
#PNETCDF_VERSION_PRE=svn
#PNETCDF_VERSION_PRE="pre1"
PNETCDF_VERSION=$PNETCDF_VERSION_MAJOR.$PNETCDF_VERSION_MINOR.$PNETCDF_VERSION_SUB$PNETCDF_VERSION_PRE
AC_DEFINE_UNQUOTED(PNETCDF_VERSION_MAJOR, $PNETCDF_VERSION_MAJOR, major version number)
AC_DEFINE_UNQUOTED(PNETCDF_VERSION_MINOR, $PNETCDF_VERSION_MINOR, minor version number)
AC_DEFINE_UNQUOTED(PNETCDF_VERSION_SUB, $PNETCDF_VERSION_SUB, sub version number)
AC_DEFINE_UNQUOTED(PNETCDF_VERSION_PRE, $PNETCDF_VERSION_PRE, pre-release string)
AC_DEFINE_UNQUOTED(PNETCDF_VERSION, ["$PNETCDF_VERSION"], full pnetcdf version string)
AC_SUBST(PNETCDF_VERSION_MAJOR)
AC_SUBST(PNETCDF_VERSION_MINOR)
AC_SUBST(PNETCDF_VERSION_SUB)
AC_SUBST(PNETCDF_VERSION_PRE)
AC_SUBST(PNETCDF_VERSION)
dnl must be all on same line
AC_CONFIG_HEADER( src/lib/ncconfig.h:src/lib/ncconfig.in src/libf/pnetcdf_inc src/libf/nfconfig.inc:src/libf/nfconfig.in )
AC_CONFIG_AUX_DIR(./scripts)
dnl these used to live in acconfig.h
AH_TEMPLATE([SIZEOF_OFF_T], [Number of bytes in a off_t])
AH_TEMPLATE([SIZEOF_SIZE_T], [Number of bytes in a size_t])
AH_TEMPLATE([NCBYTE_T], [Type of NC_BYTE])
AH_TEMPLATE([NCSHORT_T], [Type of NC_SHORT])
AH_TEMPLATE([NF_DOUBLEPRECISION_IS_C_], [C type for Fortran dobule])
AH_TEMPLATE([NF_INT1_IS_C_], [C type for Fortran INT1])
AH_TEMPLATE([NF_INT1_T], [Type for Fortran INT1])
AH_TEMPLATE([NF_INT2_IS_C_], [C type for Fortran INT2])
AH_TEMPLATE([NF_INT2_T], [Type for Fortran INT2])
AH_TEMPLATE([NF_INT_IS_C_], [C type for Fortran INT])
AH_TEMPLATE([NF_INT8_IS_C_], [C type for Fortran INT8])
AH_TEMPLATE([NF_INT8_T], [Type for Fortran INT8])
AH_TEMPLATE([NF_REAL_IS_C_], [C type for Fortran REAL])
AH_TEMPLATE([NO_IEEE_FLOAT], [Does sytem have IEEE FLOAT])
AH_TEMPLATE([NO_STRERROR], [Define if system lacks strerror])
AH_TEMPLATE([NO_ACCESS], [Define if system lacks access])
AC_HEADER_STDC
AC_MSG_CHECKING(rm)
if test x${RM} != x ; then
RM=${RM}
else
RM="rm"
fi
AC_MSG_RESULT(using $RM)
AC_SUBST(RM)
AC_ARG_ENABLE(fortran,
[ --enable-fortran Turn on support for the Fortran interface. Turn this
off if you only need the C interface (on by default)],
,enable_fortran=yes)
dnl I took the "-ansi" off the CFLAGS for the strict case, as it was
dnl preventing PATH_MAX from being defined for some of the test files,
dnl and I was having a tough time figuring out how to get it back! -- RobR
AC_ARG_ENABLE(strict,
[ --enable-strict Turn on strict debugging with gcc],
CFLAGS="$CFLAGS -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast")
AC_ARG_ENABLE(echo,
[ --enable-echo Turn on strong echoing. The default is enable=no.]
,set -x)
AC_PROG_INSTALL
AC_PROG_YACC
AC_PROG_LEX
found_yacc_flex=0;
dnl if configure finds bison then YACC is set to bison -y, so we need to clean
dnl up the output a bit before testing
if which "${YACC% *}" >/dev/null && which "$LEX" >/dev/null ; then
found_yacc_flex=1;
fi
if test "$found_yacc_flex" -ne 1 ; then
AC_MSG_ERROR([could not find bison/yacc or flex/lex. Development tools installed?])
fi
UD_PROG_M4
AC_PROG_CC
dnl AC_PROG_CXX
dnl AC_PROG_F77
if test "$enable_fortran" = "yes" ; then
if test -z "$FC" -a -n "$F77" ; then
FC="$F77"
fi
dnl 'UD_PROG_FC' is quite elaborate and does a whole lot more than just
dnl find a fortran compiler. it also checks fortran types and fortran
dnl calling convention. So don't change this to AC_PROG_FC :>
UD_PROG_FC
fi
UD_PROG_CC_MAKEDEPEND
dnl need a --with-cxx=no and --with-fortran=no
dnl UD_PROG_CXX
dnl UD_PROG_F90
# Checking for Fortran types also determines the Fortran name mangling
# and places the value into FCALLSCSUB as a the C name corresponding
# to the Fortran name SUB
if test "$enable_fortran" = yes ; then
UD_CHECK_FCALLSCSUB
fi
UD_CHECK_LIB_MATH
UD_PROG_AR()
UD_PROG_NM()
# We could use the PAC check for ranlib (it also makes sure that ranlib works,
# which is not always true, particularly when GNU tools are installed on
# a system that doesn't have (or need) ranlib
AC_PROG_RANLIB
#
# If we are building the Fortran interface, determine the correct name mapping
if test "$enable_fortran" = yes ; then
case $FCALLSCSUB in
SUB)
AC_DEFINE(F77_NAME_UPPER,,[Define if Fortran names are uppercase])
;;
sub_)
# This is the hard case. Gcc uses one _ unless the name includes
# an underscore, in which case it gets two trailing underscores.
# Use essentially the same configure code that the original configure
# used to determine SUB
AC_MSG_CHECKING(for C-equivalent to Fortran routine \"SUB_A\")
dnl "
cat >conftest.f <<\EOF
call sub_a()
end
EOF
doit='$FC -c ${FFLAGS} conftest.f'
if AC_TRY_EVAL(doit); then
FCALLSCSUBA=`$NM $NMFLAGS conftest.o | awk '
/SUB_A_/{print "SUB_A_";exit}
/SUB_A/ {print "SUB_A"; exit}
/sub_a__/ {print "sub_a__"; exit}
/sub_a_/{print "sub_a_";exit}
/sub_a/ {print "sub_a"; exit}'`
case "$FCALLSCSUBA" in
'') AC_MSG_ERROR(not found)
;;
*) AC_MSG_RESULT($FCALLSCSUBA)
;;
esac
else
AC_MSG_ERROR(Could not compile conftest.f)
fi
${RM} -f conftest*
case "$FCALLSCSUBA" in
sub_a__)
AC_DEFINE(F77_NAME_LOWER_2USCORE,,[Define if Fortran names are lower case with two trailing underscore2])
;;
sub_a_)
AC_DEFINE(F77_NAME_LOWER_USCORE,,[Define if Fortran names are lower case with one trailing underscore])
;;
*)
AC_MSG_WARN([Unrecognized Fortran name mapping])
;;
esac
;;
sub)
AC_DEFINE(F77_NAME_LOWER,,[Define if Fortran names are lower case])
;;
*)
AC_MSG_WARN([Unrecognized Fortran name mapping])
;;
esac
fi
MPI_INSTALL=""
AC_ARG_WITH(mpi,
[ --with-mpi=/path/to/implementation
installation prefix for MPI implementation],
if test x"$withval" = xyes; then
AC_MSG_ERROR(--with-mpi must be given a pathname)
else
MPI_INSTALL=${withval}
fi
)
dnl do the automatic mpi-compiler-checking if MPICC and MPIF77 are not set
dnl i.e. if user sets compiler environnent variables, those will override the
dnl --with-mpi flag
if test x${MPI_INSTALL} != x ; then
AC_MSG_CHECKING(mpi C compiler )
if test x${MPICC} = x ; then
MPICC=${MPI_INSTALL}/bin/mpicc
fi
if test ! -x "${MPICC}" ; then
AC_MSG_WARN($MPICC either does not exist or is not executable: falling back to $CC)
MPICC="$CC"
fi
AC_MSG_RESULT(using $MPICC)
AC_MSG_CHECKING(mpi C++ compiler )
if test x${MPICXX} = x ; then
MPICXX=${MPI_INSTALL}/bin/mpicxx
fi
if test ! -x "${MPICXX}" ; then
AC_MSG_WARN($MPICXX either does not exist or is not executable: falling back to $CC)
MPICXX="$CC"
fi
AC_MSG_RESULT(using $MPICXX)
AC_MSG_CHECKING(mpi Fortran 77 compiler )
if test x${MPIF77} = x ; then
MPIF77=${MPI_INSTALL}/bin/mpif77
fi
if test ! -x "${MPIF77}" ; then
AC_MSG_WARN($MPIF77 either does not exist or is not executable: falling back to $FC)
MPIF77="$FC"
fi
AC_MSG_RESULT(using $MPIF77)
AC_MSG_CHECKING(mpi Fortran 90 compiler )
if test x${MPIF90} = x ; then
MPIF90=${MPI_INSTALL}/bin/mpif90
fi
if test ! -x "${MPIF90}" ; then
AC_MSG_WARN($MPIF90 either does not exist or is not executable: falling back to $FC)
MPIF90="$FC"
fi
AC_MSG_RESULT(using $MPIF90)
fi
if test ! -x "$(which ${MPICC})" ; then
AC_MSG_ERROR(parallel-netcdf requires an mpi compiler. Please specify
the location of one either with the MPICC environment variable or the
--with-mpi configure flag)
fi
if test "$enable_fortran" = yes ; then
if test ! -x "$(which ${MPIF77})" ; then
AC_MSG_ERROR(you have requested fortran support but configure
cannot find a Fortran77 compiler. Please specifiy the location
of one either with the MPIF77 environment variable or the --with-mpi
configure flag.)
fi
if test ! -x "$(which ${MPIF90})" ; then
AC_MSG_ERROR(you have requested fortran support but configure
cannot find a Fortran90 compiler. Please specifiy the location
of one either with the MPIF90 environment variable or the
--with-mpi configure flag.)
fi
fi
AC_ARG_ENABLE(mpi-io-test,
[ --enable-mpi-io-test Check for MPI-IO support in MPI implementation.
Turn this off if you know your MPI
implementation has MPI-IO support but the
configure test fails to find it (on by default)]
,,enable_mpi_io_test=yes )
if test "$enable_mpi_io_test" = "yes" ; then
AC_MSG_CHECKING(MPI-IO support in MPI implementation)
saveCC="$CC"
if test x$MPICC != x ; then
CC=$MPICC
fi
AC_TRY_COMPILE([#include "mpi.h"], [int a = MPI_MODE_RDWR;],
AC_MSG_RESULT(yes),
AC_MSG_ERROR([mpi implementation does not support MPI-IO])
)
CC="$saveCC"
fi
AC_SUBST(MPICC)
AC_SUBST(MPIF77)
AC_SUBST(MPICXX)
AC_SUBST(MPIF90)
AC_CHECK_HEADERS(stdlib.h sys/types.h)
# Check for <stdbool.h> that conforms to C99 requirements
AC_HEADER_STDBOOL
AC_CHECK_FUNC(strerror, ,AC_DEFINE(NO_STRERROR))
AC_CHECK_FUNC(access, ,AC_DEFINE(NO_ACCESS))
AC_FUNC_ALLOCA
AC_STRUCT_ST_BLKSIZE
UD_CHECK_IEEE
AC_TYPE_SIZE_T
dnl
dnl *** SWITCHING TO USING MPICC ***
dnl
saveCC="$CC"
CC=$MPICC
dnl compile-only check for size of MPI types (based on one for MPI_Offset from
dnl Christopher Subich <[email protected]>)
AC_DEFUN([UD_MPI_CHECK_SIZE], [
if test ! "$ac_cv_sizeof_$1"; then
AC_MSG_CHECKING(if $1 is size $2)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
#include "mpi.h"
#include <stdio.h>
int main (int argc, char **argv)
{
static int test_array [[sizeof ($1) == $2 ? 1 : -1 ]];
return 0;
}])],
AC_MSG_RESULT(yes)
ac_cv_sizeof_$1=$2,
AC_MSG_RESULT(no))
fi
])
UD_MPI_CHECK_SIZE(MPI_Offset, 8)
UD_MPI_CHECK_SIZE(MPI_Offset, 4)
UD_MPI_CHECK_SIZE(MPI_Offset, 16)
UD_MPI_CHECK_SIZE(MPI_Aint, 8)
UD_MPI_CHECK_SIZE(MPI_Aint, 4)
UD_MPI_CHECK_SIZE(MPI_Aint, 16)
dnl ok, now we know how big MPI_Offset is. If it's less than 8 bytes
dnl we have to disable the new "CDF-5" (variables larger than 4gb) support
enable_cdf5=yes
if test "$ac_cv_sizeof_MPI_Offset" -lt "8"; then
AC_MSG_WARN("Unable to support CDF-5 format");
enable_cdf5=no
fi
if test "$enable_cdf5" = "yes" ; then
AC_DEFINE(ENABLE_CDF5,,[Define if able to support CDF-5 file format])
fi
AC_CHECK_FUNCS(MPI_Info_dup MPI_Info_free MPI_Get_address,,)
# the nonblocking routines need these functions
enable_nonblocking=yes
AC_CHECK_FUNCS(MPI_Request_get_status MPI_Type_dup,,
enable_nonblocking=no
)
# the nonblocking routines build up lists of requests with MPI_Type_struct. If
# MPI_Offset not the same size as MPI_Aint, the arrays passed around will get
# mangled.
if test "$ac_cv_sizeof_MPI_Offset" -ne "$ac_cv_sizeof_MPI_Aint"; then
AC_MSG_WARN(MPI_Offset and MPI_Aint have different sizes: unable to support non-blocking routines)
enable_nonblocking=no
fi
if test "$enable_nonblocking" = "yes" ; then
AC_DEFINE(ENABLE_NONBLOCKING,,[Define if able to support nonblocking routines])
fi
dnl Check for presence of various MPI_COMBINERs. These could be
dnl enums, so we have to do compile checks.
AC_DEFUN([UD_HAS_MPI_COMBINER], [
AC_MSG_CHECKING(if MPI includes $1)
AC_TRY_COMPILE([ #include <mpi.h> ],
[int combiner = $1; ],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_$1, 1, available),
AC_MSG_RESULT(no)
)
]
)
UD_HAS_MPI_COMBINER(MPI_COMBINER_DUP)
UD_HAS_MPI_COMBINER(MPI_COMBINER_HVECTOR_INTEGER)
UD_HAS_MPI_COMBINER(MPI_COMBINER_HINDEXED_INTEGER)
UD_HAS_MPI_COMBINER(MPI_COMBINER_SUBARRAY)
UD_HAS_MPI_COMBINER(MPI_COMBINER_DARRAY)
UD_HAS_MPI_COMBINER(MPI_COMBINER_RESIZED)
UD_HAS_MPI_COMBINER(MPI_COMBINER_STRUCT_INTEGER)
UD_HAS_MPI_COMBINER(MPI_COMBINER_INDEXED_BLOCK)
UD_HAS_MPI_COMBINER(MPI_COMBINER_F90_REAL)
UD_HAS_MPI_COMBINER(MPI_COMBINER_F90_INTEGER)
UD_HAS_MPI_COMBINER(MPI_COMBINER_F90_COMPLEX)
dnl Check for presence of Fortran types
dnl
dnl We do this for a couple of reasons. First, the MPI might have been
dnl built without Fortran support, in which case these types might not
dnl exist. Second, we need to map these types to corresponding C types
dnl where possible to simplify processing at runtime.
AC_DEFUN([UD_HAS_MPI_TYPE], [
AC_MSG_CHECKING(if MPI includes $1)
AC_TRY_COMPILE([ #include <mpi.h> ],
[int datatype = $1; ],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_$1, 1, available),
AC_MSG_RESULT(no)
)
]
)
UD_HAS_MPI_TYPE(MPI_CHARACTER)
UD_HAS_MPI_TYPE(MPI_REAL)
UD_HAS_MPI_TYPE(MPI_INTEGER)
UD_HAS_MPI_TYPE(MPI_DOUBLE_PRECISION)
UD_HAS_MPI_TYPE(MPI_INTEGER1)
UD_HAS_MPI_TYPE(MPI_INTEGER2)
UD_HAS_MPI_TYPE(MPI_INTEGER4)
UD_HAS_MPI_TYPE(MPI_INTEGER8)
UD_HAS_MPI_TYPE(MPI_INTEGER16)
UD_HAS_MPI_TYPE(MPI_REAL4)
UD_HAS_MPI_TYPE(MPI_REAL8)
UD_HAS_MPI_TYPE(MPI_REAL16)
UD_HAS_MPI_TYPE(MPI_COMPLEX8)
UD_HAS_MPI_TYPE(MPI_COMPLEX16)
UD_HAS_MPI_TYPE(MPI_COMPLEX32)
UD_HAS_MPI_TYPE(MPI_UB)
UD_HAS_MPI_TYPE(MPI_LB)
dnl Check for presence of error codes
dnl
AC_DEFUN([UD_HAS_MPI_ERROR_CODE], [
AC_MSG_CHECKING(if MPI includes $1)
AC_TRY_COMPILE([ #include <mpi.h> ],
[int err = $1; ],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_$1, 1, available),
AC_MSG_RESULT(no)
)
]
)
UD_HAS_MPI_ERROR_CODE(MPI_ERR_FILE_EXISTS)
UD_HAS_MPI_ERROR_CODE(MPI_ERR_NO_SUCH_FILE)
dnl
dnl *** GOING BACK TO REGULAR CC ***
dnl
CC="$saveCC"
AC_TYPE_OFF_T
AC_CHECK_TYPES([ssize_t, ptrdiff_t, uchar, ushort, uint, int64, uint64])
AC_C_CHAR_UNSIGNED
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(ushort)
AC_CHECK_SIZEOF(uint)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(unsigned long long)
dnl Check the size of MPI_Offset.
dnl As some platforms don't allow running MPI-linked executives directly,
dnl the test program is only compiled with MPICC inorder to know "mpi.h"
dnl and is linked with CC to allow direct run in the script.
AC_CACHE_CHECK([sizeof MPI_Offset],ac_cv_sizeof_MPI_Offset,
[
cat >conftest.c <<EOF
#include "mpi.h"
#include <stdio.h>
int main( int argc, char **argv )
{
MPI_Offset a;
FILE *f = fopen("conftestval", "w" );
if (! f) return 1;
fprintf( f, "%ld\n", (long)sizeof(a) );
fclose(f);
return 0;
}
EOF
if $MPICC -c conftest.c && $MPICC -o conftest conftest.o ; then
if ./conftest ; then
#success
ac_cv_sizeof_MPI_Offset=`cat conftestval`
else
# failure
AC_MSG_WARN([Unable to run the program to determine sizeof MPI_Offset])
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
${RM} -f conftest*
else
AC_MSG_ERROR([Unable to compile or link the test program])
fi
])
dnl according to autoconf-2.57, this is the correct way to use AC_CACHE_CHECK: call AC_DEFINE after AC_CACHE_CHECK
AC_DEFINE_UNQUOTED(SIZEOF_MPI_OFFSET, $ac_cv_sizeof_MPI_Offset, [The number of bytes in an MPI_Offset])
if test "$enable_fortran" = yes ; then
UD_FORTRAN_TYPES
NFMPI_OFFSET="integer*$ac_cv_sizeof_MPI_Offset"
AC_MSG_CHECKING(for Fortran \"$NFMPI_OFFSET\") # "
cat >conftest.f <<EOF
subroutine sub(value)
$NFMPI_OFFSET value
end
EOF
doit='$FC -c ${FFLAGS} conftest.f'
if AC_TRY_EVAL(doit); then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(F77 does not support \"$NFMPI_OFFSET\") # "
fi
${RM} -f conftest*
fi
UD_MAKEWHATIS
AC_SYS_LARGEFILE
SAVECC=$CC
CC=$MPICC
AC_SEARCH_LIBS(MPI_File_sync, mpio hpmpio,,
AC_MSG_ERROR(Cannot find MPI-IO library)
)
CC=$SAVECC
dnl sometimes AC_CHECK_SIZEOF wasn't good... check this on several platforms
AC_CHECK_SIZEOF(off_t)
dnl on some 64 bit platforms, the _LFS64_LARGEFILE define may not exist -- it
dnl was, after all, designed for 32 bit systems trying to access large files.
dnl If off_t is 8 bytes, then we *can* work on large files: do one last check
dnl so we report the right information to the user
if test "$ac_cv_sizeof_off_t" = "8" ; then
large_file_support="yes"
fi
dnl
dnl After all other tests, optionally enable coverage. we do this last
dnl because legend has it that sometimes on some compilers the coverage flags
dnl mess up other checks
dnl
AC_ARG_ENABLE(coverage,
[AS_HELP_STRING([--enable-coverage],
[Compile with coverage support (gcc-based only)])],
CFLAGS="${CFLAGS} -pg -fprofile-arcs -ftest-coverage --coverage -O0"
FFLAGS="${FFLAGS} -pg -fprofile-arcs -ftest-coverage --coverage -O0"
LIBS="${LIBS} -lgcov",
[])
has_fortran=$enable_fortran
AC_SUBST(has_fortran)
chmod u+x ${srcdir}/scripts/install-sh
AC_OUTPUT(macros.make Makefile src/Makefile test/Makefile src/lib/Makefile
src/lib/pnetcdf.h
src/libf/Makefile test/common/Makefile test/test_double/Makefile
test/test_double_int/Makefile test/test_float/Makefile
test/test_int/Makefile test/test_dtype/Makefile
test/nc_test/Makefile test/nf_test/Makefile
test/fandc/Makefile src/utils/Makefile src/utils/ncdump/Makefile
src/utils/ncdiff/Makefile
src/utils/ncgen/Makefile test/testcases/Makefile
test/C/Makefile test/nonblocking/Makefile
test/test_check_header/Makefile
test/test_inq_format/Makefile
test/largefile/Makefile
test/data/Makefile
examples/tutorial/Makefile
examples/Makefile)
dnl generate a fortran-friendly pnetcdf_inc nfconfig.inc
sed -e "s%/\*%!%g" -e "s%\*/%%g" <src/libf/pnetcdf_inc>pnetcdf_inc && mv pnetcdf_inc src/libf/pnetcdf_inc
sed -e "s%/\*%!%g" -e "s%\*/%%g" <src/libf/nfconfig.inc>nfconfig.inc && mv nfconfig.inc src/libf/nfconfig.inc
if test "$enable_mpi_io_test" != "yes" ; then
AC_MSG_WARN([
"NOTE: disabling the MPI-IO test is a VERY bad idea. Please make sure you know what you are doing"])
fi
echo ""
echo "parallel-netCDF version $PNETCDF_VERSION features:"
if test "$ac_cv_sizeof_off_t" -gt 4 ; then
echo ". parallel-netcdf configured WITH support for large files"
else
echo ". parallel-netcdf configured WITHOUT support for large files"
fi
if test "$enable_fortran" = "yes" ; then
echo ". parallel-netcdf configured WITH fortran bindings"
else
echo ". parallel-netcdf configured WITHOUT fortran bindings"
fi
if test "$enable_nonblocking" = "yes" ; then
echo ". parallel-netcdf configured WITH nonblocking routines"
else
echo ". parallel-netcdf configured WITHOUT nonblocking routines"
fi
if test "$enable_cdf5" = "yes" ; then
echo ". parallel-netcdf configured WITH giant variable support"
else
echo ". parallel-netcdf configured WITHOUT giant variable (CDF-5) support"
fi