forked from LLNL/SAMRAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
1794 lines (1574 loc) · 47 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
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 File: $HeadURL$
dnl Package: SAMRAI build system
dnl Copyright: (c) 1997-2018 Lawrence Livermore National Security, LLC
dnl Revision: $LastChangedRevision$
dnl Description: autoconfig configuration file
dnl
AC_INIT(COPYRIGHT)
AC_CONFIG_HEADER(include/SAMRAI/SAMRAI_config.h:config/SAMRAI_config.h.in)
dnl
dnl Autoheader stuff
AH_TOP([
#ifndef INCLUDED_SAMRAI_CONFIG_H
#define INCLUDED_SAMRAI_CONFIG_H
#define SAMRAI_VERSION_MAJOR 3
#define SAMRAI_VERSION_MINOR 12
#define SAMRAI_VERSION_PATCHLEVEL 0
])
AH_BOTTOM([
namespace SAMRAI {
static const unsigned short MAX_DIM_VAL = SAMRAI_MAXIMUM_DIMENSION;
}
/*
* Prevent inclusion of mpi C++ bindings in mpi.h includes.
* This is done in here rather than SAMRAI_MPI.h since other
* files include MPI.h, such as PETSc and hypre.
*/
#ifndef MPI_NO_CPPBIND
#define MPI_NO_CPPBIND
#endif
#ifndef MPICH_SKIP_MPICXX
#define MPICH_SKIP_MPICXX
#endif
#ifndef OMPI_SKIP_MPICXX
#define OMPI_SKIP_MPICXX
#endif
/********************************************************************/
/********************* Hardwired defines ****************************/
/********************************************************************/
/*
* Some compilers require cmath to be included before the regular
* C math.h and stdlib.h headers are brought in, otherwise
* the compiler will get conflicting definitions for the functions.
*/
#if defined(__xlC__)
#define REQUIRES_CMATH 1
#endif
#define STL_SSTREAM_HEADER_FILE <sstream>
#define LACKS_STRSTREAM
/*
* A few things for the MSVC++ version.
*/
#ifdef _MSC_VER
/*
* Move this bad stuff to the utility class, not POSIX
*/
#define drand48() ((double)rand()/(double)RAND_MAX)
/*
* This is not correct, the range is wrong, need to find
* a better solution
*/
#define mrand48() (rand())
/*
* Some IEEE stuff is not under the normal names.
*
*/
#define isnan _isnan
#endif
#endif
])
CASC_AC_LOG_VAR(CONFIG_SHELL)
AC_CONFIG_AUX_DIR(config)
# Get system type.
AC_CANONICAL_SYSTEM
CASC_AC_LOG_VAR(target_cpu target_vendor target_os)
dnl SAMRAI has some code specific for the Solaris operating system.
dnl (This is independent of what compiler is being used).
case "$host_os" in
solaris*)
AC_DEFINE(HOST_OS_IS_SOLARIS,1,Define if the host system is Solaris)
esac
dnl
dnl Define the macros that will set up optional packages and features.
dnl These macros will define shell variables that will be queried later
dnl in the installation script.
dnl
AC_ARG_ENABLE([vpath],
[AS_HELP_STRING([--enable-vpath],
[assume a working VPATH in make (default except on IRIX64)])]
)
AC_ARG_ENABLE([noxargs],
[AS_HELP_STRING([--enable-noxargs],
[don't use xargs in build])]
)
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared],
[build shared libraries (default is disabled)])]
)
AC_ARG_ENABLE([xdr],
[AS_HELP_STRING([--enable-xdr],
[build with XDR libraries (default is disabled)])],
,
[enable_xdr="no"]
)
AC_ARG_ENABLE([developer_makefile],
[AS_HELP_STRING([--enable-developer-makefile],
[include extra targets in makefiles])],
,
[enable_developer_makefile="no"]
)
AC_ARG_ENABLE([check_assertions],
[AS_HELP_STRING([--enable-check-assertions],
[build with assertion checking on (default is disabled; is enabled for when debugging is enabled)])],
[user_specified_check_assertions="yes"],
[enable_check_assertions="no"]
)
AC_ARG_ENABLE([check_developer_assertions],
[AS_HELP_STRING([--enable-check-developer-assertions],
[build with internal SAMRAI developer assertion checking on (default is disabled)])],
[user_specified_check_developer_assertions="yes"],
)
AC_ARG_ENABLE([check_dim_assertions],
[AS_HELP_STRING([--enable-check-dim-assertions],
[build with dimension assertion checking on (default is disabled; is enabled when debugging is enabled)])],
[user_specified_check_dim_assertions="yes"],
)
AC_ARG_ENABLE([bgl],
[AS_HELP_STRING([--enable-bgl],
[Identify this platform as one of the bgl family (default is disable)])],
[enable_bgl=$enableval],
[enable_bgl=no]
)
AC_ARG_ENABLE([threading],
[AS_HELP_STRING([--enable-threading],
[build with threading on (default is disabled)])],
,
[enable_threading="no"]
)
AC_ARG_WITH([CC],
[AS_HELP_STRING([--with-CC=ARG],[manually set C compiler to ARG])]
)
AC_ARG_WITH([CXX],
[AS_HELP_STRING([--with-CXX=ARG],[manually set C++ compiler to ARG])]
)
AC_ARG_WITH([F77],
[AS_HELP_STRING([--with-F77=ARG],[manually set F77 to ARG])]
)
AC_ARG_WITH([M4],
[AS_HELP_STRING([--with-M4=ARG],[manually set M4 to ARG])]
)
AC_ARG_WITH([AR],
[AS_HELP_STRING([--with-AR=ARG],[manually set AR to ARG])]
)
AC_ARG_WITH([vampir],
[AS_HELP_STRING([--with-vampir[=dir]],
[compile with VAMPIR performance tracing])]
)
AC_ARG_WITH([tau],
[AS_HELP_STRING([--with-tau[=dir]],[compile with TAU performance tracing])]
)
AC_ARG_ENABLE([deprecated],
[AS_HELP_STRING([--enable-deprecated],
[build with deprecated features (default is enabled)])],
,
[enable_deprecated="yes"]
)
AC_ARG_WITH([maxdim],
[AS_HELP_STRING([--with-maxdim=ARG],
[manually set the maximum allowed dimension (default is 3)])],
,
[with_maxdim=3]
)
dnl
dnl Set the maximum dimension for this complitation
dnl
[validint()
{
# validate first field. Optionally test against min value $2 and/or
# max value $3: if you'd rather skip these tests, send "" as values.
# returns 1 for error, 0 for success.
number="$1"; min="$2"; max="$3"
if [ -z $number ] ; then
return 1
fi
if [ "${number%${number#?}}" = "-" ] ; then # first char '-' ?
testvalue="${number#?}" # all but first character
else
testvalue="$number"
fi
nodigits="$(echo $testvalue | sed 's/[[:digit:]]//g')"
if [ ! -z $nodigits ] ; then
return 1
fi
if [ ! -z $min ] ; then
if [ "$number" -lt "$min" ] ; then
return 1
fi
fi
if [ ! -z $max ] ; then
if [ "$number" -gt "$max" ] ; then
return 1
fi
fi
return 0
}]
if validint "$with_maxdim" "1" ""; then
AC_DEFINE_UNQUOTED([SAMRAI_MAXIMUM_DIMENSION],
[$with_maxdim],
[Maximum dimension allowed])
else
AC_MSG_ERROR([dimension must be an integer greater than 0, not \"$with_maxdim\"])
fi
SAMRAI_ALL_LIBRARIES="appu algs solv geom mesh math pdat xfer hier tbox"
AC_ARG_WITH([libraries],
[AS_HELP_STRING([--with-libraries=List of libraries],
[Specify explicit list of SAMRAI libraries to build. Default is to compile all libraries.
This is for advanced users only. Available libraries are : appu algs solv geom mesh math pdat xfer hier tbox])],
,with_libraries='all')
if test "$with_libraries" = all; then
SAMRAI_LIBRARIES="$SAMRAI_ALL_LIBRARIES"
else
for j in $with_libraries
do
invalid_library=1
for i in $SAMRAI_ALL_LIBRARIES
do
if test "$i" = "$j"
then
invalid_library=0
break
fi
done
if test $invalid_library -eq 1
then
AC_MSG_ERROR([Invalid SAMRAI library specified : $j])
fi
done
SAMRAI_LIBRARIES=""
for i in $SAMRAI_ALL_LIBRARIES
do
for j in $with_libraries
do
if test "$i" = "$j"
then
SAMRAI_LIBRARIES="$SAMRAI_LIBRARIES $i"
break
fi
done
done
fi
AC_SUBST(SAMRAI_LIBRARIES)
dnl
dnl Since we removed the all-CAPS options and replaced them with
dnl lowercase options, some people still use the all-CAPS options
dnl and get confused with the results (despite our best efforts to
dnl document this change). We now abort the configuration to save
dnl these poor souls from themselves.
dnl
AC_ARG_WITH(MPI,, AC_MSG_ERROR([Obsolete option for MPI used!!
You should use lower-case. Do 'configure --help' for help.]))
AC_ARG_WITH(HDF5,, AC_MSG_ERROR([Obsolete option for HDF5 used!!
You should use lower-case. Do 'configure --help' for help.]))
AC_ARG_WITH(PETSC,, AC_MSG_ERROR([Obsolete option for PETSC used!!
You should use lower-case. Do 'configure --help' for help.]))
dnl
dnl Initialize common macros to empty strings
dnl
C_FLAGS="$CFLAGS"
CXX_FLAGS="$CXXFLAGS"
F77_FLAGS="$FFLAGS"
LD_FLAGS="$LDFLAGS"
CXXLD_FLAGS="$LDFLAGS"
CPP_FLAGS="$CPPFLAGS"
INC_PATH=
LIB_PATH=
LIB_NAME=-lm
dnl LIBS is not used by SAMRAI's configure.in, but it is used by some
dnl of the supporting macros.
LIBS="$LIBS -lm"
LIB_SUFFIX=.a
dnl For debugging configure:
dnl LD_LIBRARY_PATH influences the configuration tests,
dnl so we want to know what it is.
CASC_AC_LOG_VAR(LD_LIBRARY_PATH)
dnl
dnl Guess the machine architecture and set the variable ARCH
dnl
CASC_GUESS_ARCH
CASC_AC_LOG_VAR(ARCH)
dnl
dnl Set up the C++ compiler.
dnl
if test -n "$with_CXX"; then
CXX=$with_CXX
else
case "$host_os" in
linux*) CCC=" g++ ";;
solaris*) CCC=" g++ ";;
osf*) CCC=" g++ ";;
*) CCC=
esac
fi
CASC_AC_LOG_VAR(with_CXX CXX CCC, before running compiler search)
AC_PROG_CXX($CCC)
CASC_AC_LOG_VAR(with_CXX CXX CCC, after running compiler search)
dnl
dnl Set up the C compiler. This macro must come first and be followed
dnl AC_ISC_POSIX before other compiler tests are run. See the autoconfig
dnl manual for details.
dnl
if test -n "$with_CC"; then
CC=$with_CC
else
AC_PROG_CC
fi
AC_ISC_POSIX
dnl
dnl A way to manually add flags to the loader (ld) command.
dnl
AC_ARG_WITH([extra-ld-flags],
[AS_HELP_STRING([--with-extra-ld-flags=STRING],
[Specify additional flags for the loader.])],
,with_extra_ld_flags='no')
case "$with_extra_ld_flags" in
no)
: No op
;;
yes)
: No op
;;
*)
LD_FLAGS="$LD_FLAGS $with_extra_ld_flags"
;;
esac
dnl
dnl A way to manually add flags to the c compiler command.
dnl
AC_ARG_WITH([extra-cc-flags],
[AS_HELP_STRING([--with-extra-cc-flags=STRING],
[Specify additional flags for the c compiler.])],
,with_extra_cc_flags='no')
case "$with_extra_cc_flags" in
no)
: No op
;;
yes)
: No op
;;
*)
C_FLAGS="$C_FLAGS $with_extra_cc_flags"
;;
esac
dnl
dnl A way to manually add flags to the c++ compiler command.
dnl
AC_ARG_WITH([extra-cxx-flags],
[AS_HELP_STRING([--with-extra-cxx-flags=STRING],
[Specify additional flags for the c++ compiler.])],
,with_extra_cxx_flags='no')
case "$with_extra_cxx_flags" in
no)
: No op
;;
yes)
: No op
;;
*)
CXX_FLAGS="$CXX_FLAGS $with_extra_cxx_flags"
;;
esac
dnl
dnl A way to manually add flags to the f77 compiler command.
dnl
AC_ARG_WITH([extra-f77-flags],
[AS_HELP_STRING([--with-extra-f77-flags=STRING],
[Specify additional flags for the f77 compiler.])],
,with_extra_f77_flags='no')
case "$with_extra_f77_flags" in
no)
: No op
;;
yes)
: No op
;;
*)
F77_FLAGS="$F77_FLAGS $with_extra_f77_flags"
;;
esac
dnl
dnl Find ar for archiving
dnl
AC_CHECK_PROGS(AR, $with_AR ar,)
if test -z "$AR"; then
AC_MSG_ERROR([ar archiver not found - specify with --with-AR=ARG])
fi
dnl
dnl Find m4, preferably the GNU version.
dnl
AC_CHECK_PROGS(M4, $with_M4 gm4 m4,)
if test -z "$M4"; then
AC_MSG_ERROR([m4 preprocessor not found - specify with --with-M4=ARG])
fi
dnl
dnl Find install for installing
dnl
AC_PROG_INSTALL
if test -z "$INSTALL"; then
AC_MSG_ERROR([install not found])
fi
dnl
dnl Find mkdir for creating directories
dnl
AC_PROG_MKDIR_P
if test -z "$MKDIR_P"; then
AC_MSG_ERROR([mkdir not found])
fi
dnl
dnl Determine what compilers are being used.
dnl
CASC_INFO_CC_CXX_ID
# Warn user about unsupported compilers:
case $CXX_ID in
gnu|xlc|intel) ;;
*)
AC_MSG_WARN([
You are using a C++ compiler unsupported by SAMRAI
You are on your own!
])
;;
esac
dnl
dnl Check various C++ compiler features.
dnl
CASC_CXX_NAMESPACE
CASC_CXX_TEMPLATE_COMPLEX
CASC_CXX_SSTREAM
CASC_CXX_IOMANIP_LEFT
CASC_CXX_NEW_PLACEMENT_OPERATOR
CASC_CXX_MEMBER_FUNCTION_SPECIALIZATION
CASC_CXX_STATIC_DATA_INSTANTIATION
case $CXX in
*insure*)
;;
*)
CASC_CXX_EXCEPTION_HANDLING
;;
esac
CASC_CXX_STANDARD_STATIC_DATA_SPECIALIZATION
if test "$casc_cv_cxx_have_standard_static_data_specialization" = "no"; then
CASC_CXX_PRAGMA_STATIC_DATA_SPECIALIZATION
fi
CASC_CXX_CMATH
CASC_CXX_ISNAN_TEMPLATE
CASC_CXX_STD_FILL_N_RETURNS_VOID
CASC_CXX_CTIME
AC_CHECK_HEADERS([sys/times.h])
AC_CHECK_HEADERS([unistd.h])
# For insure add -Zsl option for linking
case $CXX in
*insure*)
CXX_FLAGS="$CXX_FLAGS -Zsl"
LIB_NAME="$LIB_NAME -Zsl"
;;
esac
case $CXX_ID in
gnu)
CXX_FLAGS="-Wall -Wextra -Wconversion $CXX_FLAGS"
case $ARCH in
IRIX64)
CXX_FLAGS="-mabi=64 $CXX_FLAGS"
;;
solaris)
;;
CYGWIN)
CXX_FLAGS="$CXX_FLAGS"
;;
esac
;;
sunpro)
CXX_FLAGS="-qrtti=all $CXX_FLAGS"
case $ARCH in
solaris | sun4)
CXX_FLAGS="$CXX_FLAGS"
CXX_FLAGS="+p $CXX_FLAGS"
;;
esac
;;
xlc)
CXX_FLAGS="-qrtti -g $CXX_FLAGS"
;;
intel)
# Ignore some Intel warnings that seem harmless and very hard to get rid of
CXX_FLAGS="$CXX_FLAGS -Wall -w1 -wd981 -wd383 -wd1418 -wd522"
;;
insure)
case $ARCH in
solaris | sun4)
CXX_FLAGS="+p $CXX_FLAGS"
LIB_NAME="$LIB_NAME -Zsl"
;;
esac
;;
*)
;;
esac
dnl
dnl Add necessary compiler flag for threading.
dnl
if test "$enable_threading" = "yes"; then
case $CXX_ID in
gnu)
CXX_FLAGS="$CXX_FLAGS -fopenmp"
;;
xlc)
CXX_FLAGS="$CXX_FLAGS -qsmp=omp"
;;
intel)
CXX_FLAGS="$CXX_FLAGS -openmp"
;;
*)
AC_MSG_WARN([
Use CFLAGS and CXXFLAGS to specify compiler
threading directive for this compiler.
]);
;;
esac
AC_DEFINE(HAVE_OPENMP,1,OPENMP is available)
fi
dnl
dnl Set the compile mode flag for the kind of target to build
dnl
XARGS="xargs -n 150"
SAMRAI_TARGET="standard"
if test "$enable_noxargs" = "yes"; then
SAMRAI_TARGET="noxargs"
fi
if test "$enable_shared" = "yes"; then
SAMRAI_TARGET="shared"
case $ARCH in
Linux | LINUX | linux )
C_FLAGS="-fPIC $C_FLAGS"
CXX_FLAGS="-fPIC $CXX_FLAGS"
F77_FLAGS="-fPIC $F77_FLAGS"
CXXLD_FLAGS="-shared $LD_FLAGS"
LIB_SUFFIX=.so
;;
rs6000)
CXXLD_FLAGS="-G $LD_FLAGS"
LD_FLAGS="$LD_FLAGS -binitfini:poe_remote_main"
LIB_SUFFIX=.so
;;
*)
C_FLAGS="-KPIC $C_FLAGS"
CXX_FLAGS="-KPIC $CXX_FLAGS"
CXXLD_FLAGS="-shared $LD_FLAGS"
LIB_SUFFIX=.so
;;
esac
fi
dnl
dnl Set the flag indicating if extra targets
dnl should be included in the Makefile.
dnl Normally used by developers but not users.
dnl
if test "$enable_developer_makefile" = "no"; then
DEVELOPER_MAKEFILE="no"
else
DEVELOPER_MAKEFILE="yes"
fi
AC_SUBST(DEVELOPER_MAKEFILE)
dnl
dnl Define optimize and debug switches.
dnl By default, set no optimization switches and set -g for debug switches.
dnl
SAMRAI_MISC
SAMRAI_TIMERS
AC_ARG_ENABLE([opt],
[AS_HELP_STRING([--enable-opt=STRING],
[Set compiler optimization switches.])],
[case "$enable_opt" in
no) opt_switches= ;;
yes)
AC_DEFINE([OPT_BUILD],[1],[Optimized build])
case $CXX_ID in
gnu) opt_switches="-O2" ;;
intel) opt_switches="-O3" ;;
sunpro)
case $ARCH in
solaris | sun4) opt_switches="-fast" ;;
*) opt_switches="-O" ;;
esac ;;
xlc) opt_switches="-O3" ;;
*) opt_switches="-O" ;;
esac ;;
*) opt_switches="$enable_opt" ;;
esac],
opt_switches=)
if test -n "$opt_switches" ; then
C_FLAGS="$opt_switches $C_FLAGS"
CXX_FLAGS="$opt_switches $CXX_FLAGS"
F77_FLAGS="$opt_switches $F77_FLAGS"
fi
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug=STRING],[Set compiler debug switches.])],
[case "$enable_debug" in
no) debug_switches= ;;
yes)
case $CXX_ID in
*) debug_switches="-g" ;;
esac ;;
*) debug_switches="$enable_debug" ;;
esac
],
debug_switches=-g)
case "$enable_debug" in
no) ;;
*)
# Enable assertion checking and disable inlining when debugging is enabled if user
# does not override.
if test "$user_specified_check_assertions" != "yes"; then
enable_check_assertions="yes"
fi
if test "$user_specified_check_dim_assertions" != "yes"; then
enable_check_dim_assertions="yes"
fi
AC_DEFINE([DEBUG_INITIALIZE_UNDEFINED],[1],[Initialize new memory to undefined values in debug mode])
esac
dnl
dnl Check if compiling with assertions on
dnl
if test "$enable_check_assertions" = "yes"; then
AC_DEFINE([DEBUG_CHECK_ASSERTIONS],[1],[Enable assertion checking])
fi
dnl
dnl Check if compiling with SAMRAI developer assertions on
dnl
if test "$enable_check_developer_assertions" = "yes"; then
AC_DEFINE([DEBUG_CHECK_DEV_ASSERTIONS],[1],[Enable SAMRAI developer assertion checking])
fi
dnl
dnl Check if compiling with dimension assertions on
dnl
if test "$enable_check_dim_assertions" = "yes"; then
AC_DEFINE([DEBUG_CHECK_DIM_ASSERTIONS],[1],[Enable assertion checking for dimensions])
fi
dnl
dnl Check if compiling on bgl family of machines
dnl
if test "$enable_bgl" = "yes"; then
AC_DEFINE([__BGL_FAMILY__],[1],[Configure for compiling on BGL family of
machines])
fi
if test -n "$debug_switches" ; then
C_FLAGS="$debug_switches $C_FLAGS"
CXX_FLAGS="$debug_switches $CXX_FLAGS"
F77_FLAGS="$debug_switches $F77_FLAGS"
fi
CASC_AC_LOG_VAR(debug_switches opt_switches)
dnl
dnl Set the optional classes to build
dnl
dnl
dnl Set up the Fortran compiler.
dnl
if test -n "$with_F77"; then
F77=$with_F77
else
if test -z "$F77"; then
AC_CHECK_PROGS(F77, f77 g77 xlf f2c)
else
dnl If F77 was specified then see if it is a full path
dnl or just the prog name in users PATH
if test -f $F77; then
F77=$F77
else
AC_CHECK_PROGS(F77, $F77)
fi
fi
fi
test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran found in $PATH])
CASC_AC_LOG_VAR(F77)
if test "$ac_cv_prog_g77" = "yes"; then
F77_FLAGS="-Wall -Wimplicit -Wunused $F77_FLAGS"
else
case $ARCH in
sun4 | solaris)
F77_FLAGS="-u $F77_FLAGS"
;;
rs6000)
F77_FLAGS="-u $F77_FLAGS"
;;
IRIX64)
F77_FLAGS="-64 $F77_FLAGS"
;;
esac
fi
dnl dnl
dnl dnl Set up the Fortran libraries.
dnl dnl
AC_F77_LIBRARY_LDFLAGS
SAMRAI_SPLIT_LIBS_STRING(FLIBS,FLIBS_PATH,FLIBS_NAME)
LIB_NAME="${LIB_NAME} ${FLIBS_NAME}"
LIB_PATH="${LIB_PATH} ${FLIBS_PATH}"
CASC_AC_LOG_VAR([FLIBS FLIBS_PATH FLIBS_NAME], [after using ac_f77_library_ldflags])
dnl
dnl Find the correct way to mangle fortran function names
dnl so they can be called from C. Calling this macro puts
dnl certain #define statements in the config.h file to choose
dnl the correct mangling.
dnl A fortran subroutine named dothis can be called from C using
dnl F77_FUNC(dothis,DOTHIS)
dnl A fortran subroutine named do_this can be called from C using
dnl F77_FUNC_(do_this,DO_THIS)
dnl
AC_F77_WRAPPERS
dnl
dnl When user specifies, override the results from AC_F77_WRAPPERS.
dnl This is a total kludge for fixing a problem on Purple.
dnl It corrects the results of the name mangling test in
dnl AC_F77_WRAPPERS, where the mangling results differs
dnl depending on whether direct compiles or with intervening
dnl library (.a) file. This is a total kludge!!!! but it's
dnl too hard to improve the test or fix the strange behavior.
dnl
AC_MSG_CHECKING(whether to kludge override fortran name mangling results)
AC_ARG_ENABLE([fortran-mangling-override],
[AS_HELP_STRING([--enable-fortran-mangling-override],
[Kludgey FORTRAN name mangling fix. Not for general use.])],
[case "$enable_fortran_mangling_override" in
[yes)]
AC_MSG_RESULT(yes)
sed -e ['s/^\(#define F77_FUNC.\{1,\}\)/\1 ## _/'] confdefs.h > confdefs1.h
mv confdefs1.h confdefs.h
esac],
AC_MSG_RESULT(no))
dnl
dnl Rename the F77_FUNC macros SAMRAI_F77_FUNC to avoid conflicts
dnl with client code using a different version of AC_F77_WRAPPERS.
dnl
sed 's/F77_FUNC/SAMRAI_F77_FUNC/' confdefs.h > confdefs1.h
mv confdefs1.h confdefs.h
dnl
dnl Find the X11 include directory, library directory, and associated
dnl libraries.
dnl
if test "${with_x+set}" = set; then
AC_PATH_XTRA
if test "yes" = "$no_x"; then
AC_MSG_NOTICE([NOTIFICATION: SAMRAI configured without the X11 library])
AC_DEFINE([LACKS_X11],[1],[X11 library is missing])
else
AC_DEFINE([HAVE_X11],[1],[X11 library is present])
if test -n "$x_includes"; then
INC_PATH="-I$x_includes $INC_PATH"
fi
# This is a hack, SAMRAI adds the shared library syntax later
X_LIBS=`echo $X_LIBS | sed 's/-R\//-L\//'`
x11_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
SAMRAI_SPLIT_LIBS_STRING(x11_LIBS,x11_LIB_PATH,x11_LIB_NAME)
LIB_PATH="$x11_LIB_PATH $LIB_PATH"
LIB_NAME="$x11_LIB_NAME $LIB_NAME"
fi
else
AC_MSG_NOTICE([NOTIFICATION: SAMRAI configured without the X11 library])
AC_DEFINE([LACKS_X11],[1],[X11 library is missing])
fi
dnl
dnl If vpath is working then we don't need to include SRCDIR
dnl in the compiler invocation targets. By default, we assume
dnl that vpath works properly (except on IRIX64). If this is
dnl not the case, then the user must specify --disable-vpath
dnl in the configuration.
dnl
case $ARCH in
IRIX64)
if test -z "$enable_vpath"; then
enable_vpath=no
fi
;;
*)
if test -z "$enable_vpath"; then
enable_vpath=yes
fi
;;
esac
if test "$enable_vpath" = "no"; then
SRCDIR_COMPILE_PREFIX="\$(SRCDIR)/"
else
SRCDIR_COMPILE_PREFIX=""
fi
dnl
dnl Valgrind
dnl
CASC_SUPPORT_VALGRIND
AC_SUBST(valgrind_EXE)
dnl
dnl Set DOXYGEN_BIN to the doxygen binary.
dnl
CASC_PATH_PROG(DOXYGEN_BIN,doxygen)
CASC_AC_LOG_VAR(DOXYGEN_BIN)
dnl
dnl Set DOT_PATH to the directory of the dot binary, for use with doxygen.
dnl
AC_ARG_WITH([dot-dir],
[AS_HELP_STRING([--with-dot-dir=DIR],
[Specify bin directory where dot binaries live.])],,
unset with_dot_dir)
if test "${with_dot_dir}" = yes || test ! "${with_dot_dir+set}" = set; then
# Find dot path, and use if found
DOT_PATH=`which dot >& /dev/null`
if test -z "${DOT_PATH}"; then
unset DOT_PATH
HAVE_DOT=NO
else
[DOT_PATH=`echo $DOT_PATH | sed 's!/[^/]\{1,\}$!!']`
HAVE_DOT=YES
fi
elif test "${with_dot_dir}" = no; then
# Disable dot.
unset DOT_PATH
HAVE_DOT=NO
else
# Make sure valid path is specified. Enable dot.
if test ! -d ${with_dot_dir}; then
AC_MSG_WARN([
Invalid path given for dot executable: ${with_dot_dir}.
Path does not exist.
You can expect doxygen documentation generation to not work properly.
]);
fi
DOT_PATH=${with_dot_dir}
HAVE_DOT=YES
fi
CASC_AC_LOG_VAR(with_dot_dir HAVE_DOT DOT_PATH)
AC_SUBST(HAVE_DOT)
AC_SUBST(DOT_PATH)
dnl CASC_PATH_PROG(DOT_BIN,dot)
dnl CASC_AC_LOG_VAR(DOT_BIN)
dnl AC_SUBST(DOT_BIN)
dnl # Doxygen wants to know if we have the dot binary.
dnl HAVE_DOT=NO; test "${DOT_BIN+set}" = set && HAVE_DOT=YES
dnl AC_SUBST(HAVE_DOT)
dnl
dnl Set the directory for doxygen documentation.
dnl
AC_ARG_WITH([dox-output-dir],
[AS_HELP_STRING([--with-dox-output-dir=DIR],
[Specify full where Doxygen documentation is generated. Default is the docs
directory in the compile tree.])])
if test -n "$with_dox_output_dir"; then
if echo "$with_dox_output_dir" | grep -v '^/' ; then
AC_MSG_ERROR(You must give a full path with --with-dox-output-dir=DIR)
fi
dox_output_dir="$with_dox_output_dir"
# Make sure dox_output_dir ends with / so because the doxygen
# configuration files simply append a subdirectory name.
[dox_output_dir="`echo $dox_output_dir | sed 's:\([^/]\)$:\1/:'`"]
fi
AC_SUBST(dox_output_dir)
dnl
dnl Set SAMRAI_PERL to the perl binary for use in doxygen.
dnl
CASC_PATH_PROG(SAMRAI_PERL,perl)
CASC_AC_LOG_VAR(SAMRAI_PERL)
dnl
dnl Whether restrict key word works.
dnl
CASC_AC_LOG(begin stringize)
AC_C_STRINGIZE
CASC_AC_LOG(end stringize)
dnl
dnl Whether restrict key word works.
dnl
CASC_C_RESTRICT
dnl
dnl Look for the iomanip header file name.