-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
1003 lines (941 loc) · 33.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
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
# Process this file with autoconf to produce a configure script.
AC_INIT(lis, 1.2.71, [email protected])
AC_CONFIG_SRCDIR([src/fortran/lisf_matrix.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(lis,1.2.71,[email protected])
AM_CONFIG_HEADER(include/lis_config.h)
AM_MAINTAINER_MODE
AC_ARG_VAR(MPICC,[MPI C compiler])
AC_ARG_VAR(MPIF77,[MPI Fortran compiler])
AC_ARG_VAR(MPIRUN,[command to execute MPI programs])
AC_ARG_VAR(OMPFLAG,[OpenMP flags])
AC_ARG_VAR(MPFLAG,[floating point precision flags])
AC_ARG_VAR(TARGET,[system architecture])
AC_ARG_ENABLE(fortran, AC_HELP_STRING(--enable-fortran, [build Fortran 77 interfaces [[default=no]]]))
AC_ARG_ENABLE(saamg, AC_HELP_STRING(--enable-saamg, [build SA-AMG preconditioner [[default=no]]]))
AC_ARG_ENABLE(mpi, AC_HELP_STRING(--enable-mpi, [build with MPI library [[default=no]]]))
AC_ARG_ENABLE(omp, AC_HELP_STRING(--enable-omp, [build with OpenMP library [[default=no]]]))
AC_ARG_ENABLE(quad, AC_HELP_STRING(--enable-quad, [enable quadruple precision operations [[default=no]]]))
AC_ARG_ENABLE(sse2, AC_HELP_STRING(--enable-sse2, [use Intel Streaming SIMD Extensions [[default=yes]]]),[],enable_sse2=yes)
AC_ARG_ENABLE(fma, AC_HELP_STRING(--enable-fma, [use fused multiply add [[default=no]]]))
#AC_ARG_ENABLE(enable_quadopt, AC_HELP_STRING(--enable-quadopt, [use SSE2 [[default=no]]]))
#AC_ARG_ENABLE(overlap, AC_HELP_STRING(--enable-overlap, [enable overlap of communication and computation [[default=no]]]))
AC_ARG_ENABLE(debug, AC_HELP_STRING(--enable-debug, [build with debug mode [[default=no]]]))
AC_ARG_ENABLE(gprof, AC_HELP_STRING(--enable-gprof, [enable profiling [[default=no]]]))
AC_ARG_ENABLE(64bit, AC_HELP_STRING(--enable-64bit, [build 64bit binary on AIX and Solaris x86 [[default=no]]]))
AC_ARG_ENABLE(32bit, AC_HELP_STRING(--enable-32bit, [build 32bit binary on Mac OS X [[default=no]]]))
AC_MSG_CHECKING([for a library suffix to use])
AC_ARG_WITH(library-suffix,
[ --with-library-suffix=LIBSUFFIX tag a suffix to the library names [[default=]]],
[LIBSUFFIX="${withval}"],
[LIBSUFFIX=])
AC_SUBST(LIBSUFFIX)
if test "$TARGET" != ""; then
case "$TARGET" in
cray_xt3) CC="cc"
F77="ftn"
FC="ftn"
MPICC="$CC"
MPIF77="$F77"
MPIFC="$FC"
MPIRUN="yod"
CFLAGS="-O3 -B -fastsse -tp k8-64"
FFLAGS="-O3 -fastsse -tp k8-64 -Mpreprocess"
FCFLAGS="-O3 -fastsse -tp k8-64 -Mpreprocess"
FCLDFLAGS="-Mnomain"
enable_mpi="yes"
ac_cv_sizeof_void_p=8
cross_compiling="yes"
ax_f77_mangling="lower case, underscore, no extra underscore"
;;
fujitsu_pg) CC="fcc"
F77="frt"
FC="frt"
MPICC="mpifcc"
MPIF77="mpifrt"
MPIFC="mpifrt"
CFLAGS="-Kfast,ocl,preex"
FFLAGS="-Kfast,ocl,preex -Cpp"
FCFLAGS="-Kfast,ocl,preex -Cpp -Am"
FCLDFLAGS=""
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, underscore, no extra underscore"
ax_cv_c_compiler_vendor="fujitsu"
ax_cv_f77_compiler_vendor="fujitsu"
cross_compiling="yes"
MPIRUN="mpiexec"
MPINP="-n"
OMPFLAG="-KOMP"
AMDEFS="-PG"
;;
fujitsu_pq) CC="fcc"
F77="frt"
FC="frt"
MPICC="mpifcc"
MPIF77="mpifrt"
MPIFC="mpifrt"
CFLAGS="-Kfast,ocl,preex"
FFLAGS="-Kfast,ocl,preex -Cpp"
FCFLAGS="-Kfast,ocl,preex -Cpp -Am"
FCLDFLAGS=""
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, underscore, no extra underscore"
ax_cv_c_compiler_vendor="fujitsu"
ax_cv_f77_compiler_vendor="fujitsu"
MPIRUN="mpiexec"
MPINP="-n"
OMPFLAG="-KOMP"
;;
hitachi) CC="cc"
F77="f90"
FC="f90"
MPICC="mpicc"
MPIF77="mpif90"
MPIFC="mpif90"
CFLAGS="-Os -64 -nolimit"
FFLAGS="-Oss -64 -nolimit -cpp"
FCFLAGS="-Oss -64 -nolimit -cpp -c"
FCLDFLAGS="-lf90s"
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, underscore, no extra underscore"
ax_cv_c_compiler_vendor="hitachi"
ax_cv_f77_compiler_vendor="hitachi"
MPIRUN="mpirun"
MPINP="-np"
OMPFLAG="-parallel -omp"
;;
ibm_bgl) CC="blrts_xlc"
F77="blrts_xlf90"
FC="blrts_xlf90"
MPICC="$CC"
MPIF77="$F77"
MPIFC="$FC"
CFLAGS="-O3 -qarch=440d -qtune=440 -qstrict -I/bgl/BlueLight/ppcfloor/bglsys/include"
FFLAGS="-O3 -qarch=440d -qtune=440 -qsuffix=cpp=F -qfixed=72 -w -I/bgl/BlueLight/ppcfloor/bglsys/include"
FCFLAGS="-O3 -qarch=440d -qtune=440 -qsuffix=cpp=F90 -w -I/bgl/BlueLight/ppcfloor/bglsys/include"
MPILIBS="-L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts"
enable_mpi="yes"
ac_cv_sizeof_void_p=8
cross_compiling="yes"
ax_cv_f77_compiler_vendor="ibm"
ax_cv_c_compiler_vendor="ibm"
ax_f77_mangling="lower case, no underscore, no extra underscore"
;;
nec_es) CC="esmpic++"
F77="esmpif90"
FC="esmpif90"
MPICC="$CC"
MPIF77="$F77"
MPIFC="$FC"
AR="esar"
RANLIB="true"
CFLAGS=""
FFLAGS=""
FCFLAGS=""
FCLDFLAGS=""
LDFLAGS=""
enable_mpi="yes"
enable_omp="yes"
ac_cv_sizeof_void_p=8
cross_compiling="yes"
ax_f77_mangling="lower case, no underscore, extra underscore"
ax_vector_machine="yes"
OMPFLAG="-Popenmp"
;;
nec_sx6i) CC="c++"
F77="f90"
FC="f90"
RANLIB="true"
CFLAGS=""
FFLAGS=""
FCFLAGS=""
FCLDFLAGS=""
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, no underscore, extra underscore"
ax_vector_machine="yes"
;;
nec_sx6i_cross) CC="sxc++"
F77="sxf90"
FC="sxf90"
AR="sxar"
RANLIB="true"
STRIP="sxstrip"
CFLAGS=""
FFLAGS=""
FCFLAGS=""
FCLDFLAGS=""
ac_cv_sizeof_void_p=8
cross_compiling="yes"
ax_f77_mangling="lower case, no underscore, extra underscore"
ax_vector_machine="yes"
;;
nec_sx9) CC="sxmpic++"
F77="sxmpif90"
FC="sxmpif90"
MPICC="$CC"
MPIF77="$F77"
MPIFC="$FC"
AR="ar"
RANLIB="true"
CFLAGS=""
FFLAGS=""
FCFLAGS=""
FCLDFLAGS=""
LDFLAGS=""
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, no underscore, extra underscore"
ax_vector_machine="yes"
OMPFLAG="-Popenmp"
;;
nec_sx9_cross) CC="sxmpic++"
F77="sxmpif90"
FC="sxmpif90"
MPICC="$CC"
MPIF77="$F77"
MPIFC="$FC"
AR="sxar"
RANLIB="true"
CFLAGS=""
FFLAGS=""
FCFLAGS=""
FCLDFLAGS=""
LDFLAGS=""
ac_cv_sizeof_void_p=8
cross_compiling="yes"
ax_f77_mangling="lower case, no underscore, extra underscore"
ax_vector_machine="yes"
OMPFLAG="-Popenmp"
;;
cuda-linux) CC="nvcc"
F77="f95"
FC="f95"
MPICC="$CC"
MPIF77="$FC"
MPIFC="$FC"
CFLAGS="-O3"
FFLAGS="-O3"
FCFLAGS="-O3"
FCLDFLAGS=""
ac_cv_sizeof_void_p=8
ax_f77_mangling="lower case, underscore, no extra underscore"
;;
*) echo 'TARGET not found.'
exit 1
;;
esac
fi
if test "$build_vendor" = "apple"; then
if test "$enable_fortran" = "yes" || test "$enable_saamg" = "yes"; then
if test "$enable_32bit" = "yes"; then
CC="gcc -m32"
FC="gfortran -m32"
else
CC="gcc -m64"
FC="gfortran -m64"
fi
fi
fi
enable_dependency_tracking="no"
# Checks for programs
########## Check CC ##########
AC_PROG_CC([icc ecc xlc_r xlc fcc pgcc pathcc cc gcc])
if test "$CFLAGS" = "-g -O2"; then
CFLAGS=""
fi
if test "$TARGET" = ""; then
if test "$CC" = "fcc"; then
CFLAGS="-O3"
FFLAGS="-O3 -Cpp"
FCFLAGS="-O3 -Cpp -Am"
ax_f77_mangling="lower case, underscore, no extra underscore"
MPIRUN="mpiexec"
MPINP="-n"
fi
fi
if test "$TARGET" = ""; then
if test "$enable_mpi" = "yes"; then
AC_CHECK_PROGS(MPICC, $MPICC mpicc mpifcc hcc mpcc_r mpcc mpxlc cmpicc blrts_xlc esmpic++, $CC)
save_cc="$CC"
CC="$MPICC"
if test x = x"$MPILIBS"; then
AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])
fi
if test x = x"$MPILIBS"; then
AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
fi
if test x = x"$MPILIBS"; then
AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
fi
if test x != x"$MPILIBS"; then
AC_MSG_CHECKING([for mpi.h])
AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
AC_MSG_RESULT(no)])
else
enable_mpi="not found"
fi
CC="$save_cc"
CC=$MPICC
fi
########## Check CFLAGS ##########
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI pathscale:__PATHCC__,__PATHSCALE__; do
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#if !($vencpp)
thisisanerror;
#endif
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
done
AC_MSG_CHECKING([for C compiler vendor])
AC_MSG_RESULT($[ax_cv_]_AC_LANG_ABBREV[_compiler_vendor])
case $ax_cv_c_compiler_vendor in
dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host $CFLAGS" ;;
gnu) CFLAGS="-O3 -fomit-frame-pointer $CFLAGS" ;;
intel) CFLAGS="-O3 -ansi_alias $CFLAGS" ;;
portland) CFLAGS="-O3 -B -fastsse $CFLAGS" ;;
pathscale) CFLAGS="-O3 $CFLAGS" ;;
ibm) CFLAGS="-O3 -qansialias -w -qarch=auto -qtune=auto $CFLAGS"
AR="ar -X any"
;;
sun) case `(uname -m) 2>/dev/null` in
"i86pc") CFLAGS="-xtarget=native -xO5 -dalign $CFLAGS"
LDFLAGS="-xtarget=native -xO5"
;;
*) CFLAGS="-xtarget=native64 -xO5 -dalign $CFLAGS"
LDFLAGS="-xtarget=native64 -xO5"
;;
esac
;;
hp) CFLAGS="+Oall +Optrs_ansi +DSnative $CFLAGS" ;;
esac
AC_DEFUN([_AX_PROG_FC_V_OUTPUT],
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# Compile and link our simple test program by passing a flag (argument
# 1 to this macro) to the Fortran compiler in order to get
# "verbose" output that we can then parse for the Fortran linker
# flags.
ac_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS m4_default([$1], [$ac_cv_prog_[]_AC_LANG_ABBREV[]_v])"
(eval echo $as_me:__oline__: \"$ac_link\") >&AS_MESSAGE_LOG_FD
ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_[]_AC_LANG_ABBREV[]_v_output" >&AS_MESSAGE_LOG_FD
CFLAGS=$ac_save_CFLAGS
rm -f conftest*
# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
# /foo, /bar, and /baz are search directories for the Fortran linker.
# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
ac_[]_AC_LANG_ABBREV[]_v_output="`echo $ac_[]_AC_LANG_ABBREV[]_v_output | grep 'LPATH is:' | sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $ac_[]_AC_LANG_ABBREV[]_v_output"
case $ac_[]_AC_LANG_ABBREV[]_v_output in
# If we are using xlf then replace all the commas with spaces.
*xlcentry*)
ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/,/ /g'` ;;
# With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
# $LIBS confuse us, and the libraries appear later in the output anyway).
*mGLOB_options_string*)
ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/\"-mGLOB[[^\"]]*\"/ /g'` ;;
esac
])
AC_DEFUN([_AX_PROG_FC_V],
[AC_CACHE_CHECK([how to get verbose linking output from C],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_v],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[ac_cv_prog_[]_AC_LANG_ABBREV[]_v=
# Try some options frequently used verbose output
for ac_verb in -v -verbose --verbose -V -\#\#\#; do
_AX_PROG_FC_V_OUTPUT($ac_verb)
# look for -l* and *.a constructs in the output
for ac_arg in $ac_[]_AC_LANG_ABBREV[]_v_output; do
case $ac_arg in
[[\\/]]*.a | ?:[[\\/]]*.a | -[[lLRu]]*)
ac_cv_prog_[]_AC_LANG_ABBREV[]_v=$ac_verb
break 2 ;;
esac
done
done
if test -z "$ac_cv_prog_[]_AC_LANG_ABBREV[]_v"; then
AC_MSG_WARN([cannot determine how to obtain linking information from C])
fi],
[AC_MSG_WARN([compilation failed])])
])])
_AX_PROG_FC_V
AC_CACHE_CHECK([for C libraries], ac_cv_[]_AC_LANG_ABBREV[]_libs,
[if test "x$[]_AC_LANG_PREFIX[]LIBS" != "x"; then
ac_cv_[]_AC_LANG_ABBREV[]_libs="$[]_AC_LANG_PREFIX[]LIBS" # Let the user override the test.
else
_AX_PROG_FC_V_OUTPUT
ac_cv_[]_AC_LANG_ABBREV[]_libs=
# Save positional arguments (if any)
ac_save_positional="$[@]"
set X $ac_[]_AC_LANG_ABBREV[]_v_output
while test $[@%:@] != 1; do
shift
ac_arg=$[1]
case $ac_arg in
[[\\/]]*.a | ?:[[\\/]]*.a)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
;;
-bI:*)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
[_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
;;
# Ignore these flags.
-lang* | -lcrt[[01]].o | -lcrtbegin.o | -lc | -lgcc | -libmil | -LANG:=*)
;;
-lkernel32)
test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
;;
-[[LRuY]])
# These flags, when seen by themselves, take an argument.
# We remove the space between option and argument and re-iterate
# unless we find an empty arg or a new option (starting with -)
case $[2] in
"" | -*);;
*)
ac_arg="$ac_arg$[2]"
shift; shift
set X $ac_arg "$[@]"
;;
esac
;;
-YP,*)
for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
_AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
[ac_arg="$ac_arg $ac_j"
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
done
;;
-[[lLR]]*)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
;;
# Ignore everything else.
esac
done
# restore positional arguments
set X $ac_save_positional; shift
# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
# then we insist that the "run path" must be an absolute path (i.e. it
# must begin with a "/").
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*)
ac_ld_run_path=`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
test "x$ac_ld_run_path" != x &&
_AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_[]_AC_LANG_ABBREV[]_libs)
;;
esac
fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
])
[]_AC_LANG_PREFIX[]LIBS="$ac_cv_[]_AC_LANG_ABBREV[]_libs"
AC_SUBST([]_AC_LANG_PREFIX[]LIBS)
fi
########## Check F77 and FC ##########
if test "$enable_fortran" = "yes" || test "$enable_saamg" = "yes"; then
if test -z "$F77"; then
F77=$FC
fi
AC_LANG_PUSH(Fortran 77)
AC_PROG_F77([ifort ifc efc xlf95_r xlf90_r xlf_r xlf95 xlf90 xlf ftn frt pgf95 pgf90 pathf95 pathf90 epcf90 f95 fort lf95 gfortran f90 g77])
if test "$TARGET" = ""; then
if test "$enable_mpi" = "yes"; then
AC_CHECK_PROGS(MPIF77, mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpifrt cmpifc cmpif90c mpf90 mpif90 hf77 mpxlf_r mpxlf mpf77 mpif77, $F77)
F77=$MPIF77
fi
fi
AC_LANG_POP(Fortran 77)
if test -n "$F77"; then
FC=$F77
MPIFC=$MPIF77
fi
fi
if test "$enable_saamg" = "yes"; then
AC_LANG_PUSH(Fortran)
AC_PROG_FC([ifort ifc efc xlf95_r xlf90_r xlf_r xlf95 xlf90 xlf ftn frt pgf95 pgf90 pathf95 pathf90 epcf90 f95 fort lf95 gfortran f90])
if test "$TARGET" = ""; then
if test "$enable_mpi" = "yes"; then
AC_CHECK_PROGS(MPIFC, mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpifrt cmpifc cmpif90c mpf90 mpif90 hf77, $F77)
FC=$MPIFC
fi
fi
# AC_FC_SRCEXT(F90)
AC_LANG_POP(Fortran)
fi
########## Check FFLAGS and FCFLAGS ##########
if test "$TARGET" = ""; then
AC_LANG_PUSH(Fortran 77)
ac_ext=F
for ventest in intel:__INTEL_COMPILER ibm:__IBMC__ gnu:__GNUC__ sun:__SUNPRO_F77,__SUNPRO_F90,__SUNPRO_F95 portland:__PGI pathscale:__PATHCC__,__PATHSCALE__; do
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#if !($vencpp)
thisisanerror;
#endif
])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
done
AC_MSG_CHECKING([for Fortran compiler vendor])
AC_MSG_RESULT($[ax_cv_]_AC_LANG_ABBREV[_compiler_vendor])
AC_LANG_POP(Fortran 77)
case $ax_cv_f77_compiler_vendor in
gnu) FFLAGS="-O3 -fomit-frame-pointer $FFLAGS"
FCFLAGS="-O3 -fomit-frame-pointer $FCFLAGS" ;;
intel) FFLAGS="-O3 -fpp $FFLAGS"
FCFLAGS="-O3 -fpp $FCFLAGS"
LDFLAGS="-Vaxlib"
FCLDFLAGS="-nofor_main" ;;
portland) FFLAGS="-O3 -fastsse -Mpreprocess $FFLAGS"
FCFLAGS="-O3 -fastsse -Mpreprocess $FCFLAGS"
FCLDFLAGS="-Mnomain" ;;
pathscale) FFLAGS="-O3 $FFLAGS" ;;
ibm) FFLAGS="-O3 -qsuffix=cpp=F -qfixed=72 -w -qarch=auto -qtune=auto $FFLAGS"
FCFLAGS="-O3 -qsuffix=cpp=F90 -w -qarch=auto -qtune=auto $FCFLAGS" ;;
sun) case `(uname -m) 2>/dev/null` in
"i86pc") FFLAGS="-fpp -xtarget=native -xO5 -dalign $FFLAGS"
FCFLAGS="-fpp -xtarget=native -xO5 -dalign $FCFLAGS"
FCLDFLAGS="-xO5" ;;
*) FFLAGS="-fpp -xtarget=native64 -xO5 -dalign $FFLAGS"
FCFLAGS="-fpp -xtarget=native64 -xO5 -dalign $FCFLAGS"
FCLDFLAGS="-xO5" ;;
esac
;;
esac
# FCFLAGS="$FCFLAGS $FCFLAGS_f90"
if test x$ax_cv_c_compiler_vendor = x$ax_cv_f77_compiler_vendor; then
CLIBS=""
fi
# if test "$enable_fortran" = "yes" || test "$enable_saamg" = "yes"; then
# LIBS="$LIBS $CLIBS"
# fi
fi
if test "$enable_fortran" = "yes" || test "$enable_saamg" = "yes"; then
AC_LANG_PUSH(Fortran 77)
if test "$ax_cv_f77_compiler_vendor" = "sun"; then
ax_f77_mangling="lower case, underscore, no extra underscore"
fi
if test -z "$ax_f77_mangling"; then
AC_F77_WRAPPERS
AC_F77_DUMMY_MAIN
else
case $ax_f77_mangling in
"lower case, no underscore, no extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name])
;;
"lower case, no underscore, extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _])
;;
"lower case, underscore, no extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _])
;;
"lower case, underscore, extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## __])
;;
"upper case, no underscore, no extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME])
;;
"upper case, no underscore, extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _])
;;
"upper case, underscore, no extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _])
;;
"upper case, underscore, extra underscore")
AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _])
AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## __])
;;
esac
fi
AC_LANG_POP(Fortran 77)
fi
# Checks for arguments
######### Fortran API ##########
if test "$enable_fortran" = "yes"; then
AC_DEFINE([USE_FORTRAN], [1], [Define to 1 to build Fortran 77 interfaces.])
else
enable_fortran="no"
fi
######### SA-AMG ##########
if test "$enable_saamg" = "yes"; then
AC_DEFINE([USE_SAAMG], [1], [Define to 1 to build SA-AMG Preconditioner.])
case $ax_cv_f77_compiler_vendor in
ibm) FCFLAGS="$FCFLAGS -WF,-DZERO_ORIGIN=1" ;;
gnu) FCFLAGS="$FCFLAGS -Wp,-DZERO_ORIGIN=1" ;;
hitachi) FCFLAGS="$FCFLAGS" ;;
*) FCFLAGS="$FCFLAGS -DZERO_ORIGIN=1" ;;
esac
else
enable_saamg="no"
fi
if test "$enable_fortran" = "yes"; then
if test "$CC" = "fcc"; then
AC_DEFINE([USE_MAIN__], [1], [Use MAIN__ macro with Fortran.])
else
if test "$CC" = "mpifcc"; then
AC_DEFINE([USE_MAIN__], [1], [Use MAIN__ macro with Fortran.])
fi
fi
else
if test "$enable_saamg" = "yes"; then
if test "$CC" = "fcc"; then
AC_DEFINE([USE_MAIN__], [1], [Use MAIN__ macro with Fortran.])
else
if test "$CC" = "mpifcc"; then
AC_DEFINE([USE_MAIN__], [1], [Use MAIN__ macro with Fortran.])
fi
fi
fi
fi
########## MPI and OpenMP ##########
if test "$TARGET" = ""; then
if test -z "$enable_mpi"; then
enable_mpi="no"
MPIRUN=""
else
if test -z "$MPIRUN"; then
AC_CHECK_PROGS(MPIRUN, mpirun mpiexec, mpirun)
fi
if test -z "$MPINP"; then
if test "$MPIRUN" = "mpiexec"; then
MPINP="-n"
else
MPINP="-np"
fi
fi
fi
if test "$enable_omp" = "yes"; then
save_cflags="$CFLAGS"
openmp_flags="-openmp -qsmp=omp -xopenmp -fopenmp -KOMP -mp -omp -Popenmp none"
for ompf in $openmp_flags; do
AC_MSG_CHECKING([for OpenMP flag $ompf])
case $ompf in
none) CFLAGS=$save_cflags ;;
*) CFLAGS="$save_cflags $ompf" ;;
esac
AC_TRY_LINK([#include<omp.h>],[ omp_set_num_threads(1)], [OMPFLAG=$ompf; AC_MSG_RESULT(yes); break])
AC_MSG_RESULT(no)
done
CFLAGS=$save_cflags
if test "$OMPFLAG" = ""; then
enable_omp="not found"
else
if test "$OMPFLAG" = "none"; then
OMPFLAG=""
fi
fi
else
case $ax_cv_c_compiler_vendor in
hitachi) OMPFLAG="-noparallel" ;;
esac
case $ax_cv_f77_compiler_vendor in
hitachi) OMPFLAG="-noparallel" ;;
esac
enable_omp="no"
fi
fi
if test "$enable_mpi" = "yes"; then
CC=$MPICC
F77=$MPIF77
FC=$MPIFC
CFLAGS="$CFLAGS -DUSE_MPI"
case $ax_cv_f77_compiler_vendor in
ibm) FCFLAGS="$FCFLAGS -WF,-DUSE_MPI"
FFLAGS="$FFLAGS -WF,-DUSE_MPI"
;;
gnu) if test "$FC" = "gfortran"; then
FCFLAGS="$FCFLAGS -Wp,-DUSE_MPI"
FFLAGS="$FFLAGS -Wp,-DUSE_MPI"
fi
;;
*) FCFLAGS="$FCFLAGS -DUSE_MPI"
FFLAGS="$FFLAGS -DUSE_MPI"
;;
esac
else
enable_mpi="no"
fi
if test "$enable_omp" = "yes"; then
if test "$OMPFLAG" != ""; then
CFLAGS="$CFLAGS $OMPFLAG"
FFLAGS="$FFLAGS $OMPFLAG"
FCFLAGS="$FCFLAGS $OMPFLAG"
LDFLAGS="$LDFLAGS $OMPFLAG"
fi
OMPFLAG=""
fi
########## x87 FPU ##########
AC_MSG_CHECKING([for x87 FPU])
case $target in
i*86-* | x86*) AC_MSG_RESULT(yes)
AC_DEFINE([HAS_X87_FPU], [1], [Define to 1 to have x87 FPU.])
;;
*) AC_MSG_RESULT(no) ;;
esac
# enable_sse2="no"
########## Quad Opt ##########
#if test "$enable_quadopt" = "yes"; then
# AC_DEFINE([USE_FMA2_SSE2], [1], [Define to 1 to build quad precision using FMA2_SSE2.])
#else
# enable_quadopt="no"
#fi
########## Quad ##########
if test "$enable_quad" = "yes"; then
########## SSE2 ##########
# enable_sse2="yes"
if test "$enable_sse2" = "yes"; then
AC_MSG_CHECKING([for SSE2])
AC_TRY_COMPILE([#include <emmintrin.h>],[
__m128d xs;
double hi;
xs = _mm_set_pd(1.0,1.0);
_mm_store_sd(&hi,xs);
],[AC_MSG_RESULT(yes)
AC_DEFINE([USE_SSE2], [1], [Define to 1 to build quad precision using SSE2.])
AC_DEFINE([USE_FMA2_SSE2], [1], [Define to 1 to build quad precision using FMA2_SSE2.])
], [enable_sse2="no"; AC_MSG_RESULT(no)])
fi
if test "$TARGET" = ""; then
if test "$enable_sse2" != "yes"; then
save_cflags="$CFLAGS"
case $ax_cv_c_compiler_vendor in
intel) quad_flags="-mp" ;;
ibm) quad_flags="-qstrict none" ;;
sun) quad_flags="-fsimple=0 none" ;;
*) quad_flags="none" ;;
esac
if test "$MPFLAG" != ""; then
quad_flags="$MPFLAG $quad_flags"
fi
for mpf in $quad_flags; do
case $ax_cv_c_compiler_vendor in
sun) mpf="$mpf -fns=no" ;;
esac
case $mpf in
none) CFLAGS=$save_cflags ;;
*) CFLAGS="$save_cflags $mpf" ;;
esac
AC_MSG_CHECKING([for mp flag $mpf])
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],[[double r,e;
double a=1.0;
double b=1.1e-16;
r=a+b;
e=b-(r-a);
printf("r=%e e=%e ",r,e);
if(e==0.0) return 1;
]])],
[MPFLAG=$mpf; AC_MSG_RESULT(yes); break],
AC_MSG_RESULT(no))
done
CFLAGS=$save_cflags
if test "$MPFLAG" = ""; then
enable_quad="not found"
else
if test "$MPFLAG" = "none"; then
MPFLAG=""
fi
fi
fi
fi
if test "$enable_quad" = "yes"; then
AC_DEFINE([USE_QUAD_PRECISION], [1], [Define to 1 to build quad precision.])
AC_DEFINE([USE_FAST_QUAD_ADD], [1], [Define to 1 to build quad precision using Fast Quad ADD.])
if test "$enable_sse2" = "yes"; then
case $ax_cv_c_compiler_vendor in
gnu) MPFLAG="-msse2" ;;
esac
fi
fi
else
enable_quad="no"
fi
########## FMA ##########
if test "$enable_fma" = "yes"; then
AC_DEFINE([HAS_FMA], [1], [Define to 1 to build quad precision using FMA.])
case $ax_cv_c_compiler_vendor in
intel) MPFLAG="$MPFLAG -IPF-fma" ;;
esac
else
enable_fma="no"
fi
########## Overlap ##########
if test "$enable_overlap" = "yes"; then
AC_DEFINE([USE_OVERLAP], [1], [Define to 1 to build overlap mode for lis_sendrecv.])
else
enable_overlap="no"
fi
########## Check size of void_p ##########
if test "$TARGET" = ""; then
AC_CHECK_SIZEOF(void *)
else
AC_DEFINE([SIZEOF_VOID_P], [$ac_cv_sizeof_void_p], [The size of a `void *', as computed by sizeof.])
fi
########## Vectorize ##########
if test "$ax_vector_machine" = "yes"; then
AC_DEFINE([USE_VEC_COMP], [1], [Define to 1 to use vector machine.])
else
ax_vector_machine="no"
fi
######### Debug ##########
if test "$enable_debug" = "yes"; then
CFLAGS="$CFLAGS -D_DEBUG"
case $ax_cv_f77_compiler_vendor in
ibm) FCFLAGS="$FCFLAGS -WF,-DDEBUG" ;;
gnu) if test "$FC" = "gfortran"; then
FCFLAGS="$FCFLAGS -Wp,-DDEBUG"
fi
;;
*) FCFLAGS="$FCFLAGS -DDEBUG" ;;
esac
else
enable_debug="no"
fi
######### Profile ##########
if test "$enable_gprof" = "yes"; then
case $ax_cv_c_compiler_vendor in
sun) CFLAGS="$CFLAGS -xpg"
FFLAGS="$FFLAGS -xpg"
FCFLAGS="$FCFLAGS -xpg"
LDFLAGS="$LDFLAGS -xpg"
;;
fujitsu) CFLAGS="$CFLAGS -p"
FFLAGS="$FFLAGS -p"
FCFLAGS="$FCFLAGS -p"
LDFLAGS="$LDFLAGS -p"
;;
hp) CFLAGS="$CFLAGS -p"
FFLAGS="$FFLAGS -p"
FCFLAGS="$FCFLAGS -p"
LDFLAGS="$LDFLAGS -p"
;;
gnu) CFLAGS="$CFLAGS -fno-omit-frame-pointer -pg"
FFLAGS="$FFLAGS -fno-omit-frame-pointer -pg"
FCFLAGS="$FCFLAGS -fno-omit-frame-pointer -pg"
LDFLAGS="$LDFLAGS -fno-omit-frame-pointer -pg"
;;
*) CFLAGS="$CFLAGS -pg"
FFLAGS="$FFLAGS -pg"
FCFLAGS="$FCFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
;;
esac
else
enable_gprof="no"
fi
######### Executable ##########
if test "$enable_64bit" = "yes"; then
case $ax_cv_c_compiler_vendor in
sun) CFLAGS="$CFLAGS -m64"
FFLAGS="$FFLAGS -m64"
FCFLAGS="$FCFLAGS -m64"
LDFLAGS="$LDFLAGS -m64"
;;
ibm) CFLAGS="$CFLAGS -q64"
FFLAGS="$FFLAGS -q64"
FCFLAGS="$FCFLAGS -q64"
LDFLAGS="$LDFLAGS -q64"
;;
esac
else
enable_64bit="no"
fi
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AM_CONDITIONAL(ENABLE_FORTRAN, test x$enable_fortran = xyes)
AM_CONDITIONAL(ENABLE_SAAMG, test x$enable_saamg = xyes)
AM_CONDITIONAL(ENABLE_MPI, test x"$enable_mpi" = xyes)
AM_CONDITIONAL(ENABLE_OMP, test x"$enable_omp" = xyes)
AM_CONDITIONAL(ENABLE_QUAD, test x$enable_quad = xyes)
AM_CONDITIONAL(ENABLE_SSE2, test x$enable_sse2 = xyes)
AM_CONDITIONAL(ENABLE_QUADOPT, test x$enable_quadopt = xyes)
AM_CONDITIONAL(ENABLE_OVERLAP, test x$enable_overlap = xyes)
AM_CONDITIONAL(ENABLE_DEVELOP, test x$enable_develop = xyes)
AC_SUBST(enable_mpi)
AC_SUBST(enable_omp)
AC_SUBST(enable_saamg)
AC_SUBST(enable_quad)
AC_SUBST(enable_fortran)
AC_SUBST(MPIRUN)
AC_SUBST(MPINP)
AC_SUBST(AMDEFS)
AC_SUBST(SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
AC_SUBST(FCLDFLAGS)
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h stdlib.h string.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
#AC_HEADER_TIME
# Checks for library functions.
#AC_FUNC_MALLOC
#AC_FUNC_VPRINTF
#AC_CHECK_FUNCS([clock_gettime floor gettimeofday memset sqrt])
LIBS="$LIBS $MPILIBS -lm"
#if test -z "`echo $LIBS | grep '\-lm'`"; then
# LIBS="$LIBS -lm"
#fi
AC_CONFIG_FILES([Makefile
src/Makefile
src/matrix/Makefile
src/vector/Makefile
src/matvec/Makefile
src/solver/Makefile
src/esolver/Makefile
src/precon/Makefile
src/system/Makefile
src/precision/Makefile
src/fortran/Makefile
src/fortran/amg/Makefile
include/Makefile
test/Makefile
include/lisf.h
win32/Makefile
])
#AC_OUTPUT(Makefile src/Makefile src/matrix/Makefile)
DEFS="$DEFSADD $DEFS"
AC_OUTPUT()
echo
echo "Using "
echo " C Compiler = $CC"
echo " C Flags = $AMDEFS $DEFS $CFLAGS"
echo " C Libs = $CLIBS"
echo " Libs = $LIBS"
if test "$enable_fortran" = "yes"; then
echo " F77 Compiler = $F77"
echo " F77 Flags = $FFLAGS"
echo " F77 Libs = $FLIBS"
fi
if test "$enable_saamg" = "yes"; then
echo " F90 Compiler = $FC"
echo " F90 Flags = $FCFLAGS $FCFLAGS_f90"
echo " F90 Libs = $FCLIBS"
fi
echo " enable Fortran Wrapper = $enable_fortran"
echo " enable SA-AMG Preconditioner = $enable_saamg"
echo " enable MPI = $enable_mpi"
echo " enable OpenMP = $enable_omp"
echo " enable Quad Precision = $enable_quad"
#echo " enable Quad Precision Optimization = $enable_quadopt"
if test "$enable_quad" = "yes"; then
echo " enable SSE2 = $enable_sse2"
echo " enable FMA = $enable_fma"
fi
#echo " enable Overlap = $enable_overlap"
if test "$enable_develop" = "yes"; then
echo " enable Develop mode = $enable_develop"
fi
echo " MPICC = $MPICC"
echo " MPIF77 = $MPIF77"
echo " MPIFC = $MPIFC"
echo " MPILIBS = $MPILIBS"