-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
1435 lines (1244 loc) · 44.8 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
# -*- shell-script -*-
#
#
#
# Init autoconf
#
# 2.53
AC_PREREQ(2.52)
AC_INIT(protomol,2.1,[email protected])
# 2.13 cp configure.ac configure.in
#AC_INIT(README)
#AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT,"[email protected]",[Define to the address where bug reports for this package should be sent.])
#AC_DEFINE_UNQUOTED(PACKAGE_NAME,"protomol",[Define to the full name of this package.])
#AC_DEFINE_UNQUOTED(PACKAGE_STRING,"protomol 2.1",[Define to the full name and version of this package.])
#AC_DEFINE_UNQUOTED(PACKAGE_TARNAME,"protomol",[Define to the one symbol short name of this package.])
#AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"2.1",[Define to the version of this package.])
AC_CONFIG_AUX_DIR(./config)
#AC_CANONICAL_TARGET
# Avoid generating makefile rules to rebuild maintainer-only files by
# default. Maintainers may override this default and generate these
# makefile rules using the `--enable-maintainer-mode' configure option.
#AM_MAINTAINER_MODE
# Major Framework release number
PROTOMOL_MAJOR_VERSION=2
# Minor Framework release number
PROTOMOL_MINOR_VERSION=0
# Increment after every source code change
PROTOMOL_PATCH_LEVEL=4
# Combined version number
VERSION=$PROTOMOL_MAJOR_VERSION.$PROTOMOL_MINOR_VERSION.$PROTOMOL_PATCH_LEVEL
AM_INIT_AUTOMAKE(protomol,$VERSION)
AM_CONFIG_HEADER(protomol_config.h)
# Report what was found
AC_MSG_CHECKING(major version)
AC_MSG_RESULT($PROTOMOL_MAJOR_VERSION)
AC_MSG_CHECKING(minor version)
AC_MSG_RESULT($PROTOMOL_MINOR_VERSION)
AC_MSG_CHECKING(patchlevel)
AC_MSG_RESULT($PROTOMOL_PATCH_LEVEL)
AC_SUBST(PROTOMOL_MAJOR_VERSION)
AC_SUBST(PROTOMOL_MINOR_VERSION)
AC_SUBST(PROTOMOL_PATCH_LEVEL)
# Calculate libtool versioning information
LT_RELEASE=$PROTOMOL_MAJOR_VERSION.$PROTOMOL_MINOR_VERSION
LT_CURRENT=$PROTOMOL_INTERFACE_VERSION
LT_REVISION=0 #`expr $PROTOMOL_PATCH_LEVEL - $PROTOMOL_INTERFACE_VERSION`
LT_AGE=0 #`expr $PROTOMOL_INTERFACE_VERSION - $PROTOMOL_BINARY_VERSION`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
#
# Defines
#
AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE,"http://protomol.sourceforge.net",[ProtoMol URL])
AC_DEFINE_UNQUOTED(PACKAGE_CITE,["Please cite T. Matthey, T. Cickovski, S. S. Hampton, A. Ko, Q. Ma, M. Nyerges, T. Raeder,\nT. Slabach, and J. A. Izaguirre. ProtoMol: An object-oriented framework for prototyping\nnovel algorithms for molecular dynamics. ACM Trans. Math. Softw., 30(3):237265, 2004."],[ProtoMol cite])
AC_DEFINE_UNQUOTED(PACKAGE_UNAME,"`uname -a`",[System, platform])
AC_DEFINE_UNQUOTED(PACKAGE_WHOAMI,"`whoami`",[User])
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT,"[email protected]",[Define to the address where bug reports for this package should be sent.])
#
# Compiler
#
use_preset=0
AC_ARG_WITH(fft, [ --with-fft=sgi|essl|fftw3|fftw2|fft2mpi|zfft Specify the FFT ])
AC_ARG_WITH(fftw3, [ --with-fftw3=DIR Specify the FFTW3 install path and enable FFTW3 ])
AC_ARG_WITH(fftw2, [ --with-fftw2=DIR Specify the FFTW2 install path and enable FFTW2 ])
AC_ARG_WITH(fftw2mpi, [ --with-fftw2mpi=DIR Specify the FFTW2 MPI install path and enable FFTW2 MPI ])
AC_ARG_WITH(glut, [ --with-glut=DIR|no|yes Specify the GLUT install path and enable GLUT ])
AC_ARG_WITH(lapack, [ --with-lapack(=simtk) Enable/Disable Lapack or SimTKlapack ])
AC_ARG_WITH(lapack_dir, [ --with-lapack-dir=DIR Specify alternate directory for Lapack libs/includes ])
AC_ARG_WITH(boost, [ --with-boost=DIR Specify directory for boost installation ])
AC_ARG_WITH(aix_xlc, [ --with-aix-xlc Use xlC for AIX with optimization flags ],use_preset=1)
AC_ARG_WITH(aix_xlc_debug, [ --with-aix-xlc-debug Use xlC for AIX with debugging flags ],use_preset=1)
AC_ARG_WITH(aix_xlc_mpi, [ --with-aix-xlc-mpi Use xlC for AIX with MPI and optimization flags ],use_preset=1)
AC_ARG_WITH(aix_xlc_mpi_debug, [ --with-aix-xlc-mpi-debug Use xlC for AIX with MPI and debugging flags ],use_preset=1)
AC_ARG_WITH(gcc, [ --with-gcc Use g++ for generic with optimization flags ],use_preset=1)
AC_ARG_WITH(gcc_debug, [ --with-gcc-debug Use g++ for generic with debugging flags ],use_preset=1)
AC_ARG_WITH(gcc_debug_gdb, [ --with-gcc-debug-gdb Use g++ for generic with debugging and gdb flags ],use_preset=1)
AC_ARG_WITH(gcc_mpich, [ --with-gcc-mpich Use g++ for generic with MPICH flags ],use_preset=1)
AC_ARG_WITH(gcc_mpich_debug, [ --with-gcc-mpich-debug Use g++ for generic with MPICH debug flags ],use_preset=1)
AC_ARG_WITH(gcc_opteron, [ --with-gcc-opteron Use g++ for Opteron 64 with optimization flags ],use_preset=1)
AC_ARG_WITH(gcc_opteron_debug, [ --with-gcc-opteron-debug Use g++ for Opteron 64 with debug flags ],use_preset=1)
AC_ARG_WITH(gcc_xeon, [ --with-gcc-xeon Use g++ for Xeon with optimization flags ],use_preset=1)
AC_ARG_WITH(gcc_xeon_debug, [ --with-gcc-xeon-debug Use g++ for Xeon with debug flags ],use_preset=1)
AC_ARG_WITH(hpux_cc, [ --with-hpux-cc Use aCC for HPUX optimization flags ],use_preset=1)
AC_ARG_WITH(hpux_cc_debug, [ --with-hpux-cc-debug Use aCC for HPUX with debugging flags ],use_preset=1)
AC_ARG_WITH(hpux_cc_mpi, [ --with-hpux-cc-mpi Use aCC for HPUX with MPI and optimization flags ],use_preset=1)
AC_ARG_WITH(hpux_cc_mpi_debug, [ --with-hpux-cc-mpi-debug Use aCC for HPUX with MPI and debugging flags ],use_preset=1)
AC_ARG_WITH(icc, [ --with-icc Use icc for generic with optimization flags ],use_preset=1)
AC_ARG_WITH(icc_debug, [ --with-icc-debug Use icc for generic with debugging flags ],use_preset=1)
AC_ARG_WITH(icc_mpich, [ --with-icc-mpich Use icc for generic with MPICH and optimization flags ],use_preset=1)
AC_ARG_WITH(icc_mpich_debug, [ --with-icc-mpich-debug Use icc for generic with MPICH and debugging flags ],use_preset=1)
AC_ARG_WITH(irix_mipspro, [ --with-irix-mipspro Use CC for IRIX with optimization flags ],use_preset=1)
AC_ARG_WITH(irix_mipspro_debug, [ --with-irix-mipspro-debug Use CC for IRIX with debugging flags ],use_preset=1)
AC_ARG_WITH(irix_mipspro_mpi, [ --with-irix-mipspro-mpi Use CC for IRIX with MPI and optimization flags ],use_preset=1)
AC_ARG_WITH(irix_mipspro_mpi_debug, [ --with-irix-mipspro-mpi-debug Use CC for IRIX with MPI and debugging flags ],use_preset=1)
AC_ARG_WITH(ppc_xlc, [ --with-ppc-xlc Use xlC for PPC with optimization flags ],use_preset=1)
AC_ARG_WITH(ppc_xlc_debug, [ --with-pcc-xlc-debug Use xlC for PPC with debugging flags ],use_preset=1)
AC_ARG_WITH(sun_gcc, [ --with-sun-gcc Use g++ for SUN with optimization flags ],use_preset=1)
AC_ARG_ENABLE(framework_mpi, [ --disable-framework-mpi Disable MPI flags for the framework ], enable_framework_mpi=$enableval, enable_framework_mpi=yes)
if test "$enable_framework_mpi" = "yes"; then
mpi_flags="-DHAVE_APP_MPI -DHAVE_MPI"
else
mpi_flags="-DHAVE_APP_MPI"
fi
# 2.53
AC_LANG(C++)
AC_PROG_CXX([aCC mpCC_r xlC_r xlC xlc++ CC icpc icc g++ cxx mpic++ mpicxx mpiCC])
have_lapack=false
have_simtklapack=false
# -------------------------------------------------------------------------- #
# Lapack
# -------------------------------------------------------------------------- #
LAPACK_LIBS=""
LAPACK_CFLAGS=""
if( test "$with_lapack" = yes || test "$with_lapack" = true ||
test "$with_lapack" = simtk ) then
LIBS=$save_libs
CFLAGS=$save_cflags
CPPFLAGS=$save_cppflags
if( test x"$with_lapack_dir" != x ) then
if( test x"$with_lapack_dir/include" != x &&
test x"$with_lapack_dir/lib" != x ) then
LAPACK_INCLUDE_DIR="-I$with_lapack_dir/include"
LAPACK_LIB_DIR="-L$with_lapack_dir/lib"
else
LAPACK_INCLUDE_DIR="-I$with_lapack_dir"
LAPACK_LIB_DIR="-L$with_lapack_dir"
fi
#LIBS="$LAPACK_LIB_DIR"
CFLAGS="$CFLAGS $LAPACK_INCLUDE_DIR"
CPPFLAGS="$CPPFLAGS $LAPACK_INCLUDE_DIR"
LAPACK_LIBS="$LAPACK_LIB_DIR"
LAPACK_CFLAGS="$LAPACK_INCLUDE_DIR"
fi
if( test "$with_lapack" = simtk ) then
have_simtklapack=true
#AC_CHECK_LIB( SimTKlapack, dsyevr_, , [have_simtklapack=false] )
AC_CHECK_HEADER( SimTKlapack.h, , [have_simtklapack=false] )
if( test $have_simtklapack = false ) then
echo "Warning: No SimTKlapack libraries found"
else
echo "Using SimTKlapack"
LAPACK_LIBS="$LAPACK_LIBS -lSimTKlapack"
LAPACK_CFLAGS="$LAPACK_CFLAGS -DHAVE_LAPACK -DHAVE_SIMTK_LAPACK"
fi
else
have_lapack=true
#AC_CHECK_LIB( lapack, dsyev_, , [have_lapack=false], [ -lg2c -lblas ] )
if( test $have_lapack = false ) then
echo "Warning: No lapack libraries found"
else
echo "Using lapack"
LAPACK_LIBS="$LAPACK_LIBS -llapack -lblas -lg2c"
LAPACK_CFLAGS="$LAPACK_CFLAGS -DHAVE_LAPACK"
fi
fi
if ( test "$have_lapack" = false && test "$have_simtklapack" = false ) then
LAPACK_LIBS=""
LAPACK_CFLAGS=""
fi
fi
AC_SUBST( LAPACK_CFLAGS )
AC_SUBST( LAPACK_LIBS )
#--------------------------------------------------------------------
#
if test $use_preset = 0; then
AC_MSG_RESULT([Auto detection of compiler: $CXX])
fi
unset ac_cv_prog_ac_ct_CC
unset ac_cv_prog_ac_ct_CXX
AC_MSG_CHECKING([preset g++ for SUN with optimization flags ])
WANT_SUN_GCC_FLAGS=0
if test "$with_sun_gcc" = "yes"; then
WANT_SUN_GCC_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -mcpu=ultrasparc -m32 -U_LP64 -U__sparc_v9__ -U__sparcv9 -DNDEBUG"
CXX="g++"
CXXFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -mcpu=ultrasparc -m32 -U_LP64 -U__sparc_v9__ -U__sparcv9 -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_IRIX_MIPSPRO_MPI_FLAGS=0
AC_MSG_CHECKING([preset CC fro IRIX with MPI and optimization flags ])
if (test "$with_irix_mipspro_mpi" = "yes" || ((test $use_preset = 0) && test $CXX = "CC" )) then
WANT_IRIX_MIPSPRO_MPI_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="-Wl,-read -fullwarn -woff 1209,1506 -mips4 -Ofast=ip35 -64 -DNDEBUG $mpi_flags -DMPI_NO_CPPBIND"
CXX="CC"
CXXFLAGS="-Wl,-read -fullwarn -woff 3649,3625,1209,3201,1424,1110,1506,1182 -mips4 -Ofast=ip35 -64 -LANG:std -LANG:restrict=ON -LANG:ansi-for-init-scope=ON -DNDEBUG $mpi_flags -DMPI_NO_CPPBIND"
LIBS="-lmpi -lsma -lm"
DEPFLAGS="-LANG:std"
else
AC_MSG_RESULT([no])
fi
WANT_IRIX_MIPSPRO_MPI_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset CC for IRIX with MPI and debugging flags ])
if test "$with_irix_mipspro_mpi_debug" = "yes"; then
WANT_IRIX_MIPSPRO_MPI_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="-Wl,-read -fullwarn -woff 1209,1506 -mips4 -O2 -64 $mpi_flags -DMPI_NO_CPPBIND"
CXX="CC"
CXXFLAGS="-Wl,-read -fullwarn -woff 3649,3625,1209,3201,1424,1110,1506,1182 -mips4 -O2 -64 -LANG:std -LANG:restrict=ON -LANG:ansi-for-init-scope=ON $mpi_flags -DMPI_NO_CPPBIND"
LIBS="-lmpi -lsma -lm"
DEPFLAGS="-LANG:std"
else
AC_MSG_RESULT([no])
fi
WANT_IRIX_MIPSPRO_FLAGS=0
AC_MSG_CHECKING([preset CC for IRIX with optimization flags ])
if test "$with_irix_mipspro" = "yes"; then
WANT_IRIX_MIPSPRO_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="-Wl,-read -fullwarn -woff 1209,1506 -mips4 -Ofast=ip35 -64 -DNDEBUG"
CXX="CC"
CXXFLAGS="-Wl,-read -fullwarn -woff 3649,3625,1209,3201,1424,1110,1506,1182 -mips4 -Ofast=ip35 -64 -LANG:std -LANG:restrict=ON -LANG:ansi-for-init-scope=ON -DNDEBUG"
LIBS="-lm"
DEPFLAGS="-LANG:std"
else
AC_MSG_RESULT([no])
fi
WANT_IRIX_MIPSPRO_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset CC for IRIX with debugging flags ])
if test "$with_irix_mipspro_debug" = "yes"; then
WANT_IRIX_MIPSPRO_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="-Wl,-read -fullwarn -woff 1209,1506 -mips4 -O2 -64"
CXX="CC"
CXXFLAGS="-Wl,-read -fullwarn -woff 3649,3625,1209,3201,1424,1110,1506,1182 -mips4 -O2 -64 -LANG:std -LANG:restrict=ON -LANG:ansi-for-init-scope=ON"
LIBS="-lm"
DEPFLAGS="-LANG:std"
else
AC_MSG_RESULT([no])
fi
WANT_ICC_FLAGS=0
AC_MSG_CHECKING([preset icc for generic with optimization flags ])
if (test "$with_icc" = "yes" || ((test $use_preset = 0) && (test $CXX = "icc" || test $CXX = "icpc"))) then
unset CC
unset CXX
WANT_ICC_FLAGS=1
AC_MSG_RESULT([yes])
AC_LANG(C++)
AC_PROG_CXX([icpc icc])
AC_LANG(C)
AC_PROG_CC([icpc icc])
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG -Wl,-rpath,$HOME/Public/core/lib"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG -Wl,-rpath,$HOME/Public/core/lib"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
WANT_ICC_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset icc for generic with debugging flags ])
if test "$with_icc_debug" = "yes"; then
unset CC
unset CXX
WANT_ICC_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
AC_LANG(C++)
AC_PROG_CXX([icpc icc])
AC_LANG(C)
AC_PROG_CC([icpc icc])
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
WANT_ICC_MPICH_FLAGS=0
AC_MSG_CHECKING([preset icc for generic with MPICH and optimization flags ])
if (test "$with_icc_mpich" = "yes") then
unset CC
unset CXX
WANT_ICC_MPICH_FLAGS=1
AC_MSG_RESULT([yes])
AC_LANG(C++)
AC_PROG_CXX([mpicxx mpiCC mpic++])
AC_LANG(C)
AC_PROG_CC([mpicc])
if (test "$have_lapack" = false && test "$have_simtklapack" = false) then
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG $mpi_flags"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG $mpi_flags"
else
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -O3 -ip -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
fi
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
WANT_ICC_MPICH_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset icc for generic with MPICH and debugging flags ])
if test "$with_icc_mpich_debug" = "yes"; then
unset CC
unset CXX
WANT_ICC_MPICH_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
AC_LANG(C++)
AC_PROG_CXX([mpicxx mpic++ mpiCC])
AC_LANG(C)
AC_PROG_CC([mpicc])
if (test "$have_lapack" = false && test "$have_simtklapack" = false) then
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict -DNDEBUG $mpi_flags"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict -DNDEBUG $mpi_flags"
else
CFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
CXXFLAGS="-Wall -wd810,383,981,279,444,1572,654,1125 -inline_debug_info -restrict -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
fi
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
WANT_GCC_MPICH_FLAGS=0
AC_MSG_CHECKING([preset g++ for generic with MPICH flags ])
if test "$with_gcc_mpich" = "yes"; then
unset CC
unset CXX
WANT_GCC_MPICH_FLAGS=1
AC_MSG_RESULT([yes])
AC_LANG(C++)
AC_PROG_CXX([mpicxx mpiCC mpic++])
if (test "$have_lapack" = false && test "$have_simtklapack" = false) then
CFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG $mpi_flags"
CXXFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG $mpi_flags"
else
CFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
CXXFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG -Wl,-rpath,$LAPACK_LIBS $mpi_flags"
fi
CC="mpicc"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_MPICH_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset g++ for generic with MPICH debug flags ])
if test "$with_gcc_mpich_debug" = "yes"; then
unset CC
unset CXX
WANT_GCC_MPICH_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="mpicc"
if (test "$have_lapack" = false && test "$have_simtklapack" = false) then
CFLAGS="-Wall $mpi_flags -I${MPI_HOME}/include"
else
CFLAGS="-Wall -Wl,-rpath,$LAPACK_LIBS $mpi_flags -I${MPI_HOME}/include"
fi
AC_LANG(C++)
AC_PROG_CXX([mpicxx mpiCC mpic++])
if (test "$have_lapack" = false && test "$have_simtklapack" = false) then
CXXFLAGS="-Wall $mpi_flags -I${MPI_HOME}/include"
else
CXXFLAGS="-Wall -Wl,-rpath,$LAPACK_LIBS $mpi_flags -I${MPI_HOME}/include"
fi
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_XEON_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset g++ for Xeon with no optimization flags ])
if ( test "$with_gcc_xeon_debug" = "yes" ) then
WANT_GCC_XEON_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -march=pentium4"
CXX="g++"
CXXFLAGS="-Wall -march=pentium4"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_XEON_FLAGS=0
AC_MSG_CHECKING([preset g++ for Xeon with optimization flags ])
if ( test "$with_gcc_xeon" = "yes" ) then
WANT_GCC_XEON_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -O3 -march=pentium4 -ffast-math -finline-functions -funroll-loops -DNDEBUG"
CXX="g++"
CXXFLAGS="-Wall -O3 -march=pentium4 -ffast-math -finline-functions -funroll-loops -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_OPTERON_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset g++ for Opteron 64 with no optimization flags ])
if ( test "$with_gcc_opteron_debug" = "yes" ) then
WANT_GCC_OPTERON_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -march=opteron"
CXX="g++"
CXXFLAGS="-Wall -march=opteron"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_OPTERON_FLAGS=0
AC_MSG_CHECKING([preset g++ for Opteron 64 with optimization flags ])
if ( test "$with_gcc_opteron" = "yes" ) then
WANT_GCC_OPTERON_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -O3 -march=opteron -ffast-math -finline-functions -funroll-loops -DNDEBUG"
CXX="g++"
CXXFLAGS="-Wall -O3 -march=opteron -ffast-math -finline-functions -funroll-loops -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_FLAGS=0
AC_MSG_CHECKING([preset g++ for generic with optimization flags ])
if (test "$with_gcc" = "yes" || ((test $use_preset = 0) && ( test $CXX = "c++" || test $CXX = "g++"))) then
WANT_GCC_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG"
CXX="g++"
CXXFLAGS="-Wall -O9 -ffast-math -finline-functions -funroll-loops -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset g++ for generic with debugging flags ])
if test "$with_gcc_debug" = "yes"; then
WANT_GCC_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-Wall"
CXX="g++"
CXXFLAGS="-Wall"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_GCC_DEBUG_GDB_FLAGS=0
AC_MSG_CHECKING([preset g++ for generic with debugging and gdb flags ])
if test "$with_gcc_debug_gdb" = "yes"; then
WANT_GCC_DEBUG_GDB_FLAGS=1
AC_MSG_RESULT([yes])
CC="gcc"
CFLAGS="-g -Wall"
CXX="g++"
CXXFLAGS="-g -Wall"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_PPC_XLC_FLAGS=0
AC_MSG_CHECKING([preset xlC for PPC with optimization flags ])
if test "$with_ppc_xlc" = "yes"; then
WANT_PPC_XLC_FLAGS=1
AC_MSG_RESULT([yes])
CC="xlc_r"
CFLAGS="-O4 -qinlglue -qcache=auto -qarch=auto -qtune=auto -DNDEBUG"
CXX="xlC_r"
CXXFLAGS="-O3 -qstaticinline -qfloat=rsqrt:fltint -qstrict -Q -qmaxmem=-1 -qcache=auto -qarch=auto -qtune=auto -qrtti=dyna -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_PPC_XLC_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset xlC for PPC with debugging flags ])
if test "$with_ppc_xlc_debug" = "yes"; then
WANT_PPC_XLC_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="xlc_r"
CFLAGS=""
CXX="xlC_r"
CXXFLAGS=""
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_AIX_XLC_FLAGS=0
AC_MSG_CHECKING([preset xlC for AIX with optimization flags ])
if test "$with_aix_xlc" = "yes"; then
WANT_AIX_XLC_FLAGS=1
AC_MSG_RESULT([yes])
CC="xlc_r"
CFLAGS="-O4 -qinlglue -qcache=auto -qarch=auto -qtune=auto -DNDEBUG"
CXX="xlC_r"
CXXFLAGS="-O3 -qstaticinline -qfloat=rsqrt:fltint -qstrict -Q -qmaxmem=-1 -qcache=auto -qarch=auto -qtune=auto -qrtti=dyna -DNDEBUG"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_AIX_XLC_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset xlC for AIX with debugging flags ])
if test "$with_aix_xlc_debug" = "yes"; then
WANT_AIX_XLC_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="xlc_r"
CFLAGS=""
CXX="xlC_r"
CXXFLAGS="-qrtti=dyna"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([preset xlC for AIX with MPI and optimization flags ])
WANT_AIX_XLC_MPI_FLAGS=0
if (test "$with_aix_xlc_mpi" = "yes" || ((test $use_preset = 0) && test $CXX = "mpCC_r")) then
WANT_AIX_XLC_MPI_FLAGS=1
AC_MSG_RESULT([yes])
CC="mpcc_r"
CFLAGS="-O4 -qinlglue-qcache=auto -qarch=auto -qtune=auto -DNDEBUG $mpi_flags"
CXX="mpCC_r"
CXXFLAGS="-O3 -qstaticinline -qfloat=rsqrt:fltint -qstrict -Q -qmaxmem=-1 -qcache=auto -qarch=auto -qtune=auto -qrtti=dyna -DNDEBUG $mpi_flags"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
WANT_AIX_XLC_MPI_DEBUG_FLAGS=0
AC_MSG_CHECKING([preset xlC for AIX with MPI and debugging flags ])
if test "$with_aix_xlc_mpi_debug" = "yes"; then
WANT_AIX_XLC_MPI_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="mpcc_r"
CFLAGS="-g $mpi_flags"
CXX="mpCC_r"
CXXFLAGS="-g -qrtti=dyna $mpi_flags"
LIBS="-lm -lnsl"
DEPFLAGS=""
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([preset aCC for HPUX with optimization flags ])
WANT_HPUX_CC_FLAGS=0
if (test "$with_hpux_cc" = "yes" || ((test $use_preset = 0) && test $CXX = "aCC")) then
WANT_HPUX_CC_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="+Z +DD64 -fast -DNDEBUG"
CXX="aCC"
CXXFLAGS="+Z +DD64 +O2 +Oaggressive +noeh -AA +W67,829,336 -DNDEBUG"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([preset aCC for HPUX with debugging flags ])
WANT_HPUX_CC_DEBUG_FLAGS=0
if test "$with_hpux_cc_debug" = "yes"; then
WANT_HPUX_CC_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="cc"
CFLAGS="+DD64 +Z -g1"
CXX="aCC"
CXXFLAGS="+DD64 +Z -AA -g1 +W67,829,336"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([preset aCC for HPUX with MPI and optimization flags ])
WANT_HPUX_CC_MPI_FLAGS=0
if test "$with_hpux_cc_mpi" = "yes"; then
unset CC
unset CXX
WANT_HPUX_CC_MPI_FLAGS=1
AC_MSG_RESULT([yes])
CC="mpicc"
CFLAGS="+Z +DD64 -fast -DNDEBUG $mpi_flags"
AC_LANG(C++)
AC_PROG_CXX([mpiCC mpicxx mpic++])
CXXFLAGS="+Z +DD64 +O2 +Oaggressive +noeh -AA +W67,829,336 -DNDEBUG $mpi_flags"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([preset aCC for HPUX with MPI and debugging flags ])
WANT_HPUX_CC_MPI_DEBUG_FLAGS=0
if test "$with_hpux_cc_mpi_debug" = "yes"; then
unset CC
unset CXX
WANT_HPUX_CC_MPI_DEBUG_FLAGS=1
AC_MSG_RESULT([yes])
CC="mpicc"
CFLAGS="+DD64 +Z -g1 $mpi_flags"
AC_LANG(C++)
AC_PROG_CXX([mpiCC mpicxx mpic++])
CXXFLAGS="+DD64 +Z -AA -g1 +W67,829,336 $mpi_flags"
LIBS="-lm -lnsl"
else
AC_MSG_RESULT([no])
fi
AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
AC_SUBST(DEPFLAGS)
echo ""
echo "CC : $CC"
echo "CFLAGS : $CFLAGS"
echo "CXXFLAGS : $CXXFLAGS"
echo "CXX : $CXX"
echo "CXXCPP : $CXXCPP"
echo "LIBS : $LIBS"
echo "CPP : $CPP"
echo "CPPFLAGS : $CPPFLAGS"
echo ""
#
# Tools
#
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
have_mpi=false
case $CXXFLAGS in
*-DHAVE_MPI*) have_mpi=true;;
esac
AC_MSG_CHECKING([using MPI])
if test $have_mpi = false; then
AC_MSG_RESULT([no]);
else
AC_MSG_RESULT([yes]);
fi
AC_PATH_X
AC_PATH_XTRA
save_libs=$LIBS
save_cflags=$CFLAGS
save_cppflags=$CPPFLAGS
save_ldflags=$LDFLAGS
save_cxxflags=$CXXFLAGS
#save_cxxflags="$save_cxxflags -DTEMPLATE_IN_HEADER"
#
# limits
#
have_no_limits=false
AC_MSG_CHECKING(for limits )
AC_TRY_COMPILE(
[
#include <limits>
],
[
],
have_no_limits=true)
if test $have_no_limits = false; then
save_cxxflags="$save_cxxflags -DHAVE_NO_LIMITS"
AC_MSG_RESULT([no]);
else
AC_MSG_RESULT([yes]);
fi
#
# sstream
#
have_no_sstream=false
AC_MSG_CHECKING(for sstream )
AC_TRY_COMPILE(
[
#include <sstream>
],
[
],
have_no_sstream=true)
if test $have_no_sstream = false; then
save_cxxflags="$save_cxxflags -DHAVE_NO_SSTREAM"
AC_MSG_RESULT([no]);
else
AC_MSG_RESULT([yes]);
fi
#
# partial_template_specialization
#
partial_template_specialization=false
AC_MSG_CHECKING(for partial template specialization)
AC_TRY_COMPILE(
[
#include "framework/base/Array_Fastest.h"
using namespace ProtoMol;
],
[
Array<int,3> a(ArraySizes(1)(1)(1));
RefArray<int,2> rA = a[0];
],
partial_template_specialization=true)
if test $partial_template_specialization = false; then
save_cxxflags="$save_cxxflags -DNO_PARTIAL_TEMPLATE_SPECIALIZATION"
AC_MSG_RESULT([no]);
else
AC_MSG_RESULT([yes]);
fi
#
# Socket
#
have_socket=true
AC_CHECK_LIB(socket,socket,,[have_socket=false])
if test $have_socket = true; then
SOCKET_LIBS="-lsocket"
fi
AC_SUBST(SOCKET_LIBS)
have_socket=true
AC_CHECK_HEADER(sys/socket.h,,[have_socket=false])
AC_MSG_CHECKING(for socketlen type)
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
],
[ sockaddr_in addr;
socklen_t len = 0;
getsockname(0, (struct sockaddr*)&addr, &len);
],
SOCKLEN_TYPE=socklen_t)
if test "${SOCKLEN_TYPE}" = "" ; then
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
],
[ sockaddr_in addr;
size_t len = 0;
getsockname(0, (struct sockaddr*)&addr, &len);
],
SOCKLEN_TYPE=size_t)
fi
if test "${SOCKLEN_TYPE}" = "" ; then
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
],
[ sockaddr_in addr;
unsigned int len = 0;
getsockname(0, (struct sockaddr*)&addr, &len);
],
SOCKLEN_TYPE="unsigned int")
fi
if test "${SOCKLEN_TYPE}" = "" ; then
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
],
[ sockaddr_in addr;
int len = 0;
getsockname(0, (struct sockaddr*)&addr, &len);
],
SOCKLEN_TYPE="int")
fi
if test "${SOCKLEN_TYPE}" != "" ; then
AC_MSG_RESULT($SOCKLEN_TYPE)
fi
AC_DEFINE_UNQUOTED(SOCKLEN_TYPE, ${SOCKLEN_TYPE}, [Socket lenght.])
#
# Sizeof
#
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(void*)
SIZEOF_INT=$ac_cv_sizeof_int
SIZEOF_SHORT=$ac_cv_sizeof_int
AC_MSG_CHECKING(for 32-bit int)
if test "${SIZEOF_INT}" = 4; then
INT32_TYPE=int
elif test "${SIZEOF_SHORT}" = 4; then
INT32_TYPE=short
else
AC_MSG_ERROR([neither int (${SIZEOF_INT}) nor short (${SIZEOF_SHORT}) have sizeof 4!])
fi
AC_DEFINE_UNQUOTED(INT32_TYPE, ${INT32_TYPE}, [Define for int 32-bit.])
AC_MSG_RESULT($INT32_TYPE)
#
# cycles
#
# comment out if autoconf less then 2.53
AC_C_INLINE
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/time.h c_asm.h intrinsics.h])
AC_CHECK_TYPE([hrtime_t],[AC_DEFINE(HAVE_HRTIME_T, 1, [Define to 1 if hrtime_t is defined in <sys/time.h>])],,[#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif])
AC_CHECK_FUNCS([gethrtime clock_gettime])
AC_MSG_CHECKING([for read_real_time])
read_real_time_ok=yes
AC_TRY_COMPILE([#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
],
[
timebasestruct_t t;
read_real_time(&t, TIMEBASE_SZ);
], [AC_DEFINE(HAVE_READ_REAL_TIME,1,[Define if you have the read_real_time().])], [read_real_time_ok=no])
AC_MSG_RESULT($read_real_time_ok)
AC_MSG_CHECKING([for time_base_to_time])
time_base_to_time_ok=yes
AC_TRY_COMPILE([#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
],
[
timebasestruct_t t;
time_base_to_time(&t, TIMEBASE_SZ);
], [AC_DEFINE(HAVE_TIME_BASE_TO_TIME,1,[Define if you have the time_base_to_time().])], [time_base_to_time_ok=no])
AC_MSG_RESULT($time_base_to_time_ok)
#AC_MSG_CHECKING([for rtc])
#rtc_ok=yes
#AC_TRY_COMPILE([], [], [AC_DEFINE(HAVE_RTC,1,[Define if you have the rtc().])], [rtc_ok=no])
#AC_MSG_RESULT($rtc_ok)
dnl Cray UNICOS _rtc() (real-time clock) intrinsic
AC_MSG_CHECKING([for _rtc intrinsic])
rtc_ok=yes
AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H
#include <intrinsics.h>
#endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no])
AC_MSG_RESULT($rtc_ok)
# -------------------------------------------------------------------------- #
# CHECKPOINTING - Boost
# -------------------------------------------------------------------------- #
BOOST_LIBS=""
BOOST_CFLAGS=""
if( test x"$with_boost" != x ) then
LIBS=$save_libs
CFLAGS=$save_cflags
CPPFLAGS=$save_cppflags
if( test x"$with_boost/include" != x &&
test x"$with_boost/lib" != x ) then
BOOST_INCLUDE_DIR="-I$with_boost/include"
BOOST_LIB_DIR="-L$with_boost/lib"
else
BOOST_INCLUDE_DIR="-I$with_boost_dir"
BOOST_LIB_DIR="-L$with_boost_dir"
fi
LIBS="$BOOST_LIB_DIR"
CFLAGS="$CFLAGS $BOOST_INCLUDE_DIR"