-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
1687 lines (1527 loc) · 62.2 KB
/
configure.ac
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
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl
dnl Copyright (C) 2017, Northwestern University and Argonne National Laboratory
dnl See COPYRIGHT notice in top-level directory.
dnl
AC_REVISION([$Revision$])dnl
dnl The above uses SVN keyword Revision to copy the unique revision number as
dnl a stamp into configure script. When using git, use the following line
dnl instead.
dnl AC_REVISION([m4_esyscmd_s([git describe --always])])
dnl -*- Mode: shell-script-mode; -*-
dnl Process this file with GNU autoconf(1) to produce a configure script.
dnl
dnl autoconf v2.69 was released in 2012-04-24
AC_PREREQ([2.69])
AC_INIT([parallel-netcdf],[1.9.0],[[email protected]])
dnl config.h.in will be created by autoreconf (autoheader)
dnl call it right after AC_INIT, as suggested by autoconf
AC_CONFIG_HEADERS([src/include/config.h])
AC_CONFIG_SRCDIR([src/include/pnetcdf.h.in])
AC_CONFIG_AUX_DIR([./scripts])
dnl Note getting command line should be done before calling AM_INIT_AUTOMAKE
dnl as AM_INIT_AUTOMAKE modifies command line $*
CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
dnl AM_INIT_AUTOMAKE([subdir-objects])
AM_INIT_AUTOMAKE([1.13])
dnl enable silent rules by default
AM_SILENT_RULES([yes])
dnl if maintainer mode is disabled, make will *never* attempt to rebuild configure,
dnl Makefile.ins, etc.
AM_MAINTAINER_MODE([enable])
m4_ifdef([AC_CONFIG_MACRO_DIRS], [AC_CONFIG_MACRO_DIRS([m4])], [AC_CONFIG_MACRO_DIR([m4])])
dnl AM_EXTRA_RECURSIVE_TARGETS macro was introduced into automake 1.13
m4_ifdef([AM_EXTRA_RECURSIVE_TARGETS], [AM_EXTRA_RECURSIVE_TARGETS([tests])])
dnl parse the version numbers to 4 env variables
PNETCDF_VERSION_MAJOR=`echo ${PACKAGE_VERSION} | cut -d. -f1`
PNETCDF_VERSION_MINOR=`echo ${PACKAGE_VERSION} | cut -d. -f2`
PNETCDF_VERSION_SUB=`echo ${PACKAGE_VERSION} | cut -d. -f3`
PNETCDF_VERSION_PRE=`echo ${PACKAGE_VERSION} | cut -d. -f4`
dnl Note major, minor, and sub are required, but pre is not.
PNETCDF_VERSION=${PACKAGE_VERSION}
dnl Do not change the following line, It is set by SVN automatically.
dnl It defines PNETCDF_RELEASE_DATE, a string that will be used in
dnl ncmpi_inq_libvers() to generate release date
dnl SVN_DATE="$LastChangedDate$"
dnl PNETCDF_RELEASE_DATE2=`echo $SVN_DATE | cut -d' ' -f2`
dnl PNETCDF_RELEASE_DATE=`echo $SVN_DATE | cut -d' ' -f6,7,8 | cut -d')' -f1`
dnl user defined macro for printing messages for debugging
dnl add "pnc_ac_debug=yes" at command line to enable
AC_DEFUN([UD_MSG_DEBUG],
[if test "x${pnc_ac_debug}" = xyes ; then
AC_MSG_NOTICE([DEBUG: $1])
fi
]
)
UD_MSG_DEBUG([PNETCDF_VERSION_MAJOR=$PNETCDF_VERSION_MAJOR])
UD_MSG_DEBUG([PNETCDF_VERSION_MINOR=$PNETCDF_VERSION_MINOR])
UD_MSG_DEBUG([PNETCDF_VERSION_SUB=$PNETCDF_VERSION_SUB])
UD_MSG_DEBUG([PNETCDF_VERSION_PRE=$PNETCDF_VERSION_PRE])
UD_MSG_DEBUG([PNETCDF_VERSION=$PNETCDF_VERSION])
dnl UD_MSG_DEBUG([PNETCDF_RELEASE_DATE=$PNETCDF_RELEASE_DATE])
dnl AC_DEFINE_UNQUOTED(PNETCDF_VERSION_MAJOR, $PNETCDF_VERSION_MAJOR, major version number)
dnl AC_DEFINE_UNQUOTED(PNETCDF_VERSION_MINOR, $PNETCDF_VERSION_MINOR, minor version number)
dnl AC_DEFINE_UNQUOTED(PNETCDF_VERSION_SUB, $PNETCDF_VERSION_SUB, sub version number)
dnl AC_DEFINE_UNQUOTED(PNETCDF_VERSION_PRE, $PNETCDF_VERSION_PRE, pre-release string)
dnl AC_DEFINE_UNQUOTED(PNETCDF_VERSION, ["$PNETCDF_VERSION"], full PnetCDF version string)
dnl AC_DEFINE_UNQUOTED(PNETCDF_RELEASE_DATE, ["$PNETCDF_RELEASE_DATE"], PnetCDF release date string)
dnl AC_DEFINE_UNQUOTED(CONFIGURE_ARGS_CLEAN, ["$CONFIGURE_ARGS_CLEAN"], configure command-line arguments used)
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 AC_SUBST(PNETCDF_RELEASE_DATE)
dnl AC_SUBST(PNETCDF_RELEASE_DATE2)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(CONFIGURE_ARGS_CLEAN)
dnl autoheader only adds these templates to the first invocation of AC_CONFIG_HEADERS
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 double])
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 system have IEEE FLOAT])
AH_TEMPLATE([DISABLE_FILE_SYNC], [Define if to disable MPI_File_sync])
AH_TEMPLATE([ENABLE_IN_PLACE_SWAP], [Define if to enable in-place byte swap])
AH_TEMPLATE([DISABLE_IN_PLACE_SWAP], [Define if to disable in-place byte swap])
AH_TEMPLATE([ENABLE_SUBFILING], [Define if to enable subfiling feature])
AH_TEMPLATE([PNC_MALLOC_TRACE], [Define if to enable malloc tracing])
AH_TEMPLATE([HAVE_FUNC_MACRO], [Define if C++ macro __func__ is defined])
AH_TEMPLATE([HAVE_FUNCTION_MACRO], [Define if C++ macro __FUNCTION__ is defined])
AH_TEMPLATE([RELAX_COORD_BOUND], [Define if relaxed coordinate check is enabled])
AH_TEMPLATE([ENABLE_LARGE_REQ], [Define if to enable single large MPI-IO request])
AH_TEMPLATE([ENABLE_NULL_BYTE_HEADER_PADDING], [Define if to enable strict null-byte padding in file header])
AH_TEMPLATE([BUILD_DRIVER_DW], [Define if to enable DataWarp burst buffer feature])
AH_TEMPLATE([PNETCDF_PROFILING], [Define if to enable PnetCDF internal performance profiling])
dnl AH_TEMPLATE([HAVE_MPI_COUNT], [Define if type MPI_Count is defined])
AH_TOP([#ifndef _CONFIG_H
#define _CONFIG_H])
AH_BOTTOM([#include <nctypes.h>
#endif])
dnl an option to use a customized rm command
AC_ARG_VAR(RM, Command for deleting files or directories. @<:@default: rm@:>@)
if test "x${RM}" != x ; then
AC_MSG_CHECKING(rm )
if ! test -f ${RM} ; then
AC_CHECK_PROG([rm_cmd], [${RM}], [yes], [no])
if test "x${rm_cmd}" = xyes ; then
RM=${RM}
fi
else
RM=${RM}
fi
AC_MSG_RESULT(using $RM)
else
RM="rm"
fi
AC_ARG_ENABLE(echo,
[AS_HELP_STRING([--enable-echo],
[Turn on strong echoing. @<:@default: disabled@:>@])],
[set -x]
)
MPI_INSTALL=
AC_ARG_WITH(mpi,
[AS_HELP_STRING([--with-mpi=/path/to/implementation],
[The installation prefix path for MPI implementation.])],
[if test "x${withval}" = x ; then
AC_MSG_ERROR(--with-mpi is set but the value is NULL)
fi
if (! test -d "${withval}") ; then
AC_MSG_ERROR(Directory '${withval}' specified in --with-mpi does not exist)
fi
MPI_INSTALL=${withval}]
)
dnl MPI_INSTALL will be referred in UD_MPI_PATH_PROGS and UD_MPI_PATH_PROG
dnl defined in acinclude.m4
AC_ARG_VAR(MPICC, [MPI C compiler, @<:@default: CC@:>@])
AC_ARG_VAR(MPICXX, [MPI C++ compiler, @<:@default: CXX@:>@])
AC_ARG_VAR(MPIF77, [MPI Fortran 77 compiler, @<:@default: F77@:>@])
AC_ARG_VAR(MPIF90, [MPI Fortran 90 compiler, @<:@default: FC@:>@])
dnl AC_ARG_VAR(CPPFLAGS, [Preprocessor options for C and C++ compilers, e.g. -I<include_dir> if you have headers in a nonstandard directory <include_dir>])
dnl AC_ARG_VAR(CFLAGS, Debugging and optimization options for the C compiler)
dnl AC_ARG_VAR(CXXFLAGS, Debugging and optimization options for the C++ compiler)
dnl AC_ARG_VAR(FFLAGS, Debugging and optimization options for the Fortran 77 compiler)
dnl AC_ARG_VAR(FCFLAGS, Debugging and optimization options for the Fortran 90 compiler)
dnl Check if MPICC, MPICXX, MPIF77, MPIF90 are set by the user.
dnl If not, set MPICC equal to CC. Similarly, for MPICXX, MPIF77, and MPIF90
ac_user_MPICC=$MPICC
ac_user_MPICXX=$MPICXX
ac_user_MPIF77=$MPIF77
ac_user_MPIF90=$MPIF90
if test "x$MPICC" = x -a "x$CC" != x ; then ac_user_MPICC=$CC ; fi
if test "x$MPICXX" = x -a "x$CXX" != x ; then ac_user_MPICXX=$CXX ; fi
if test "x$MPIF77" = x -a "x$F77" != x ; then ac_user_MPIF77=$F77 ; fi
if test "x$MPIF77" = x -a "x$FC" != x ; then ac_user_MPIF77=$FC ; fi
if test "x$MPIF90" = x -a "x$F90" != x ; then ac_user_MPIF90=$F90 ; fi
if test "x$MPIF90" = x -a "x$FC" != x ; then ac_user_MPIF90=$FC ; fi
CANDIDATE_MPICC="${MPICC} mpicc mpicc_r"
CANDIDATE_MPICXX="${MPICXX} mpicxx mpic++ mpiCC mpcxx mpc++ mpicxx_r mpiCC_r mpcxx_r mpic++_r mpc++_r"
CANDIDATE_MPIF77="${MPIF77} mpif77 mpif77_r mpf77 mpf77_r"
CANDIDATE_MPIF90="${MPIF90} mpif90 mpif90_r mpf90 mpf90_r mpif95 mpif95_r mpf95 mpf95_r"
dnl add GNU MPI compilers
CANDIDATE_MPICC+=" mpigcc mpgcc mpigcc_r mpgcc_r"
CANDIDATE_MPICXX+=" mpig++ mpg++ mpig++_r mpg++_r"
CANDIDATE_MPIF77+=" mpig77 mpig77_r mpg77 mpg77_r"
CANDIDATE_MPIF90+=" mpigfortran mpgfortran mpigfortran_r mpgfortran_r"
dnl add IBM MPI compilers
CANDIDATE_MPICC+=" mpcc_r mpcc mpixlc_r mpixlc"
CANDIDATE_MPICXX+=" mpCC_r mpCC mpixlcxx_r mpixlcxx mpixlC_r mpixlC"
CANDIDATE_MPIF77+=" mpixlf77_r mpixlf77"
CANDIDATE_MPIF90+=" mpixlf90_r mpixlf90"
dnl add IBM BGL MPI compilers
CANDIDATE_MPICC+=" blrts_xlc mpxlc_r mpxlc"
CANDIDATE_MPICXX+=" blrts_xlC mpxlC_r mpxlC mpixlc++ mpxlcxx mpxlc++ mpxlCC mpixlc++_r mpxlcxx_r mpxlc++_r mpxlCC_r"
CANDIDATE_MPIF77+=" blrts_xlf mpxlf_r mpxlf mpxlf77 mpxlf77_r mpixlf mpixlf_r"
CANDIDATE_MPIF90+=" blrts_xlf90 mpxlf90_r mpxlf90 mpxlf95_r mpxlf95 mpixlf95 mpixlf95_r"
dnl add Fujitsu MPI compilers
CANDIDATE_MPICC+=" mpifccpx"
CANDIDATE_MPICXX+=" mpiFCCpx"
CANDIDATE_MPIF77+=" mpifrtpx"
CANDIDATE_MPIF90+=" mpifrtpx"
dnl add Cray MPI compiler wrappers
CANDIDATE_MPICC+=" cc"
CANDIDATE_MPICXX+=" CC"
CANDIDATE_MPIF77+=" ftn"
CANDIDATE_MPIF90+=" ftn"
dnl add Intel MPI compiler wrappers
CANDIDATE_MPICC+=" mpiicc icc"
CANDIDATE_MPICXX+=" mpiicpc mpiicxx mpiic++ mpiiCC icpc"
CANDIDATE_MPIF77+=" mpiifort mpiifc mpiif77 ifort"
CANDIDATE_MPIF90+=" mpiifort mpiifc mpiif95 mpiif90 ifort"
dnl add PGI MPI compiler wrappers
CANDIDATE_MPICC+=" mpipgcc mppgcc"
CANDIDATE_MPICXX+=" mpipgCC mppgCC"
CANDIDATE_MPIF77+=" mpipgf77 mppgf77"
CANDIDATE_MPIF90+=" mpipgf90 mpipgf95 mppgf90 mppgf95 "
dnl find the full path of MPICC from CANDIDATE_MPICC and MPI_INSTALL
if test "x${ac_user_MPICC}" = x ; then
dnl if MPICC or CC has not been set by users, then search from
dnl CANDIDATE_MPICC, and find the full path of MPICC
UD_MPI_PATH_PROGS([MPICC], [$CANDIDATE_MPICC])
else
dnl check whether user specified MPICC is valid
UD_MPI_PATH_PROG([MPICC], [$ac_user_MPICC])
fi
if test "x${MPICC}" = x ; then
if test "x$ac_user_MPICC" = x ; then
ERR_MSG="No MPI C compiler can be found"
else
ERR_MSG="Specified MPI C compiler \"$ac_user_MPICC\" cannot be found"
fi
if test "x$MPI_INSTALL" != x ; then
ERR_MSG+=" under $MPI_INSTALL"
fi
AC_MSG_ERROR([
-----------------------------------------------------------------------
$ERR_MSG
Parallel netCDF requires a working MPI C compiler. Please specify the
location of an MPI C compiler, either in the MPICC environment variable
or through --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
fi
UD_MSG_DEBUG([MPICC=$MPICC])
dnl Now MPICC is configured, do some basic compiler tests
CC=${MPICC}
AC_PROG_CC
dnl AM_PROG_CC_C_O
dnl this call needs at least autoconf version 2.60
dnl AC_USE_SYSTEM_EXTENSIONS
dnl enable large file support
AC_SYS_LARGEFILE
dnl UD_PROG_CC_MAKEDEPEND
dnl AC_HEADER_STDC
dnl AC_CHECK_HEADERS([malloc.h])
dnl check if MPICC works for basic MPI call: MPI_Comm_rank()
AC_CHECK_FUNC([MPI_Comm_rank], [],
dnl maybe -lmpi is needed at link stage
[AC_SEARCH_LIBS([MPI_Comm_rank], [mpi mpich], [],
[AC_MSG_ERROR([
-----------------------------------------------------------------------
Invalid MPI compiler specified or detected: "${MPICC}"
A working MPI C compiler is required. Please specify the location
of one either in the MPICC environment variable or through
--with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
])])
AC_CHECK_FUNC([MPI_File_open], [],
dnl maybe -lmpio is needed at link stage
[AC_SEARCH_LIBS([MPI_File_open], [mpio], [],
[AC_MSG_ERROR([
-----------------------------------------------------------------------
The underneath MPI implementation does not support MPI-IO.
PnetCDF requires MPI-IO support to work properly. Abort.
-----------------------------------------------------------------------])
])])
dnl compute canonical system types
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl libtool v2.4.6 was released in 2015-02-15
dnl Travis CI only has v2.4.2
LT_PREREQ([2.4.2])
dnl LT_INIT([dlopen disable-shared])
dnl LT_INIT([dlopen])
LT_INIT([disable-shared])
dnl check MPI C++ compiler
AC_ARG_ENABLE(cxx,
[AS_HELP_STRING([--disable-cxx],
[Turn off support for the C++ interface,
if you only need the C interface. @<:@default: enabled@:>@])],
[enable_cxx=${enableval}], [enable_cxx=auto]
)
UD_MSG_DEBUG(enable_cxx=$enable_cxx)
dnl If MPICXX or CXX has not been set by users, then
dnl search from CANDIDATE_MPICXX and find the full path of MPICXX
if test "x${enable_cxx}" != xno ; then
if test "x${ac_user_MPICXX}" = x ; then
dnl if MPICXX or CXX has not been set by users, then search from
dnl CANDIDATE_MPICXX, and find the full path of MPICXX
UD_MPI_PATH_PROGS([MPICXX], [$CANDIDATE_MPICXX])
else
dnl check whether user specified MPICXX is valid
UD_MPI_PATH_PROG([MPICXX], [$ac_user_MPICXX])
fi
UD_MSG_DEBUG([MPICXX=$MPICXX])
if test "x${MPICXX}" = x ; then
if test "x$ac_user_MPICXX" = x ; then
ERR_MSG="No MPI C++ compiler can be found"
else
ERR_MSG="Specified MPI C++ compiler \"$ac_user_MPICXX\" cannot be found"
fi
if test "x$MPI_INSTALL" != x ; then
ERR_MSG+=" under $MPI_INSTALL"
fi
if test "x${enable_cxx}" = xyes ; then
dnl --enable-cxx is explicitly set at command line
AC_MSG_ERROR([
-----------------------------------------------------------------------
$ERR_MSG.
Please specify the location of the MPI C++ compiler, either in the
MPICXX environment variable or the --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
else
dnl enable_cxx is auto, i.e. --enable-cxx is not set at command line
AC_MSG_WARN([
-----------------------------------------------------------------------
$ERR_MSG.
Thus the C++ feature is disabled.
The location of the MPI C++ compiler can be specified either in the
MPICXX environment variable or through the --with-mpi configure flag.
-----------------------------------------------------------------------])
fi
fi
fi
if test "x${enable_cxx}" = xno -o "x${MPICXX}" = x ; then
dnl when cxx is explicitly disabled or no MPICXX can be found
has_mpicxx=no
else
has_mpicxx=yes
CXX=${MPICXX}
fi
dnl Must invoke AC_PROG_CXX here, because AC_PROG_CXX cannot be called
dnl conditionally in Automake, otherwise got "error: conditional
dnl "am__fastdepCXX" was never defined." So, if has_mpicxx is no, then
dnl AC_PROG_CXX will search for g++. However, g++ will not be used at all.
AC_PROG_CXX
dnl autoconf 2.59 has not yet implemented AC_PROG_CXX_C_O
dnl AC_PROG_CXX_C_O
if test "x${has_mpicxx}" = xyes ; then
dnl test if MPICXX can compile an MPI-IO program
AC_LANG_PUSH(C++)
AC_CHECK_FUNC([MPI_File_close], [],
dnl maybe -lmpi++ is needed at link stage
[AC_SEARCH_LIBS([MPI_File_close], [mpi++ mpichcxx mpi_cxx], [],
[has_mpicxx=no])])
AC_LANG_POP(C++)
if test "x$has_mpicxx" = xno ; then
if test "x${enable_cxx}" = xyes ; then
AC_MSG_ERROR([
-----------------------------------------------------------------------
Explicitly requesting C++ feature, but "${MPICXX}"
is not a working MPI C++ compiler. Abort.
-----------------------------------------------------------------------])
else dnl in case enable_cxx is auto
AC_MSG_WARN([
-----------------------------------------------------------------------
"${MPICXX}" is not a working MPI C++ compiler.
Thus, the C++ feature is disabled.
-----------------------------------------------------------------------])
fi
else
UD_CHECK_MPI_CPP_SEEK_SET
UD_MSG_DEBUG(ac_cv_CHECK_MPI_CPP_SEEK_SET=$ac_cv_CHECK_MPI_CPP_SEEK_SET)
dnl When using older version Intel compilers 4.x, SEEK_SET will be
dnl reported as redefined. We need to add the following C++ preprocessor
dnl flags. See doc/README.INTEL
if test "x${ac_cv_CHECK_MPI_CPP_SEEK_SET}" = xyes ; then
SEEK_SET_REDEFINED=yes
fi
fi
fi
AC_SUBST(has_mpicxx)dnl for src/utils/pnetcdf-config.in
UD_MSG_DEBUG(has_mpicxx=$has_mpicxx)
AM_CONDITIONAL(HAS_MPICXX, [test x$has_mpicxx = xyes])
AM_CONDITIONAL(SEEK_SET_REDEFINED, [test x$ac_cv_CHECK_MPI_CPP_SEEK_SET = xyes])
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
dnl Note this must be done after the type of C compiler is determined
AC_ARG_ENABLE(strict,
[AS_HELP_STRING([--enable-strict],
[Turn on strict debugging with gcc. @<:@default: disabled@:>@])],
[enable_strict=${enableval}], [enable_strict=no]
)
if test "x${enable_strict}" = xyes; then
if test "x${GCC}" = xyes; then
CFLAGS+=" -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast"
else
AC_MSG_WARN([--enable-strict is for GNU compiler only])
enable_strict=no
fi
fi
AC_ARG_ENABLE(fortran,
[AS_HELP_STRING([--disable-fortran],
[Turn off support for the Fortran interface,
if you only need the C interface. @<:@default: enabled@:>@])],
[enable_fortran=${enableval}], [enable_fortran=auto]
)
if test "x${enable_fortran}" = xno ; then
has_fortran=no
else
has_fortran=yes
if test "x${ac_user_MPIF77}" = x ; then
dnl if MPIF77 or F77 has not been set by users, then search from
dnl CANDIDATE_MPIF77, and find the full path of MPIF77
UD_MPI_PATH_PROGS([MPIF77], [$CANDIDATE_MPIF77])
else
dnl check whether user specified MPIF77 is valid
UD_MPI_PATH_PROG([MPIF77], [$ac_user_MPIF77])
fi
if test "x${MPIF77}" = x ; then
has_fortran=no
if test "x$ac_user_MPIF77" = x ; then
ERR_MSG="No MPI Fortran 77 compiler can be found"
else
ERR_MSG="Specified MPI Fortran 77 compiler \"$ac_user_MPIF77\" cannot be found"
fi
if test "x$MPI_INSTALL" != x ; then
ERR_MSG+=" under $MPI_INSTALL"
fi
if test "x${enable_fortran}" = xyes ; then
dnl --enable-fortran is explicitly set at command line
AC_MSG_ERROR([
-----------------------------------------------------------------------
$ERR_MSG.
Please specify the location of the MPI Fortran 77 compiler, either in the
MPIF77 environment variable or the --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
else
dnl enable_fortran is auto, i.e. --enable-fortran is not set at command line
AC_MSG_WARN([
-----------------------------------------------------------------------
$ERR_MSG.
Thus, the Fortran feature is disabled.
The location of the MPI Fortran 77 compiler can be specified either in the
MPIF77 environment variable or through the --with-mpi configure flag.
-----------------------------------------------------------------------])
fi
fi
fi
if test "x${has_fortran}" = xyes ; then
if test "x${ac_user_MPIF90}" = x ; then
dnl if MPIF90 or F90 has not been set by users, then search from
dnl CANDIDATE_MPIF90, and find the full path of MPIF90
UD_MPI_PATH_PROGS([MPIF90], [$CANDIDATE_MPIF90])
else
dnl check whether user specified MPIF90 is valid
UD_MPI_PATH_PROG([MPIF90], [$ac_user_MPIF90])
fi
if test "x${MPIF90}" = x ; then
has_fortran=no
if test "x$ac_user_MPIF90" = x ; then
ERR_MSG="No MPI Fortran 90 compiler can be found"
else
ERR_MSG="Specified MPI Fortran 90 compiler \"$ac_user_MPIF90\" cannot be found"
fi
if test "x$MPI_INSTALL" != x ; then
ERR_MSG+=" under $MPI_INSTALL"
fi
if test "x${enable_fortran}" = xyes ; then
dnl --enable-fortran is explicitly set at command line
AC_MSG_ERROR([
-----------------------------------------------------------------------
$ERR_MSG.
Please specify the location of the MPI Fortran 90 compiler, either in the
MPIF90 environment variable or the --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
else
dnl enable_fortran is auto, i.e. --enable-fortran is not set at command line
AC_MSG_WARN([
-----------------------------------------------------------------------
$ERR_MSG.
Thus, the Fortran feature is disabled.
The location of the MPI Fortran 90 compiler can be specified either in the
MPIF90 environment variable or through the --with-mpi configure flag.
-----------------------------------------------------------------------])
fi
fi
fi
UD_MSG_DEBUG(has_fortran=${has_fortran})
UD_MSG_DEBUG([MPIF77=$MPIF77])
UD_MSG_DEBUG([MPIF90=$MPIF90])
if test "x${has_fortran}" = xyes ; then
dnl Check if MPIF77 is a valid MPI compiler
F77=${MPIF77}
AC_PROG_F77
dnl FFLAGS is set in AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
AC_MSG_CHECKING([if $MPIF77 is a valid MPI compiler])
AC_LANG_PUSH([Fortran 77])
dnl check if can use mpif.h
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
include "mpif.h"
integer err, rank
call MPI_Comm_rank(MPI_COMM_WORLD, rank, err)]])],
[valid_mpif77=yes],[valid_mpif77=no])
AC_LANG_POP([Fortran 77])
AC_MSG_RESULT($valid_mpif77)
if test "x${valid_mpif77}" = xno ; then
has_fortran=no
if test "x${enable_fortran}" = xyes ; then
AC_MSG_ERROR([
-----------------------------------------------------------------------
Invalid MPI Fortran 77 compiler: "${MPIF77}"
A working MPI Fortran 77 compiler is required. Please specify the
location of a valid MPI Fortran 77 compiler, either in the MPIF77
environment variable or through --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
else
AC_MSG_WARN([
-----------------------------------------------------------------------
"${MPIF77}" is not a working MPI Fortran 77 compiler.
Thus, the Fortran feature is disabled.
-----------------------------------------------------------------------])
fi
fi
fi
mpi_mod=no
if test "x${has_fortran}" = xyes ; then
dnl Check if MPIF90 is a valid MPI compiler
FC=${MPIF90}
AC_PROG_FC
dnl FCFLAGS is set in AC_PROG_FC
dnl FCLIBS_save="$FCLIBS"
dnl FCLIBS=""
AC_FC_LIBRARY_LDFLAGS
dnl UD_MSG_DEBUG([before FCLIBS=$FCLIBS])
dnl The autoconf macro for finding FCLIBS sometimes makes mistakes
dnl (particularly with the Fujitsu frt compiler). This next step
dnl first sees if the FCLIBS is valid with the Fortran compiler
dnl This also happens to Solaris Studio Fortran compilers
dnl AC_PROG_FC_FCLIBS_VALID
dnl Now see if FCLIBS works with the C compiler (remove invalid ones)
dnl PAC_PROG_FC_CHECK_FCLIBS
dnl replace FLIBS and F90LIBS with FCLIBS
dnl UD_MSG_DEBUG([after FCLIBS=$FCLIBS])
dnl FLIBS="$FCLIBS"
dnl F90LIBS="$FCLIBS"
AC_MSG_CHECKING([if mpi.mod is available])
AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ use mpi]])],
[mpi_mod=yes], [mpi_mod=no]
)
AC_MSG_RESULT($mpi_mod)
AC_MSG_CHECKING([if $MPIF90 is a valid MPI compiler])
if test "x${mpi_mod}" = xyes ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
use mpi
integer err, rank
call MPI_Comm_rank(MPI_COMM_WORLD, rank, err)]])],
[valid_mpif90=yes],[valid_mpif90=no]
)
else
dnl mpi.mod is not available, check if can use mpif.h
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
include "mpif.h"
integer err, rank
call MPI_Comm_rank(MPI_COMM_WORLD, rank, err)]])],
[valid_mpif90=yes],[valid_mpif90=no]
)
fi
AC_LANG_POP([Fortran])
AC_MSG_RESULT($valid_mpif90)
if test "x${valid_mpif90}" = xno ; then
has_fortran=no
if test "x${enable_fortran}" = xyes ; then
AC_MSG_ERROR([
-----------------------------------------------------------------------
Invalid MPI Fortran 90 compiler: "${MPIF90}"
A working MPI Fortran 90 compiler is required. Please specify the
location of a valid MPI Fortran 90 compiler, either in the MPIF90
environment variable or through --with-mpi configure flag. Abort.
-----------------------------------------------------------------------])
fi
AC_MSG_WARN([
-----------------------------------------------------------------------
"${MPIF90}" is not a working MPI Fortran 90 compiler.
Thus, the Fortran feature is disabled.
-----------------------------------------------------------------------])
else
if test "x${mpi_mod}" = xyes ; then
USE_MPIF_HEADER="use mpi, only: MPI_OFFSET_KIND"
else
USE_MPIF_HEADER="include \"mpif.h\""
fi
AC_SUBST(USE_MPIF_HEADER)
fi
fi
AC_SUBST(has_fortran)dnl for src/utils/pnetcdf-config.in
AM_CONDITIONAL(HAS_FORTRAN, [test x$has_fortran = xyes])
AM_CONDITIONAL(HAVE_MPI_MOD, [test x$mpi_mod = xyes])
if test "x${has_fortran}" = xyes ; then
if test "x${enable_strict}" = xyes -a "x${GFC}" = xyes; then
dnl not all Fortran compilers recognize -Wall
FFLAGS+=" -Wall"
FCFLAGS+=" -Wall"
fi
dnl AC_SUBST(FLIBS)
dnl AC_SUBST(FCLIBS)
dnl AC_SUBST(F90LIBS)
dnl AC_SUBST(FLDFLAGS)
dnl AC_SUBST(F90LDFLAGS)
fi
ac_f77_support_freeform=no
if test "x${has_fortran}" = xyes ; then
FC_saved=${FC}
FC=${MPIF77}
dnl customized AC_FC_FREEFORM: to just get ac_cv_fc_freeform without
dnl appending ac_cv_fc_freeform to FCFLAGS
dnl ac_cv_fc_freeform is the flag for enabling Fortran free form
dnl we use this flag only in testing programs
UD_FC_FREEFORM
if test "x${ac_cv_fc_freeform}" != xunknown ; then
ac_f77_support_freeform=yes
FFREEFORMFLAG=${ac_cv_fc_freeform}
fi
UD_MSG_DEBUG([FFREEFORMFLAG=$FFREEFORMFLAG])
AC_SUBST(FFREEFORMFLAG)
FC=${FC_saved}
fi
AM_CONDITIONAL(HAVE_F77_SUPPORT_FREEFORM, [test x$ac_f77_support_freeform = xyes])
if test "x${has_fortran}" = xyes ; then
dnl GNU Fortran compiler automatically invokes preprocessor for files with
dnl extension .F and .F90. To manually invoke the preprocessor on any file,
dnl use compiler flag -cpp. To disable, use -nocpp.
dnl For other compilers, we need to find the compile flags for Fortran
dnl preprocessor.
dnl AC_FC_PP_SRCEXT is first introduced in autoconf 2.69
dnl steal AC_FC_PP_SRCEXT from autoconf 2.69 to make UD_FC_PP_SRCEXT
dnl UD_FC_PP_SRCEXT([F]) dnl sets ac_cv_fc_pp_srcext_F
dnl UD_FC_PP_SRCEXT([F90]) dnl sets ac_cv_fc_pp_srcext_F90
AC_FC_PP_SRCEXT([F]) dnl sets ac_cv_fc_pp_srcext_F
AC_FC_PP_SRCEXT([F90]) dnl sets ac_cv_fc_pp_srcext_F90
dnl compiler command-line define preprocessor flag, result in ${FC_DEFINE}
dnl Not all Fortran compilers use -D
dnl UD_FC_PP_DEFINE
dnl AC_FC_PP_DEFINE is first introduced in autoconf 2.69
AC_FC_PP_DEFINE
dnl check compiler flags for file extensions in .f .F .f90 .F90
AC_FC_SRCEXT([f])
AC_FC_SRCEXT([F])
AC_FC_SRCEXT([f90])
AC_FC_SRCEXT([F90])
dnl customized AC_FC_FIXEDFORM: to just get ac_cv_fc_fixedform without
dnl appending ac_cv_fc_fixedform to FCFLAGS
dnl ac_cv_fc_fixedform flag is for enabling Fortran fixed form.
dnl we use this flag only in testing programs
UD_FC_FIXEDFORM
FFIXEDFORMFLAG=${ac_cv_fc_fixedform}
UD_MSG_DEBUG([FC=$FC FFIXEDFORMFLAG=$FFIXEDFORMFLAG])
AC_SUBST(FFIXEDFORMFLAG)
dnl Checking for Fortran types also determines the Fortran name mangling
dnl and places the value into FCALLSCSUB as the C name corresponding
dnl to the Fortran name SUB
AC_FC_FUNC(sub, [FCALLSCSUB])
dnl determine the correct name mapping
case $FCALLSCSUB in
SUB)
AC_DEFINE(F77_NAME_UPPER,,[Define if Fortran names are uppercase])
;;
sub_)
dnl This is the hard case. gcc uses one _ unless the name includes
dnl an underscore, in which case it gets two trailing underscores.
dnl Use essentially the same configure code that the original configure
dnl used to determine SUB
AC_MSG_CHECKING([for C-equivalent to Fortran routine "SUB_A"])
dnl "
AC_FC_FUNC(sub_a, [FCALLSCSUBA])
AC_MSG_RESULT($FCALLSCSUBA)
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
dnl Some Fortran 77 compilers, such as pgf77, do not allow "_8" modifier,
dnl because _8 modifier is a Fortran 90 feature
dnl UD_CHECK_PGF77
dnl UD_MSG_DEBUG([ac_cv_fc_compiler_pgf77=$ac_cv_fc_compiler_pgf77])
dnl Check if the Fortran compiler is an NAG
UD_CHECK_FC_NAG
if test "x${ac_cv_fc_compiler_nag}" = xyes ; then
dnl Add -mismatch if they are not set by users
if ! echo "${FFLAGS}" | ${EGREP} -q -- "-mismatch" ; then
FFLAGS+=" -mismatch"
fi
if ! echo "${FCFLAGS}" | ${EGREP} -q -- "-mismatch" ; then
FCFLAGS+=" -mismatch"
fi
dnl Add -DNAGFortran
FFLAGS+=" -DNAGFortran"
FCFLAGS+=" -DNAGFortran"
fi
dnl check Fortran parameter modifier for 8-byte integer type
dnl We need this to set the max constants for UINT, INT64, and UINT64
UD_FC_CONSTANT_MODIFIER
UD_MSG_DEBUG([ac_cv_fc_constant_modifier=$ac_cv_fc_constant_modifier])
PNF_INT8_MODIFIER=""
if test "x${ac_cv_fc_constant_modifier}" = xnone ; then
PNF_FILL_UINT=4294967295
PNF_FILL_INT64=-9223372036854775806
PNF_FILL_UINT64=18446744073709551614
PNF_X_UINT_MAX=4294967295
PNF_X_INT8_MIN=-9223372036854775807
PNF_X_INT8_MAX=9223372036854775807
PNF_X_UINT8_MAX=18446744073709551615
else
if test "x${ac_cv_fc_constant_modifier}" = xEightByteInt ; then
PNF_INT8_MODIFIER=" integer, parameter :: EightByteInt = selected_int_kind(18)"
fi
PNF_FILL_UINT=4294967295_${ac_cv_fc_constant_modifier}
PNF_FILL_INT64=-9223372036854775806_${ac_cv_fc_constant_modifier}
PNF_FILL_UINT64=18446744073709551614_${ac_cv_fc_constant_modifier}
PNF_X_UINT_MAX=4294967295_${ac_cv_fc_constant_modifier}
PNF_X_INT8_MIN=-9223372036854775807_${ac_cv_fc_constant_modifier}
PNF_X_INT8_MAX=9223372036854775807_${ac_cv_fc_constant_modifier}
PNF_X_UINT8_MAX=18446744073709551615_${ac_cv_fc_constant_modifier}
fi
AC_SUBST(PNF_INT8_MODIFIER)
AC_SUBST(PNF_FILL_UINT)
AC_SUBST(PNF_FILL_INT64)
AC_SUBST(PNF_FILL_UINT64)
AC_SUBST(PNF_X_UINT_MAX)
AC_SUBST(PNF_X_INT8_MIN)
AC_SUBST(PNF_X_INT8_MAX)
AC_SUBST(PNF_X_UINT8_MAX)
fi
ac_cv_prog_f90_uppercase_mod=no
if test "x${has_fortran}" = xyes ; then
dnl
dnl Check Fortran module file extension
dnl
dnl UD_FC_MODULE_EXTENSION
AC_FC_MODULE_EXTENSION
dnl UD_FC_MODULE_EXTENSION defines FC_MODEXT
if test "x${FC_MODEXT}" = x ; then
AC_MSG_ERROR([cannot determine Fortran module file extension!])
fi
UD_MSG_DEBUG([FC_MODEXT=$FC_MODEXT])
dnl AC_FC_MODULE_FLAG was first introduced in autoconf 2.69
dnl AC_FC_MODULE_FLAG/UD_FC_MODULE_FLAG defines FC_MODINC
dnl However, AC_FC_MODULE_FLAG has a bug that mistakenly sets FC_MODINC to
dnl -M when Fujitsu frtpx is used. UD_FC_MODULE_FLAG fixes this problem.
UD_FC_MODULE_FLAG
UD_MSG_DEBUG([FC_MODINC=$FC_MODINC])
dnl AC_FC_MODULE_OUTPUT_FLAG
dnl UD_FC_MODULE_OUTPUT_FLAG
dnl UD_FC_MODULE_OUTPUT_FLAG defines FC_MODOUT
dnl UD_MSG_DEBUG([FC_MODOUT=$FC_MODOUT])
dnl
dnl Below is to check if a Fortran compiler produces module files with upper
dnl case file name, e.g. PNETCDF.mod. However, this does not work for Mac
dnl OSX file system which is case insensitive
dnl
UD_PROG_FC_UPPERCASE_MOD
fi
AM_CONDITIONAL(UPPER_CASE_MOD, [test x$ac_cv_prog_f90_uppercase_mod = xyes])
dnl AC_PROG_INSTALL
dnl have_yacc_lex=no
dnl Starting from PnetCDF 1.5.0, yacc and lex is no longer needed
dnl see comments in src/utils/ncmpigen/Makefile.in for build rules for
dnl ncmpigenyy.c and ncmpigentab.c. If rebuild is desired, uncomment
dnl below checking to check availability of yacc/lex/bison
dnl AC_PROG_YACC
dnl dnl if neither bison nor byacc is found, YACC will be set to yacc
dnl have_yacc_lex=yes
dnl if test "x$YACC" = xyacc; then
dnl AC_CHECK_PROGS(YACC_PATH, yacc)
dnl if test "x$YACC_PATH" = x; then
dnl dnl cannot find bison or yacc required to build ncmpigentab.c
dnl have_yacc_lex=no
dnl fi
dnl fi
dnl
dnl AC_PROG_LEX
dnl if (test "x$LEX" != xflex) && (test "x$LEX" != xlex) ; then
dnl dnl cannot find flex or lex required to build ncmpigenyy.c
dnl have_yacc_lex=no
dnl fi
dnl AM_CONDITIONAL(HAVE_YACC_LEX, [test x$have_yacc_lex = xyes])
dnl AC_PROG_AWK
dnl AC_PROG_LN_S
dnl AC_PROG_MAKE_SET
dnl AC_SUBST(SET_MAKE)
AC_PROG_EGREP
dnl AC_PROG_SED and AC_PROG_GREP are only available on autoconf 2.60 and later
AC_PROG_SED
dnl check sed command option -i and set SED_I
UD_PROG_SED_I
AC_PROG_GREP
dnl YACC and LEX are required to build PnetCDF utility tool ncmpigen
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
dnl Below checks commands yacc and lex availability under PATH. However, this
dnl checking is redundant, as AC_PROG_* did that already
dnl YACC_CMD="${YACC% *}"
dnl AC_CHECK_PROG([yacc_cmd], [${YACC_CMD}], [yes], [no])
dnl AC_CHECK_PROG([lex_cmd], [${LEX}], [yes], [no])
dnl if test "x${yacc_cmd}" = no ; then
dnl AC_MSG_ERROR([could not find bison/yacc required by PnetCDF])
dnl fi
dnl if test "x${lex_cmd}" = no ; then
dnl AC_MSG_ERROR([could not find flex/lex required by PnetCDF])
dnl fi
UD_PROG_M4
M4FLAGS+=" -DPNETCDF"
M4FFLAGS+=" -DPNETCDF"
dnl AM_PROG_AR is first recognized/traced in autoconf 2.68
dnl Use it only if we want support for unusual archivers such as Microsoft
dnl lib.
dnl AM_PROG_AR
dnl UD_PROG_AR()
dnl UD_PROG_NM()
dnl We could use the PAC check for ranlib (it also makes sure that ranlib
dnl works, which is not always true, particularly when GNU tools are
dnl installed on a system that does not have (or need) ranlib
dnl libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
dnl AC_PROG_RANLIB
dnl Check for <stdbool.h> that conforms to C99 requirements
dnl this is also for using bool type in utf8proc.h/utf8proc.c to support
dnl special characters in CDF-2 and CDF-5
AC_HEADER_STDBOOL
dnl AC_C_CONST
AC_C_INLINE
dnl we do not use struct stat yet
dnl AC_CHECK_MEMBERS([struct stat.st_blksize])
UD_CHECK_IEEE
dnl cross compile fails with undefined reference to rpl_realloc and rpl_malloc
dnl AC_FUNC_MALLOC
dnl AC_FUNC_REALLOC
dnl below checks availability of a bunch C functions, but we have not yet
dnl implemented alternative calls
dnl AC_FUNC_ERROR_AT_LINE
dnl AC_FUNC_MEMCMP
dnl AC_FUNC_STRTOD
dnl AC_FUNC_VPRINTF
dnl AC_CHECK_FUNCS([memset setlocale sqrt strchr strrchr strtol])
dnl AC_CHECK_LIB([m], [tanh])
dnl UD_CHECK_LIB_MATH
AC_CHECK_FUNCS([strerror access unlink])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[Enable PnetCDF internal debug mode. This also enables safe mode.
@<:@default: disabled@:>@])],
[debug=${enableval}], [debug=no]
)
dnl malloc memory allocation tracing relies on tdelete and tsearch
AC_CHECK_HEADERS([search.h])
AC_CHECK_FUNCS([tsearch tdelete])
PNETCDF_DEBUG=0
if test "x${debug}" = xyes; then
dnl check required functions for enabling malloc tracing
if test "x${ac_cv_func_tsearch}" = xyes -a "x${ac_cv_func_tdelete}" = xyes ; then
AC_DEFINE(PNC_MALLOC_TRACE)
fi
PNETCDF_DEBUG=1
fi
AC_SUBST(PNETCDF_DEBUG)
AM_CONDITIONAL(PNETCDF_DEBUG, [test x"$PNETCDF_DEBUG" = x1])
dnl check the size of MPI_Offset. PnetCDF requires it be 8 bytes.
AC_CHECK_TYPE([MPI_Offset], [], [], [#include <mpi.h>])
if test "x${ac_cv_type_MPI_Offset}" = xyes; then
AC_CHECK_SIZEOF([MPI_Offset], [], [#include <mpi.h>])
else
AC_MSG_ERROR([Unable to find type MPI_Offset in mpi.h])
fi
if test "$ac_cv_sizeof_MPI_Offset" -lt "8"; then
AC_MSG_ERROR([
-----------------------------------------------------------------------
Building of Parallel NetCDF cannot continue due to the size of
MPI_Offset being less than 8 bytes. Please use an MPI library that
supports large files. Abort.
-----------------------------------------------------------------------])
fi
AC_CHECK_SIZEOF([MPI_Aint], [], [#include <mpi.h>])
AM_CONDITIONAL(SIZEOF_MPI_AINT_IS_4, [test x$ac_cv_sizeof_MPI_Aint = x4])
dnl the nonblocking routines build up lists of requests with MPI_Type_struct.
dnl If MPI_Offset not the same size as MPI_Aint, the arrays passed around will
dnl get mangled.
if test "$ac_cv_sizeof_MPI_Offset" -ne "$ac_cv_sizeof_MPI_Aint"; then
AC_MSG_WARN([
-----------------------------------------------------------------------
MPI_Offset and MPI_Aint are detected of different sizes.
The request aggregation feature implemented in non-blocking APIs is
thus disabled.
-----------------------------------------------------------------------])
enable_aggregation=no
else
AC_DEFINE(ENABLE_REQ_AGGREGATION,,[Define if able to support request aggregation in nonblocking routines])
enable_aggregation=yes
fi
dnl check availability of MPI_Count, which is added in MPI 3.0 standard.