-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
1642 lines (1420 loc) · 48 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: configure.in
dnl Package: SAMRAI build system
dnl Copyright: (c) 1997-2008 Lawrence Livermore National Security, LLC
dnl Revision: $LastChangedRevision: 3288 $
dnl Modified: $LastChangedDate: 2009-06-18 14:43:43 -0700 (Thu, 18 Jun 2009) $
dnl Description: autoconfig configuration file
dnl
AC_INIT
AC_CONFIG_SRCDIR([COPYRIGHT])
AC_CONFIG_HEADERS([include/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 2024
#define SAMRAI_VERSION_MINOR 01
#define SAMRAI_VERSION_PATCHLEVEL 24
])
AH_BOTTOM([
/********************************************************************/
/********************* 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
])
BTNG_AC_LOG_VAR(CONFIG_SHELL)
AC_CONFIG_AUX_DIR(config)
# Get system type.
AC_CANONICAL_TARGET
BTNG_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(char,
[ --enable-char build char patch datatypes])
AC_ARG_ENABLE(float,
[ --enable-float build float patch datatypes])
AC_ARG_ENABLE(bool,
[ --enable-bool build boolean patch datatypes])
AC_ARG_ENABLE(dcomplex,
[ --enable-dcomplex build double complex patch datatypes])
AC_ARG_ENABLE(vpath,
[ --enable-vpath assume a working VPATH in make (default except on IRIX64)])
AC_ARG_ENABLE(noxargs,
[ --enable-noxargs don't use xargs in build])
AC_ARG_ENABLE(shared,
[ --enable-shared build shared libraries (default is disabled)])
AC_ARG_ENABLE(xdr,
[ --enable-xdr build with XDR libraries (default is disabled)],
,
enable_xdr="no"
)
AC_ARG_ENABLE(developer_makefile,
[ --enable-developer-makefile include extra targets in makefiles],
,
enable_developer_makefile="no"
)
AC_ARG_WITH(CC,
[ --with-CC=ARG manually set C compiler to ARG])
AC_ARG_WITH(CXX,
[ --with-CXX=ARG manually set C++ compiler to ARG])
AC_ARG_WITH(F77,
[ --with-F77=ARG manually set F77 to ARG])
AC_ARG_WITH(M4,
[ --with-M4=ARG manually set M4 to ARG])
AC_ARG_WITH(AR,
[ --with-AR=ARG manually set AR to ARG])
AC_ARG_WITH(vampir,
[ --with-vampir[=dir] compile with VAMPIR performance tracing])
AC_ARG_WITH(tau,
[ --with-tau[=dir] compile with TAU performance tracing])
AC_ARG_ENABLE(deprecated,
[ --enable-deprecated build with deprecated features (default is enabled)],
,
enable_deprecated="yes"
)
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.
BTNG_AC_LOG_VAR(LD_LIBRARY_PATH)
dnl
dnl Guess the machine architecture and set the variable ARCH
dnl
CASC_GUESS_ARCH
BTNG_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
BTNG_AC_LOG_VAR(with_CXX CXX CCC, before running compiler search)
AC_PROG_CXX($CCC)
BTNG_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_SEARCH_LIBS([strerror],[cposix]) 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_SEARCH_LIBS([strerror],[cposix])
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-m4=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
BTNG_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
# Warn user about unusual compiler paths and LD_LIBRARY_PATH
for i in "$CXX" "$CC" ; do
baseprog=`echo $i | awk '{print $1}'`
prog=`which $baseprog`
if echo "$prog" | grep -v '^/usr/bin/' > /dev/null; then
AC_MSG_NOTICE([NOTIFICATION:
The compiler $i has an unusual path.
This may cause link problems if you don't also have the associated
library path in your LD_LIBRARY_PATH variable. If you don't have
that path in your LD_LIBRARY_PATH, the compiler checks may not run
properly. In that case, you may want to stop this process now, set
your LD_LIBRARY_PATH appropriately and run it.
])
fi
done
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
CASC_CXX_EXCEPTION_HANDLING
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
dnl
dnl Set special C++ compiler flags based on the architecture and the compiler
dnl name. Set special template compilation options. For warnings, set the
dnl maximum warning level that does not generate incorrect warning messages.
dnl
# By default make the object files depend on the template implementation files
# Turn this off for known cases that do not require it.
IMPLICIT_TEMPLATE_INSTANTIATION="no"
AC_ARG_ENABLE(implicit-template-instantiation,
[ --enable-implicit-template-instantiation
Enable implicit template instantiation (disabled by default).
Feature is at users' request. We don't test it.],
IMPLICIT_TEMPLATE_INSTANTIATION="yes"
,
enable_implicit_template_instantiation=no
)
CXX_FLAGS_NO_TEMPLATE_INST=""
if test "${enable_implicit_template_instantiation}" = 'no'; then
case "$CXX_ID" in
gnu)
CXX_FLAGS_NO_TEMPLATE_INST="-fno-implicit-templates"
;;
ibm)
CXX_FLAGS_NO_TEMPLATE_INST="-qnotempinc"
;;
intel)
:
;;
sunpro)
CXX_FLAGS_NO_TEMPLATE_INST="-instances=explicit"
;;
esac
fi
AC_SUBST(CXX_FLAGS_NO_TEMPLATE_INST)
AC_SUBST(IMPLICIT_TEMPLATE_INSTANTIATION)
# For insure add -Zsl option for linking
case $CXX in
*insure*)
LIB_NAME="$LIB_NAME -Zsl"
;;
esac
case $CXX_ID in
gnu)
CXX_FLAGS="-Wall $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=all $CXX_FLAGS"
;;
intel)
# compiler requires template includes
AC_DEFINE(INCLUDE_TEMPLATE_IMPLEMENTATION)
case $ARCH in
LINUX)
CXX_FLAGS="$CXX_FLAGS -Wall -wd981 -wd383 -wd873 -wd1418 -wd279 -wd1682"
;;
esac
;;
insure)
case $ARCH in
solaris | sun4)
CXX_FLAGS="+p $CXX_FLAGS"
LIB_NAME="$LIB_NAME -Zsl"
;;
esac
;;
*)
# By default include the template impls during compile
AC_DEFINE(INCLUDE_TEMPLATE_IMPLEMENTATION)
esac
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"
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 Determine if there should be dependencies between
dnl object files and the template implementation files
dnl (the .C files as well as .h and .I files).
dnl
dnl By default make the object files depend on the template implementation files
dnl Turn this off for known cases that do not require it.
dnl
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="yes"
case $CXX_ID in
gnu)
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="no"
;;
ibm)
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="no"
;;
sunpro)
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="no"
;;
intel)
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="no"
# compiler requires template includes
AC_DEFINE([INCLUDE_TEMPLATE_IMPLEMENTATION],[1],[INCLUDE_TEMPLATE_IMPLEMENTATION])
;;
*)
# By default include the template impls during compile
AC_DEFINE([INCLUDE_TEMPLATE_IMPLEMENTATION],[1],[INCLUDE_TEMPLATE_IMPLEMENTATION])
esac
dnl
dnl If implicit instantiation turned on then the standard requires that
dnl implementation be present when compiling a template.
dnl
if test "${enable_implicit_template_instantiation}" = 'yes'; then
AC_DEFINE([INCLUDE_TEMPLATE_IMPLEMENTATION],[1],[INCLUDE_TEMPLATE_IMPLEMENTATION])
DEPENDS_ON_TEMPLATE_IMPLEMENTATION="yes"
fi
AC_SUBST(DEPENDS_ON_TEMPLATE_IMPLEMENTATION)
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
AC_ARG_ENABLE(opt,
[ --enable-opt=STRING Set compiler optimization switches.],
[case "$enable_opt" in
no) opt_switches= ;;
yes)
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
;;
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,
[ --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
case "$enable_debug" in
no) ;;
*)
AC_DEFINE([DEBUG_NO_INLINE],[1],[Disable inlining for debug mode])
AC_DEFINE([DEBUG_CHECK_ASSERTIONS],[1],[Enable assertion checking for debug mode])
AC_DEFINE([DEBUG_INITIALIZE_UNDEFINED],[1],[Initialize new memory to undefined values in debug mode])
esac],
debug_switches=-g)
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
BTNG_AC_LOG_VAR(debug_switches opt_switches)
dnl
dnl Set the optional classes to build
dnl
SAMRAI_OPTIONAL_LIBS=""
SAMRAI_ENABLE_SPECIAL="no"
if test "$enable_char" = "yes"; then
SAMRAI_OPTIONAL_LIBS="libchar"
AC_DEFINE([HAVE_CHAR],[1],[Build SAMRAI with instantiated char datatypes])
fi
if test "$enable_bool" = "yes"; then
SAMRAI_OPTIONAL_LIBS="libbool $SAMRAI_OPTIONAL_LIBS"
SAMRAI_ENABLE_SPECIAL="yes"
AC_DEFINE([HAVE_BOOL],[1],[Build SAMRAI with instantiated bool datatypes])
fi
if test "$enable_float" = "yes"; then
SAMRAI_OPTIONAL_LIBS="libfloat $SAMRAI_OPTIONAL_LIBS"
SAMRAI_ENABLE_SPECIAL="yes"
AC_DEFINE([HAVE_FLOAT],[1],[Build SAMRAI with instantiated float datatypes])
fi
if test "$enable_dcomplex" = "yes"; then
SAMRAI_OPTIONAL_LIBS="libdcomplex $SAMRAI_OPTIONAL_LIBS"
SAMRAI_ENABLE_SPECIAL="yes"
AC_DEFINE([HAVE_DCOMPLEX],[1],[Build SAMRAI with instantiated double-complex datatypes])
fi
AC_SUBST(SAMRAI_OPTIONAL_LIBS)
AC_SUBST(SAMRAI_ENABLE_SPECIAL)
dnl
dnl Set up the Fortran compiler. Look for special Fortran compilers on
dnl AIX machines.
dnl
if test -n "$with_F77"; then
dnl If user specifies full path then don't search in path
if test -f $with_F77; then
F77=$with_F77
else
AC_CHECK_PROGS(F77, $with_F77)
fi
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])
BTNG_AC_LOG_VAR(F77)
# Warn user about unusual compiler paths and LD_LIBRARY_PATH
for i in `which $F77` ; do
if echo "$i" | grep -v '^/usr/bin/' > /dev/null; then
AC_MSG_NOTICE([NOTIFICATION:
The compiler $i has an unusual path.
This may cause link problems if you don't also have the associated
library path in your LD_LIBRARY_PATH variable. If you don't have
that path in your LD_LIBRARY_PATH, the compiler checks may not run
properly. In that case, you may want to stop this process now, set
your LD_LIBRARY_PATH appropriately and run it.
])
fi
done
if test "$ac_cv_f77_compiler_gnu" = "yes"; then
F77_FLAGS="-Wall -Wimplicit -Wunused $F77_FLAGS"
else
case $ARCH in
sun4 | solaris)
F77_FLAGS="-u $F77_FLAGS"
;;
rs6000)
F77_FLAGS="-u -qextname $F77_FLAGS"
;;
IRIX64)
F77_FLAGS="-64 $F77_FLAGS"
;;
esac
fi
dnl
dnl Set up the Fortran libraries.
dnl
case $ARCH in
IRIX64)
SAVE_F77="$F77"
F77="$F77 -64"
CASC_FIND_F77LIBS
F77="$SAVE_F77"
;;
ipsc2)
dnl Manually set stuff for ASCI Red. This is a hack here
dnl but did not want to waste more time on a singleton machine
F77LIBFLAGS="-lpgftnrtl_cgr -lcmplx -lrpc"
;;
rs6000)
case $F77 in
*mpxlf*)
F77LIBFLAGS="-lxlf90 -lessl $F77LIBFLAGS"
;;
esac
;;
LINUX)
CASC_FIND_F77LIBS
case $F77 in
*ifc*)
F77LIBFLAGS="-lPEPCF90 $F77LIBFLAGS"
;;
esac
;;
*)
CASC_FIND_F77LIBS
;;
esac
LIB_NAME="$F77LIBFLAGS $LIB_NAME"
BTNG_AC_LOG_VAR(F77LIBFLAGS, after appending F77LIBFLAGS to LIB_NAME)
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],
[ --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 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])
X_LIBS=`echo $X_LIBS | sed 's/-R\//-R \//'`
if test -n "$x_includes"; then
INC_PATH="-I$x_includes $INC_PATH"
fi
LIB_PATH="$X_LIBS $LIB_PATH"
LIB_NAME="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS $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 Set DOXYGEN_BIN to the doxygen binary.
dnl
BTNG_PATH_PROG(DOXYGEN_BIN,doxygen)
BTNG_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,
[ --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`
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
BTNG_AC_LOG_VAR(with_dot_dir HAVE_DOT DOT_PATH)
AC_SUBST(HAVE_DOT)
AC_SUBST(DOT_PATH)
dnl BTNG_PATH_PROG(DOT_BIN,dot)
dnl BTNG_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,
[ --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
BTNG_PATH_PROG(SAMRAI_PERL,perl)
BTNG_AC_LOG_VAR(SAMRAI_PERL)
dnl
dnl Whether restrict key word works.
dnl
BTNG_AC_LOG(begin stringize)
AC_C_STRINGIZE
BTNG_AC_LOG(end stringize)
dnl
dnl Whether restrict key word works.
dnl
BTNG_C_RESTRICT
dnl
dnl Look for the iomanip header file name.
dnl
BTNG_IOMANIP_HEADER_FILENAME
dnl
dnl Look for the iostream header file name.
dnl
BTNG_IOSTREAM_HEADER_FILENAME
dnl
dnl Look for the strstream header file name.
dnl
BTNG_STL_SSTREAM_HEADER_FILENAME
dnl
dnl Deal with broken ostringstream type.
dnl Some platforms have ostringstream and some ostrstream.
dnl We need to know which is broken.
dnl
AC_LANG_PUSH([C++])
BTNG_TYPE_NAMESPACE
AC_MSG_CHECKING(type ostringstream)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include STL_SSTREAM_HEADER_FILE
#ifndef NAMESPACE_IS_BROKEN
using namespace std;
#endif
]], [[ostringstream oss; oss << 10;
]])],[AC_MSG_RESULT(ok)],[AC_MSG_RESULT(broken)
AC_DEFINE(OSTRINGSTREAM_TYPE_IS_BROKEN,1,The type ostringstream is broken)
])
AC_MSG_CHECKING(type ostrstream)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include STL_SSTREAM_HEADER_FILE
#ifndef NAMESPACE_IS_BROKEN
using namespace std;
#endif
]], [[ostrstream oss; oss << 10;
]])],[AC_MSG_RESULT(ok)],[AC_MSG_RESULT(broken)
AC_DEFINE(OSTRSTREAM_TYPE_IS_BROKEN,1,The type ostrstream is broken)
])
AC_LANG_POP([C++])
dnl
dnl Check if malloc.h is present
dnl
AC_CHECK_HEADER(malloc.h,
AC_DEFINE([HAVE_MALLOC_H],[1],[HAVE_MALLOC_H])
)
dnl
dnl Checking for mallinfo
dnl
AC_MSG_CHECKING(for mallinfo)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]], [[void *x=mallinfo]])],[AC_DEFINE(HAVE_MALLINFO, 1, Define if you have the 'mallinfo' function.)
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
])
CASC_CXX_ISNAN
dnl
dnl Set dl library on Linux.
dnl Linux has a dynamic load library, and some software (PETSc-2.1.3
dnl for example) require it. When configuring on Linux, if the
dnl dl library is found, use it.
dnl
BTNG_SUPPORT_DL(1)
if test "${dl_PREFIX+set}" = set; then
if echo $target_os | grep '^linux' > /dev/null \
&& test ! "${dl_LIBS+set}" = set; then
AC_MSG_WARN([
The Linux dynamic loading library is not found.
This may cause problems with some libraries that use it.
In particular, we have seen that PETSc may use this library.
])
fi
if test "${dl_LIBS}"; then
LIBS="$dl_LIBS $LIBS"
SAMRAI_SPLIT_LIBS_STRING(dl_LIBS,dl_LIB_PATH,dl_LIB_NAME)
LIB_PATH="$dl_LIB_PATH $LIB_PATH"
LIB_NAME="$dl_LIB_NAME $LIB_NAME"
INC_PATH="$dl_INCLUDES $INC_PATH"
fi
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}"
BTNG_AC_LOG_VAR([FLIBS FLIBS_PATH FLIBS_NAME], [after using ac_f77_library_ldflags])
dnl dnl
dnl dnl Set fortran library.
dnl dnl
dnl BTNG_AC_LOG_VAR(fortran_LIBS fortran_LIB_PATH fortran_LIB_NAME LIB_PATH LIB_NAME, before getting fortran libs)
dnl BTNG_SUPPORT_FORTRAN_FROM_C(1)
dnl if test -n "$fortran_LIBS" ; then
dnl LIBS="$LIBS $fortran_LIBS"
dnl SAMRAI_SPLIT_LIBS_STRING(fortran_LIBS,fortran_LIB_PATH,fortran_LIB_NAME)
dnl LIB_PATH="$fortran_LIB_PATH $LIB_PATH"
dnl LIB_NAME="$fortran_LIB_NAME $LIB_NAME"
dnl fi
dnl BTNG_AC_LOG_VAR(fortran_LIBS fortran_LIB_PATH fortran_LIB_NAME LIB_PATH LIB_NAME, after getting fortran libs)
dnl
dnl If the nsl library can be found, use it.
dnl
BTNG_SUPPORT_NSL(1)
if test "${nsl_PREFIX+set}" = set; then
LIBS="$nsl_LIBS $LIBS"
SAMRAI_SPLIT_LIBS_STRING(nsl_LIBS,nsl_LIB_PATH,nsl_LIB_NAME)
LIB_PATH="$nsl_LIB_PATH $LIB_PATH"
LIB_NAME="$nsl_LIB_NAME $LIB_NAME"
INC_PATH="$nsl_INCLUDES $INC_PATH"
fi
dnl
dnl If the z compression library can be found, use it.
dnl
BTNG_SUPPORT_LIBZ(1)
if test "${libz_PREFIX+set}" = set; then
LIBS="$libz_LIBS $LIBS"
SAMRAI_SPLIT_LIBS_STRING(libz_LIBS,libz_LIB_PATH,libz_LIB_NAME)
LIB_PATH="$libz_LIB_PATH $LIB_PATH"
LIB_NAME="$libz_LIB_NAME $LIB_NAME"
INC_PATH="$libz_INCLUDES $INC_PATH"
fi
dnl
dnl Set variables for blaslapack support
dnl
BTNG_SUPPORT_BLASLAPACK
if test "${blaslapack_PREFIX+set}" = set ||
test "${blaslapack_INCLUDES+set}" = set ||
test "${blaslapack_LIBS+set}" = set ; then
LIBS="$blaslapack_LIBS $LIBS"
SAMRAI_SPLIT_LIBS_STRING(blaslapack_LIBS,blaslapack_LIB_PATH,blaslapack_LIB_NAME)
LIB_PATH="$blaslapack_LIB_PATH $LIB_PATH"
LIB_NAME="$blaslapack_LIB_NAME $LIB_NAME"
INC_PATH="$blaslapack_INCLUDES $INC_PATH"
AC_DEFINE(HAVE_BLASLAPACK,1,BLASLAPACK library is available so use it)