forked from LLNL/AMPE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
943 lines (821 loc) · 22.9 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
dnl
dnl File: BASE configure.in
dnl Description: autoconfig configuration file
dnl
AC_INIT
AC_CONFIG_SRCDIR([LICENSE])
AC_CONFIG_AUX_DIR(config)
dnl
dnl Get system type.
dnl
AC_CANONICAL_TARGET([])
BTNG_AC_LOG_VAR(target_cpu target_vendor target_os)
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,
[ --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(noxargs,
[ --enable-shared build shared libraries])
AC_ARG_ENABLE(implicittemplates,
[ --enable-implicit-template-instantiation use implicit template instantiation])
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])
#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.]))
dnl
dnl Initialize common macros to empty strings
dnl NOTE: This overwrites anything the user has defined in the environment!
dnl
C_FLAGS=$CFLAGS
CXX_FLAGS=$CXXFLAGS
F77_FLAGS=$FFLAGS
AC_ARG_WITH(base,
[ --with-base=PATH use a preexisting BASE code at PATH])
if test -n "$with_base"; then
BASE_DIR=$with_base/base
AC_MSG_NOTICE([using a preexisting BASE code at $BASE_DIR])
AC_DEFINE(PREBUILT_BASE)
else
BASE_DIR=`pwd`/base
fi
BTNG_AC_LOG_VAR(with_base)
dnl LIBS is not used by BASE's configure.in, but it is used by some
dnl of the supporting macros.
LIBS=-lm
dnl
dnl Initialize IS_AIX macro to -UAIX
dnl
IS_AIX="-UAIX"
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 Get machine or cluster name
dnl
machname=`hostname | sed -e 's/\..*//g' -e 's/[[0-9]]//g'`
BTNG_AC_LOG_VAR(machname)
titan=`echo $machname | grep -c 'titan' `
if test "$titan" -eq 1; then
MPICCARG=cc
fi
dnl
dnl Set up the C++ compiler. By default, try to choose KCC.
dnl
if test -n "$with_CXX"; then
CXX=$with_CXX
else
case "$host_os" in
linux*) CCC=" g++ ";;
solaris*) CCC=" g++ KCC ";;
osf*) CCC=" g++ KCC ";;
*) CCC=
esac
if test ! "$with_mpi" = no; then
CCC="`echo $CCC | sed 's/ KCC / mpKCC KCC /'`"
fi
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_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 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 BASE
You are on your own!
])
;;
esac
# Warn user about unusual compiler paths and LD_LIBRARY_PATH
for i in `which $CXX` `which $CC` ; 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
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_EXPLICIT_TEMPLATE_INSTANTIATION
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_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
case $CXX in
*g++)
CXX_FLAGS="-Wall -Wno-unused-variable $CXX_FLAGS"
case $ARCH in
IRIX64)
CXX_FLAGS="-mabi=64 $CXX_FLAGS"
;;
solaris)
;;
CYGWIN)
CXX_FLAGS="-fpermissive $CXX_FLAGS"
;;
esac
;;
*mpKCC*)
CXX_FLAGS="--no_implicit_include $CXX_FLAGS"
CXX_FLAGS="$CXX_FLAGS"
if test "$enable_debug" = "yes"; then
C_FLAGS="+K0 $C_FLAGS"
fi
;;
*KCC*)
case $ARCH in
IRIX64)
CXX_FLAGS="-64 $CXX_FLAGS"
;;
esac
CXX_FLAGS="--no_implicit_include $CXX_FLAGS"
CXX_FLAGS="--keep_gen_c $CXX_FLAGS"
;;
*mpCC*)
CXX_FLAGS="-qnotempinc -qrtti=all $CXX_FLAGS"
;;
*CC)
case $ARCH in
solaris | sun4)
CXX_FLAGS="-instances=explicit $CXX_FLAGS"
CXX_FLAGS="+p $CXX_FLAGS"
;;
IRIX64)
# CXX_FLAGS="-64 -no_auto_include -ptnone -no_prelink $CXX_FLAGS"
CXX_FLAGS="-64 -OPT:Olimit=0 $CXX_FLAGS"
AC_DEFINE(HAVE_SPECIAL_COMPLEX_OSTREAM_INSTANTIATION)
AC_DEFINE(HAVE_SPECIAL_STRING_OSTREAM_INSTANTIATION)
;;
esac
;;
*icc*)
case $ARCH in
LINUX)
CXX_FLAGS="$CXX_FLAGS -wd869 -wd1572 -wd1419"
;;
esac
;;
*icpc*)
case $ARCH in
LINUX)
CXX_FLAGS="$CXX_FLAGS -wd869 -wd1572 -wd1419"
;;
esac
;;
*xlC*)
case $ARCH in
rs6000)
IS_AIX="-DAIX"
;;
esac
;;
esac
case "$CXX_ID" in
gnu)
case "$CXX_VERSION" in
3.[[1-9]]*)
CXX_FLAGS="$CXX_FLAGS -Wno-deprecated"
AC_MSG_WARN([
I am adding the -Wno-deprecated compiler flag to prevent
a lot of expected compiler warnings about using deprecated
header file names. This flag will be removed when all
compilers we support support standard header file names.
])
;;
esac
;;
esac
dnl
dnl Check whether we are going to be compiling with optimization, debug,
dnl or both optimization and debug. The default behavior is debug without
dnl optimization, although the user can over-ride these defaults using the
dnl flags --enable-opt and --enable-debug.
dnl
if test -z "$enable_debug"; then
enable_debug=no
fi
if test -z "$enable_opt"; then
enable_opt=no
fi
if test "$enable_opt" = "no" -a "$enable_debug" = "no"; then
enable_opt=yes
fi
BTNG_AC_LOG_VAR(enable_debug enable_opt)
AC_MSG_CHECKING(whether debugging is enabled)
AC_MSG_RESULT($enable_debug)
AC_MSG_CHECKING(whether optimization is enabled)
AC_MSG_RESULT($enable_opt)
dnl
dnl Set the compile mode flag for the kind of target to build
dnl
if test "$enable_shared" = "yes"; then
case $ARCH in
Linux | LINUX | linux )
C_FLAGS="-fPIC $C_FLAGS"
CXX_FLAGS="-fPIC $CXX_FLAGS"
;;
rs6000)
C_FLAGS="-qrtti=all $C_FLAGS"
CXX_FLAGS="-qrtti=all $CXX_FLAGS"
;;
*)
C_FLAGS="-KPIC $C_FLAGS"
CXX_FLAGS="-KPIC $CXX_FLAGS"
;;
esac
fi
dnl
dnl Enable implicit template instantiation
dnl
if test "$enable_implicit_template_instantiation" = "yes"; then
IMPLICIT_TEMPLATES="--enable-implicit-template-instantiation"
else
IMPLICIT_TEMPLATES=""
fi
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" ;;
kai) opt_switches="+K3" ;;
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
kai) debug_switches="+K0" ;;
*) debug_switches="-g -O0" ;;
esac ;;
*) debug_switches="$enable_debug" ;;
esac
case "$enable_debug" in
no) ;;
*)
AC_DEFINE(DEBUG_NO_INLINE)
AC_DEFINE(DEBUG_CHECK_ASSERTIONS)
AC_DEFINE(DEBUG_INITIALIZE_UNDEFINED)
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 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
dnl else
dnl if test -z "$F77"; then
dnl AC_CHECK_PROGS(F77, f77 g77 xlf f2c)
dnl else
dnl If F77 was specified then see if it is a full path
dnl or just the prog name in users PATH
dnl if test -f $F77; then
dnl F77=$F77
dnl else
dnl AC_CHECK_PROGS(F77, $F77)
dnl fi
dnl fi
fi
AC_PROG_F77(ifort f77 fort77 xlf g77 f90 xlf90)
test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran found in $PATH])
BTNG_AC_LOG_VAR(F77)
dnl AC_PROG_F77_WORKS
dnl AC_PROG_F77_GNU
dnl
dnl Set up the flags for the Fortran compiler. For the GNU compiler, add
dnl the default warning flags.
dnl
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="-qextname $F77_FLAGS"
;;
IRIX64)
F77_FLAGS="-64 $F77_FLAGS"
;;
esac
fi
dnl
dnl Set up the Fortran libraries.
dnl
F77LIBDIRS=$F77LIBDIRS
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_WARN([BASE configured without the X11 library])
AC_DEFINE(LACKS_X11)
else
AC_DEFINE(HAVE_X11)
X_LIBS=`echo $X_LIBS | sed 's/-R\//-R \//'`
fi
else
AC_MSG_WARN([BASE configured without the X11 library])
AC_DEFINE(LACKS_X11)
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
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_BIN to the dot binary, for use with doxygen.
dnl
BTNG_PATH_PROG(DOT_BIN,dot)
BTNG_AC_LOG_VAR(DOT_BIN)
# Doxygen wants to know if we have the dot binary.
HAVE_DOT=NO; test "${DOT_BIN+set}" = set && HAVE_DOT=YES
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_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_TOKEN
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++])
CXX_FLAGS+=" -std=c++11"
#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 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)
#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)
#fi
#dnl
#dnl Set variables for blaslapack support
#dnl
#BTNG_SUPPORT_BLASLAPACK
#if test "${blaslapack_PREFIX+set}" = set; then
# LIBS="$blaslapack_LIBS $LIBS"
# SAMRAI_SPLIT_LIBS_STRING(blaslapack_LIBS,blaslapack_LIB_PATH,blaslapack_LIB_NAME)
# AC_DEFINE(HAVE_BLASLAPACK,1,BLASLAPACK library is available so use it)
#fi
#BTNG_AC_LOG_VAR(blaslapack_LIB_PATH blaslapack_LIB_NAME)
dnl
dnl If MPI is requested, then determine the proper path using CASC_FIND_MPI.
dnl Note: I added CASC_FIND_MPI_ALPHA for special case with compass cluster.
dnl For more information, see code comments for macro in casc_mpi.m4. AMW 9/00
dnl
AC_ARG_WITH(mpi,[ --without-mpi Compile without MPI library.])
if test "$with_mpi" = no; then
AC_MSG_WARN([BASE configured without the MPI library])
AC_DEFINE(LACKS_MPI)
else
case $ARCH in
alpha)
CASC_FIND_MPI_ALPHA
;;
*)
CASC_FIND_MPI
;;
esac
if test -n "$MPIINCLUDE" -o -n "$MPILIBS" -o -n "$MPILIBDIRS"; then
with_mpi=yes
AC_DEFINE(HAVE_MPI)
BTNG_AC_LOG_VAR(MPIINCLUDE MPILIBS MPILIBDIRS, After successfully finding MPI using casc_find_mpi)
fi
fi
BTNG_AC_LOG_VAR(with_mpi)
dnl
dnl Set variables for hdf5 support
dnl
BTNG_SUPPORT_HDF5
if test "${hdf5_PREFIX+set}" = set; then
LIBS="$hdf5_LIBS $LIBS"
SAMRAI_SPLIT_LIBS_STRING(hdf5_LIBS,hdf5_LIB_PATH,hdf5_LIB_NAME)
AC_DEFINE(HAVE_HDF5,1,HDF5 library is available so use it)
fi
BTNG_AC_LOG_VAR(
[hdf5_INCLUDES hdf5_LIB_PATH hdf5_LIB_NAME])
dnl
dnl BOOST support
dnl
BTNG_SUPPORT_BOOST
if test "${boost_PREFIX+set}" = set; then
SAMRAI_SPLIT_LIBS_STRING(boost_LIBS,boost_LIB_PATH,boost_LIB_NAME)
LIB_PATH="$boost_LIB_PATH $LIB_PATH"
LIB_NAME="$boost_LIB_NAME $LIB_NAME"
INC_PATH="$boost_INCLUDES $INC_PATH"
AC_DEFINE([HAVE_BOOST_HEADERS],[1],[BOOST headers are available to use])
else
AC_MSG_ERROR(
[Path to BOOST installation must be specified with --with-boost])
fi
BTNG_AC_LOG_VAR(
[boost_INCLUDES INC_PATH boost_LIBS LIB_PATH LIB_NAME])
dnl
dnl NetCDF support
dnl
BTNG_SUPPORT_NETCDF
if test "${netcdf_PREFIX+set}" = set; then
SAMRAI_SPLIT_LIBS_STRING(netcdf_LIBS,netcdf_LIB_PATH,netcdf_LIB_NAME)
LIB_PATH="$netcdf_LIB_PATH $LIB_PATH"
LIB_NAME="$netcdf_LIB_NAME $LIB_NAME"
INC_PATH="$netcdf_INCLUDES $INC_PATH"
AC_DEFINE([HAVE_NETCDF_HEADERS],[1],[NETCDF headers are available to use])
else
AC_MSG_ERROR(
[Path to NetCDF installation must be specified with --with-netcdf])
fi
BTNG_AC_LOG_VAR(
[netcdf_INCLUDES INC_PATH netcdf_LIBS LIB_PATH LIB_NAME])
dnl
dnl Hypre support
dnl
BTNG_SUPPORT_HYPRE
if test "${hypre_PREFIX+set}" = set; then
SAMRAI_SPLIT_LIBS_STRING(hypre_LIBS,hypre_LIB_PATH,hypre_LIB_NAME)
LIB_PATH="$hypre_LIB_PATH $LIB_PATH"
LIB_NAME="$hypre_LIB_NAME $LIB_NAME"
INC_PATH="$hypre_INCLUDES $INC_PATH"
AC_DEFINE([HAVE_HYPRE_HEADERS],[1],[HYPRE headers are available to use])
else
AC_MSG_ERROR(
[Path to Hypre installation must be specified with --with-hypre])
fi
BTNG_AC_LOG_VAR(
[hypre_INCLUDES INC_PATH hypre_LIBS LIB_PATH LIB_NAME])
#dnl
#dnl The following are hacks for specific architectures. We are not proud
#dnl of these tests, and they should be changed to macros in the future.
#dnl
#dnl Check for broken XDR headers on linux and CYGWIN systems.
#dnl The RPC headers are not C++ compatible on ASCI Red. Use Steve's version.
#dnl AIX requires both _ALL_SOURCE and _POWER for some system files.
#dnl
#case $ARCH in
# Linux | LINUX | linux | CYGWIN )
# AC_DEFINE(LACKS_PROPER_XDR_HEADER)
# ;;
# ipsc2)
# AC_DEFINE(LACKS_PROPER_XDR_HEADER)
# ;;
# rs6000)
# AC_DEFINE(_ALL_SOURCE)
# AC_DEFINE(_POWER)
# ;;
# *)
# ;;
#esac
dnl
dnl Generate the installation directory for the SAMRAI libraries. The
dnl installation location is given by $prefix/machname-CXX-F77-dbg, which machname
dnl is machine or cluster name, CXX is the basename of the
dnl C++ compiler, F77 is the basename of the Fortran compiler, and dbg is
dnl the debug status (dbg, optdbg, or opt).
dnl
debug_ext=opt
if test "$enable_debug" = "yes"; then
if test "$enable_opt" = "yes"; then
debug_ext=optdbg
else
debug_ext=dbg
fi
fi
if test "$prefix" = "NONE"; then
dir_place_holder=`pwd`
mkdir -p build
cd $srcdir/build
prefix=`pwd`
cd $dir_place_holder
fi
AC_ARG_WITH([zlib],
[AS_HELP_STRING([--with-zlib Compile with ZLIB library.])])
if test "$with_zlib" = no; then
AC_MSG_WARN([BASE configured without the ZLIB library])
with_zlib=no
else
with_zlib=yes
fi
BTNG_AC_LOG_VAR(with_zlib)
dnl
dnl Define the macro substitutions for the generated output files
dnl
SYSTYPE=$machname-`basename $CXX`-`basename $F77`-$debug_ext
DEBUG=$debug_ext
ZLIB=$with_zlib
ROOTDIR=`dirname $prefix`
INSTDIR=$prefix/$SYSTYPE
DEVDIR=source
SOURCE_DIR=`cd $srcdir ; pwd`/$DEVDIR
if test -n "$with_base"; then
BASE_BUILD_DIR=$with_base/build/$SYSTYPE/base
else
BASE_BUILD_DIR=$INSTDIR/base
fi
if test -n "$with_mpi_lib_dirs"; then
WITHMPILIBDIRS=yes
else
WITHMPILIBDIRS=no
fi
if test -n "$with_MPICC"; then
WITHMPICCSET=yes
else
WITHMPICCSET=no
fi
CONFIG_DIR=$INSTDIR/config
SAM_CONFIG_DIR=$BASE_BUILD_DIR/SAMRAI/config
dnl
dnl Macro substitutions for the generated
dnl doconfig.sundials.in and doconfig.SAMRAI.in templates
dnl
AC_SUBST(DEBUG)
AC_SUBST(ZLIB)
AC_SUBST(WITHMPILIBDIRS)
AC_SUBST(WITHMPICCSET)
AC_SUBST(MPICCARG)
AC_SUBST(CC)
AC_SUBST(C_FLAGS)
AC_SUBST(CXX)
AC_SUBST(CXX_FLAGS)
AC_SUBST(F77)
AC_SUBST(F77_FLAGS)
AC_SUBST(hdf5_PREFIX)
AC_SUBST(boost_PREFIX)
AC_SUBST(netcdf_PREFIX)
AC_SUBST(hypre_PREFIX)
AC_SUBST(BASE_BUILD_DIR)
AC_SUBST(IMPLICIT_TEMPLATES)
dnl
dnl Macro substitutions for the generated Makefile.config.in templates
dnl
AC_SUBST(SOURCE_DIR)
AC_SUBST(CONFIG_DIR)
AC_SUBST(SAM_CONFIG_DIR)
AC_SUBST(F77LIBDIRS)
AC_SUBST(IS_AIX)
dnl
dnl Macro substitutions for the generated doinstall.in templates
dnl
SAMCONFDIR=$BASE_DIR/SAMRAI/$SYSTYPE
AC_SUBST(BASE_DIR)
AC_SUBST(SAMCONFDIR)
dnl
dnl Find all Makefile.in and associated subdirectories
dnl
#subdirs=`cd $srcdir; find $DEV_DIR -name Makefile*.in -print | sed 's%/Makefile.in$%%g' | sort `
subdirs=`cd $srcdir; find $DEVDIR -name Makefile*.in -print | sed 's%/Makefile.in$%%g' | sort `
makefiles=
for i in $subdirs; do makefiles="$makefiles $i/Makefile"; done
makefiles_install=
for i in $makefiles; do j=`echo $i | sed 's/source/objects/'`; makefiles_install="$makefiles_install $INSTDIR/$j:$i.in"; done
BTNG_AC_LOG_VAR(makefiles)
BTNG_AC_LOG_VAR(makefiles_install)
BTNG_AC_LOG_VAR(subdirs)
mkdir -p $INSTDIR
dnl
dnl Generate the output files.
dnl
if test -z "$with_base"; then
AC_CONFIG_FILES([
$BASE_BUILD_DIR/doinstall:config/doinstall.in
$BASE_DIR/sundials/doconfig:config/doconfig.sundials.in
$BASE_DIR/sundials/doinstall:config/doinstall.sundials.in
$SAMCONFDIR/doconfig:config/doconfig.SAMRAI.in
$SAMCONFDIR/doinstall:config/doinstall.SAMRAI.in
])
fi
AC_CONFIG_FILES([
$INSTDIR/config/Makefile.config:config/Makefile.config.in
${makefiles_install}
])
AC_CONFIG_COMMANDS([default],[[
# Make the doconfig and doinstall scripts executable
if test -z "$with_base"; then
chmod u+x $instdir/base/doinstall
for arg in $rootdir/base/sundials $samconfdir
do
for file in doconfig doinstall
do
chmod u+x $arg/$file
done
done
fi
# Create the Makefile.depend files
for arg in $subdirs
do
dir_place_holder=`pwd`
cd $rootdir/$arg
$rootdir/scripts/depend
cd $dir_place_holder
done
]],[[
srcdir=$srcdir
subdirs="$subdirs"
instdir="$INSTDIR"
rootdir="$ROOTDIR"
sundialsconfdir="$BASE_DIR/sundials"
samconfdir="$SAMCONFDIR"
with_base="$with_base"
]])
AC_OUTPUT