-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
2184 lines (1768 loc) · 73.7 KB
/
configure.ac
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.
# Initialise autoconfigure: Pass package name, version number and contact email
AC_INIT([oomph-lib],[0.90],[[email protected]])
# config header file
AC_CONFIG_HEADERS(config.h)
# Intialise automake (AM_INIT_AUTOMAKE) using the command specified in this
# file. This is necessary so that we can select different options for
# different versions of automake (newer automake versions are not
# backwards compatible!).
m4_include([config/configure.ac_scripts/automake_init_command_file])
# Checks for programs:
#---------------------
# C++ compiler
AC_PROG_CXX
# C compiler
AC_PROG_CC
# C preprocessor
AC_PROG_CPP
# F77 compiler
AC_PROG_F77
AC_PROG_FC
# Install
AC_PROG_INSTALL
# Create symbolic links
AC_PROG_LN_S
# awk
AC_PROG_AWK
# Sets make macro
AC_PROG_MAKE_SET
# LIBTOOL
AC_PROG_LIBTOOL
# Determine linker flags for fortran
AC_F77_LIBRARY_LDFLAGS
if test -z $ac_cv_prog_f77_v; then
echo "==================================================================="
echo "Empty verbose linking string."
echo "It is likely that the compilation has failed."
echo "Either the Fortran compiler has not been found or it doesn't work"
echo "If your Fortran compiler is in a non-standard location"
echo "please specify by setting the variable F77=/path/to/fortran_compiler"
echo "in your configuration file or as an environment variable."
echo "The value of F77 found used here was $F77"
echo "===================================================================="
exit
fi
# Defined the no-optimisation environment flag for use in oomph_flapack
AC_ARG_VAR([FFLAGS_NO_OPT],[Fortran compiler flags without optimisation])
# Set additional flags for C++ compilation:
#------------------------------------------
# cfortran stuff:
case "$G77" in
yes)
#Test the version number by writing compiling and running
#a small test C++ program
#If the version number is different for the c-compiler and the
#fortran compiler then we're in real trouble!
cat > version_test.cc << EOF
#include<iostream>
int main() {if(__GNUC__ > 3) {std::cout << "yes";}else{std::cout << "no";}}
EOF
$CXX version_test.cc
gcc_version4=`./a.out`
rm ./a.out version_test.cc
if test "$gcc_version4" = yes; then
echo "GNU Compilers > v 4.0, linking with -DgFortran"
AM_CXXFLAGS='-DgFortran'
else
echo "GNU Compilers < v 4.0, linking with -Df2cFortran"
AM_CXXFLAGS='-Df2cFortran'
fi
;;
no)
echo "========================================================"
echo "Not using GNU compiler suite"
echo "You must specify a flag for cfortran.h"
echo "in the CXXFLAGS of your config file."
echo "e.g. -DINTEL_COMPILER for the Intel suite of compilers"
echo "See cfortran.h documentation for further details"
echo "========================================================"
;;
esac
#case "$F77 " in
# *gfortran*)
# AM_CXXFLAGS='-DgFortran'
# AM_FFLAGS=' '
# ;;
# *ifort*)
# AM_CXXFLAGS='-DINTEL_COMPILER'
# AM_FFLAGS=' '
# ;;
# *[[A-Za-z0-9]]*)
# AM_CXXFLAGS='-Df2cFortran'
# AM_FFLAGS=' '
# ;;
# *)
# echo "==================================================";
# echo "Fortran compiler not found. ";
# echo "If your Fortran compiler is in a non-standard location"
# echo "please specify by setting the variable F77=/path/to/fortran_compiler"
# echo "in your configuration file or as an environment variable."
# echo "==================================================";
# exit
# ;;
#esac
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_FFLAGS)
# Prepare variable that can be used to drag along C++ compilation
# flags
accumulated_cpp_flags=''
#...........................................................................
# Start of commands suggested by autoscan.
#
# Andrew: Will need to re-run autoscan on the
# full set of sources *and* decide on what to do if headers are not found.
# This is where the real work starts on making the code portable, I suppose.
# At the moment we simply bail out...
# Checks for header files.
#
# Note: old version was
#
# AC_CHECK_HEADERS([limits.h stdlib.h string.h sys/time.h malloc.h],
#
# but malloc.h doesn't exist on BSD Linux. Since malloc.h was only suggested
# by autoscan, I've experimentally taken it out to see if this breaks
# anything under GNU< Linux (MH 12/01/2007)
#
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h sys/time.h],
[echo "Congratulations -- required headers were found";],
[echo "==================================================";
echo "Trouble -- missing header[s]! ";
echo "==================================================";
exit])
#Check for the execinfo header
AC_CHECK_HEADER(execinfo.h,[have_execinfo=true;
echo "Can use stacktrace in debugging";],
[have_execinfo=false;
echo "Can't use stacktrace in debugging";])
# Pass result of test to automake (makefiles can now check for
# status of HAVE_STACKTRACE in any Makefile.am:
AM_CONDITIONAL(HAVE_STACKTRACE, test x$have_execinfo = xtrue)
# Add flag (don't use the obvious HAVE_STACKTRACE as this is used by
# other packages too and leads to clashes!)
if test x$have_execinfo = xtrue; then \
accumulated_cpp_flags=`echo $accumulated_cpp_flags " -DOOMPH_HAS_STACKTRACE"`; \
fi;
#Check for the unistd.h header (needed for getpid() in memory monitoring)
AC_CHECK_HEADER(unistd.h,[have_unistdh=true;
echo "Found unistd.h -- can do memory monitoring";],
[have_unistdh=false;
echo "Didn't find unistd.h -- cannot do memory monitoring";])
# Pass result of test to automake (makefiles can now check for
# status of HAVE_UNISTDH in any Makefile.am:
AM_CONDITIONAL(HAVE_UNISTDH, test x$have_unistdh = xtrue)
# Add flag (don't use the obvious HAVE_UNISTDH as this is used by
# other packages too and leads to clashes!)
if test x$have_unistdh = xtrue; then \
accumulated_cpp_flags=`echo $accumulated_cpp_flags " -DOOMPH_HAS_UNISTDH"`; \
fi;
# Does C compiler support const?
AC_C_CONST
# Something to do with a stdbool.h header file. Don't quite understand
# the significance; see
# http://web.umr.edu/~gnudoc/single/autoconf-2.5.7/autoconf.html
# for full(er) description and suggested action.
AC_HEADER_STDBOOL
# Does the C compiler support inlining?
AC_C_INLINE
# If size_t is not defined, define size_t to be unsigned
AC_TYPE_SIZE_T
#If pid_t is not defined, define pid_t to be int.
AC_TYPE_PID_T
# Hmm, including this produces warnings during ./configure because
# RANLIB is made obsolete by LIBTOOL. You can either keep in here (in which
# case autoscan doesn't complain) or comment it out (in which case
# you should ignore the warnings in autoscan).
#AC_PROG_RANLIB
# Only needed by matlab part of superlu -- ignore when
# autoscan flags this up...
#AC_FUNC_ERROR_AT_LINE
# Something to do with the way Gnu C handles malloc -- see
# http://web.umr.edu/~gnudoc/single/autoconf-2.5.7/autoconf.html
# Only an issue in external C code (Superlu)
AC_FUNC_MALLOC
# autoscan suggests I should check for these functions. autoconf doesn't
# seem to be able to find them but this causes no problem --> ?
#AC_CHECK_FUNCS([floor pow gethrtime sqrt memchr memset],
# [echo "Congratulations -- required function was found";],
# [echo "==================================================";
# echo "Trouble -- missing function! ";
# echo "==================================================";
# exit])
# END OF COMMANDS SUGGESTED BY autoscan
#...........................................................................
# Cray hack: Static C++ libraries
#--------------------------------
AC_ARG_ENABLE(static-cxx-libs,
[ --enable-static-cxx-libs Pass -all-static to CXX when used as linker (needed when using gnu complier on Crays)],
[want_static_cxx_libs=true],
[want_static_cxx_libs=false])
if test x$want_static_cxx_libs = xtrue; then
AC_SUBST([CXXLD], ['$(CXX) -all-static'])
echo "Using -all-static flag for CXX linker"
else
AC_SUBST([CXXLD], ['$(CXX)'])
echo "Not using -all-static flag for CXX linker"
fi
# Do we have (a sufficiently recent version of) doxygen installed?
#-----------------------------------------------------------------
AC_CHECK_PROG(have_doxygen,doxygen,true,false)
if test x$have_doxygen = xfalse; then \
echo " "; \
echo "===================================================="; \
echo "Cannot find doxygen on your system"; \
echo "---> documentation cannot be generated. "; \
echo " "; \
echo "You can either obtain the (built) oomph-lib "; \
echo "documentation online at "; \
echo " "; \
echo " http://www.oomph-lib.org/ "; \
echo " "; \
echo "or download doxygen from "; \
echo " "; \
echo " http://www.doxygen.org/ "; \
echo " "; \
echo "===================================================="; \
echo " "; \
else \
# Convert doxygen version number into single int -- strip dots and
# accomodate up to three digits for each part version id
doxygen_version=`doxygen --version | \
$AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
# Need at least version 1.3.4 --> 1003004
if test "$doxygen_version" -ge 1003004; then
echo "Congratulations!"
echo "I have located a (sufficiently) up-to-date version of doxygen:" \
`doxygen --version`
echo "and can build the documentation."
else
echo " "; \
echo "==============================================================="; \
echo "Trouble: Your version of doxygen is: " `doxygen --version`
echo "Please upgrade to version 1.3.4 or higher."
echo " "; \
echo " http://www.doxygen.org/ "; \
echo " "; \
echo "I cannot build the documentation..."
echo " "; \
echo "Meanwhile you can obtain the built oomph-lib documentation from"; \
echo " "; \
echo " http://www.oomph-lib.org/ "; \
echo " "; \
echo "==============================================================="; \
echo " "; \
have_doxygen=false
fi
fi
AM_CONDITIONAL(HAVE_DOXYGEN, test x$have_doxygen = xtrue)
# Do we have triangle installed online?
#---------------------------------------
AC_CHECK_PROG(have_online_triangle,triangle,true,false)
if test x$have_online_triangle = xfalse; then \
echo " "; \
echo "===================================================="; \
echo "Cannot find triangle on your system"; \
echo "---> cannot run fig2poly test. "; \
echo " "; \
echo "The source code for triangle may be obtained from "; \
echo " "; \
echo " http://www.cs.cmu.edu/~quake/triangle.html "; \
echo " "; \
echo "Please ask your systems administrator to install it "; \
echo "on your machine. "; \
echo " "; \
echo "NOTE: Maybe you do have triangle installed in an "; \
echo "unusual place -- installing a symbolic link from"; \
echo "a directory in the normal search path to your actual "; \
echo "installation should then all that's required. "; \
echo "===================================================="; \
echo " "; \
else \
echo "Congratulations! I have located triangle and can test the "; \
echo "triangle-based mesh generation procedures."; \
fi
AM_CONDITIONAL(HAVE_ONLINE_TRIANGLE, test x$have_online_triangle = xtrue)
# Do we have tetgen installed?
#-------------------------------
AC_CHECK_PROG(have_tetgen,tetgen,true,false)
if test x$have_tetgen = xfalse; then \
echo " "; \
echo "===================================================="; \
echo "Cannot find tetgen on your system"; \
echo " "; \
echo "The source code for tetgen may be obtained from "; \
echo " "; \
echo " http://tetgen.berlios.de/ "; \
echo " or "; \
echo " http://tetgen.org/ "; \
echo " "; \
echo "Please ask your systems administrator to install it "; \
echo "on your machine. "; \
echo " "; \
echo "NOTE: Maybe you do have tetgen installed in an "; \
echo "unusual place -- installing a symbolic link from"; \
echo "a directory in the normal search path to your actual "; \
echo "installation should then all that's required. "; \
echo "===================================================="; \
echo " "; \
else \
echo "Congratulations! I have located tetgen and can test the "; \
echo "tetgen-based mesh generation procedures."; \
fi
AM_CONDITIONAL(HAVE_TETGEN, test x$have_tetgen = xtrue)
# Suppress build of pdf-based documentation?
# If yes, run configure as './configure --enable-suppress-pdf-doc'
AC_ARG_ENABLE(suppress-pdf-doc,
[ --enable-suppress-pdf-doc Suppress building of oomph-lib's doxygen-based pdf documentation],
[want_pdf_doc=false],
[want_pdf_doc=true])
# Do we have pdflatex installed?
#-------------------------------
AC_CHECK_PROG(have_pdf_latex,pdflatex,true,false)
if test x$have_pdf_latex = xfalse; then \
echo " "; \
echo "===================================================="; \
echo "Cannot find pdflatex on your system"; \
echo "---> latex documentation cannot be generated. "; \
echo " "; \
echo "You can either lookup the documentation online at "; \
echo " "; \
echo " http://www.oomph-lib.org/ "; \
echo " "; \
echo "or ask your systems administrator to install pdflatex "; \
echo "on your machine. "; \
echo " "; \
echo "NOTE: Maybe you do have pdflatex installed in an "; \
echo "unusual place -- installing a symbolic link from"; \
echo "a directory in the normal search path to your actual "; \
echo "installation should then all that's required. "; \
echo "===================================================="; \
echo " "; \
else \
echo "Congratulations! I have located pdflatex and can build the "; \
echo "latex documentation in the doc directory."; \
if test x$want_pdf_doc = xfalse; then \
echo "BUILDING OF PDF DOC SUPPRESSED VIA CONFIGURE FLAG!"; \
have_pdf_latex=false; \
fi \
fi
echo "have_pdf_latex $have_pdf_latex"
AM_CONDITIONAL(HAVE_PDF_LATEX, test x$have_pdf_latex = xtrue)
# Do we have python installed?
#-----------------------------
AC_CHECK_PROG(have_python,python,true,false)
if test x$have_python = xfalse; then \
echo " "; \
echo "================================================================="; \
echo "Cannot find python on your system"; \
echo "---> Will not be able to check the accuracy of "; \
echo " the self tests with bin/fpdiff.py :( "; \
echo " "; \
echo "Please get your system administrator to install python for you. "; \
echo " "; \
echo "=================================================================="; \
echo " "; \
else \
echo "Congratulations! I have located python."; \
fi
AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xtrue)
# Do we have validata?
#---------------------
AC_CHECK_FILES(demo_drivers/poisson/two_d_poisson_flux_bc_adapt/validata/results.dat.gz,
echo "Found validata"; have_validata=true,
echo "Not found validata"; have_validata=false)
if test x$have_validata = xfalse; then \
echo " "; \
echo "================================================================="; \
echo "This distribution does not seem to have validata"; \
echo "(based on existence of demo_drivers/poisson/two_d_poisson_flux_bc_adapt/validata/results.dat.gz)"; \
echo "---> Will not be able to check the accuracy of "; \
echo " the self tests with bin/fpdiff.py :( "; \
echo " "; \
echo "=================================================================="; \
echo " "; \
else \
echo "This distribution does seem to have validata."; \
echo "(based on existence of demo_drivers/poisson/two_d_poisson_flux_bc_adapt/validata/results.dat.gz)"; \
fi
AM_CONDITIONAL(HAVE_VALIDATA, test x$have_validata = xtrue)
# Can we compare against validata?
#---------------------------------
compare_against_validata=false;
if test x$have_python = xtrue; then \
if test x$have_validata = xtrue; then \
compare_against_validata=true; \
fi \
fi
if test x$compare_against_validata = xtrue; then \
echo "Will compare against validata "; \
else \
echo "Will not compare against validata "; \
fi
AM_CONDITIONAL(COMPARE_AGAINST_VALIDATA, test x$compare_against_validata = xtrue)
# Do we have the sources for the HSL frontal solver in external_src?
#-------------------------------------------------------------------
AC_CHECK_FILES(external_src/oomph_hsl/frontal.f,
echo "Found external_src/oomph_hsl/frontal.f"; have_hsl_sources=true,
echo "Not found external_src/oomph_hsl/frontal.f"; have_hsl_sources=false)
#If we don't have them check if they are private/external_src and make sym link
#------------------------------------------------------------------------------
if test x$have_hsl_sources = xfalse; then \
AC_CHECK_FILES(private/external_src/hsl/frontal.f,
echo "Found private/external_src/hsl/frontal.f"; have_hsl_sources_in_private_external_src=true,
echo "Not found private/external_src/hsl/frontal.f"; have_hsl_sources_in_private_external_src=false)
if test x$have_hsl_sources_in_private_external_src = xtrue; then \
echo "Making symlink"; \
ln -s ../../private/external_src/hsl/frontal.f external_src/oomph_hsl/frontal.f;\
have_hsl_sources=true;\
else \
echo "Not making symlink";\
fi; \
fi;
# Now do the final check if we have the sources for the HSL frontal solver
#-------------------------------------------------------------------------
AM_CONDITIONAL(HAVE_HSL_SOURCES, test x$have_hsl_sources = xtrue)
# Do we have the sources for the ARPACK Arnoldi solver?
#---------------------------------------------------
AC_CHECK_FILES(external_src/oomph_arpack/all_arpack_sources.f,
echo "Found external_src/oomph_arpack/all_arpack_sources.f"; have_arpack_sources=true,
echo "Not found external_src/oomph_arpack/all_arpack_sources.f"; have_arpack_sources=false)
#If we don't have them check if they are private/external_src and make sym link
#------------------------------------------------------------------------------
if test x$have_arpack_sources = xfalse; then \
AC_CHECK_FILES(private/external_src/arpack/all_arpack_sources.f,
echo "Found private/external_src/arpack/all_arpack_sources.f"; have_arpack_sources_in_private_external_src=true,
echo "Not found private/external_src/arpack/all_arpack_sources.f"; have_arpack_sources_in_private_external_src=false)
if test x$have_arpack_sources_in_private_external_src = xtrue; then \
echo "Making symlink"; \
ln -s ../../private/external_src/arpack/all_arpack_sources.f external_src/oomph_arpack/all_arpack_sources.f;\
have_arpack_sources=true;\
else \
echo "Not making symlink";\
fi; \
fi;
AM_CONDITIONAL(HAVE_ARPACK_SOURCES, test x$have_arpack_sources = xtrue)
AM_CONDITIONAL(WANT_EIGENPROBLEM_TESTS, test x$have_arpack_sources = xtrue)
# Build flags that can be set during configure stage
#---------------------------------------------------
# Dummies to produce better output for ./configure --help
AC_ARG_ENABLE(dummy1,[ ])
AC_ARG_ENABLE(dummy2,[Oomph-lib options: ])
# Is MPI build required?
# If yes, run configure as './configure --enable-MPI'
AC_ARG_ENABLE(MPI,
[ --enable-MPI Build oomph-lib MPI routines],
[want_mpi=true],
[want_mpi=false])
# Pass result of test to automake (makefiles can now check for
# status of WANT_MPI in any Makefile.am, like this:
#
# # WANT_MPI flag is set by autoconf
# #---------------------------------
# if WANT_MPI
# SUBDIRS = $(non_mpi_sub_dirs) $(mpi_sub_dirs)
# else
# SUBDIRS = $(non_mpi_sub_dirs)
# endif
#
AM_CONDITIONAL(WANT_MPI, test x$want_mpi = xtrue)
# Add flag (don't use the obvious HAVE_MPI as this is used by
# other packages too and leads to clashes!)
if test x$want_mpi = xtrue; then \
accumulated_cpp_flags=`echo $accumulated_cpp_flags " -DOOMPH_HAS_MPI"`; \
fi;
# Do we want to run the mpi tests?
AC_ARG_WITH(mpi-self-tests,
[ --with-mpi-self-tests[=MPI_RUN_COMMAND] run mpi self-tests on two processors
using MPI_RUN_COMMAND. E.g. if a parallel executable
on your machine needs to be run with
mpirun -np 2 a.out
then set MPI_RUN_COMMAND to "mpirun -np 2"],[
if test "$withval" != "no" -a "$withval" != "yes"; then
run_mpi_self_tests=true
MPI_RUN_COMMAND=$withval
fi
])
AC_SUBST(MPI_RUN_COMMAND)
# Do we want to run the mpi self tests which involves more than two cores?
AC_ARG_WITH(mpi-self-tests-variablenp,
[ --with-mpi-self-tests-variablenp[=MPI_VARIABLENP_RUN_COMMAND] run mpi self-tests on multiple processors
using MPI_VARIABLENP_RUN_COMMAND. E.g. if a parallel executable
on your machine needs to be run with
mpirun -np 2 a.out
then set MPI_VARIABLENP_RUN_COMMAND to "mpirun -np OOMPHNP"],[
if test "$withval" != "no" -a "$withval" != "yes"; then
run_mpi_self_tests_variablenp=true
MPI_VARIABLENP_RUN_COMMAND=$withval
fi
],[run_mpi_self_tests_variablenp=false])
# Perform the substitution
AC_SUBST(MPI_VARIABLENP_RUN_COMMAND)
# # WANT_MPI_VARIABLENP flag is set by autoconf
# #---------------------------------
# if WANT_MPI_VARIABLENP
# SUBDIRS = $(non_mpi_variablenp_sub_dirs) $(mpi_variablenp_sub_dirs)
# else
# SUBDIRS = $(non_mpi_variablenp_sub_dirs)
# endif
AM_CONDITIONAL(WANT_MPI_VARIABLENP, test x$run_mpi_self_tests_variablenp = xtrue)
# Do we need multiple teuchos sub-libraries
AC_ARG_ENABLE(multiple_teuchos_libraries,
[ --enable-multiple_teuchos_libraries Assume that the
version of trilinos
provides multiple
teuchos (sub-)libraries],
[multiple_teuchos_libs_requested=true],
[multiple_teuchos_libs_requested=false])
# Suppress build of extensive documentation?
# If yes, run configure as './configure --enable-suppress-doc'
AC_ARG_ENABLE(suppress-doc,
[ --enable-suppress-doc Suppress building of oomph-lib's doxygen-based documentation],
[want_doc=false],
[want_doc=true])
#If the doc directory does not exist, then you can't have it
AC_CHECK_FILE(doc,[],[want_doc=false])
# Pass result of test to automake (makefiles can now check for
# status of WANT_DOC in any Makefile.am
AM_CONDITIONAL(WANT_DOC, test x$want_doc = xtrue)
# Suppress extended self-tests?
# If yes, run configure as './configure --enable-suppress-extended-self-tests'
AC_ARG_ENABLE(suppress-extended-self_tests,
[ --enable-suppress-extended-self-tests Suppress build/running of oomph-lib's extended self tests for all libraries],
[want_extended_self_tests=false],
[want_extended_self_tests=true])
# Pass result of test to automake (makefiles can now check for
# status of WANT_DOC in any Makefile.am
AM_CONDITIONAL(WANT_EXTENDED_SELF_TESTS, test x$want_extended_self_tests = xtrue)
# Suppress build of extensive demo codes?
# If yes, run configure as './configure --enable-suppress-demo'
AC_ARG_ENABLE(suppress-demo,
[ --enable-suppress-demo Suppress build/check of oomph-lib's demo codes],
[want_demo=false],
[want_demo=true])
# Pass result of test to automake (makefiles can now check for
# status of WANT_DEMO in any Makefile.am
AM_CONDITIONAL(WANT_DEMO, test x$want_demo = xtrue)
# Suppress build of user sources/libraries?
# If yes, run configure as './configure --enable-suppress-user-src'
AC_ARG_ENABLE(suppress-user-src,
[ --enable-suppress-user-src Suppress build/check of user sources/libraries],
[want_user_src=false],
[want_user_src=true])
# Pass result of test to automake (makefiles can now check for
# status of WANT_USER_SRC in any Makefile.am
AM_CONDITIONAL(WANT_USER_SRC, test x$want_user_src = xtrue)
# Replace include files by links?
# If yes, run configure as './configure --enable-symbolic_links_for_headers'
AC_ARG_ENABLE(symbolic-links-for-headers,
[ --enable-symbolic-links-for-headers Use symbolic links for header files; useful during development],
[want_sym_link=true],
[want_sym_link=false])
# Pass result of test to automake (makefiles can now check for
# status of SYMBOLIC_LINKS_FOR_HEADERS in any Makefile.am
AM_CONDITIONAL(SYMBOLIC_LINKS_FOR_HEADERS, test x$want_sym_link = xtrue)
# Link gfortran libraries when building oomph_flapack library
# This is a workaround to a problem with the latest versions of
# gfortran (ubuntu13.10 -- seems like a bug to use so we're not
# hardcoding it here..
# Run configure with './configure --enable_use_gfortran_libraries_for_oomph_flapack'
AC_ARG_ENABLE(use-gfortran-libraries-for-oomph-flapack,
[ --enable-use-gfortran-libraries-for-oomph-flapack Link gfortran libraries when building oomph_flapack library (workaround for ubuntu 13.10 feature(bug?)],
[use_gfortran_libraries_for_oomph_flapack=true],
[use_gfortran_libraries_for_oomph_flapack=false])
# Pass result of test to automake (makefiles can now check for
# status of ADD_LGFORTRAN_TO_OOMPH_LAPACK in any Makefile.am
AM_CONDITIONAL(ADD_LGFORTRAN_TO_OOMPH_LAPACK, test x$use_gfortran_libraries_for_oomph_flapack = xtrue)
# Auto-detect directories in private/*
# -----------------------------------------------------------------------
# This information is used in "Makefile.am"s within private/ to include
# directories from private/ when running `make dist`. In particular it has
# nothing to do with the creation of Makefile s by configure.
# Do we have private directory?
AC_CHECK_FILES(private,
echo "Found private"; have_private_directory=true,
have_private_directory=false)
AM_CONDITIONAL(HAVE_PRIVATE_DIRECTORY, test x$have_private_directory = xtrue)
# Define subdirectories in private directory
if test x$have_private_directory = xtrue; then \
PRIVATE_DIR="private"; \
# A hack to exclude the private/external_src directory from DIST_SUBDIRS
# (it's handled by EXTRA_DIST)
PRIVATE_SUBDIRECTORIES=`cd private/ && echo */ | tr ' ' '\n' | grep -v 'external_src' | tr '\n' ' '`; \
echo "Do have private subdirectories" $PRIVATE_SUBDIRECTORIES; \
else \
PRIVATE_DIR="";\
PRIVATE_SUBDIRECTORIES=""; \
echo "Don't have private subdirectories: " $PRIVATE_SUBDIRECTORIES; \
fi;
AC_SUBST(PRIVATE_DIR)
AC_SUBST(PRIVATE_SUBDIRECTORIES)
# Do we have private user sources?
AC_CHECK_FILES(private/user_src,
echo "Found private/user_src"; have_private_user_sources=true,
have_private_user_sources=false)
AM_CONDITIONAL(HAVE_PRIVATE_USER_SRC, test x$have_private_user_sources = xtrue)
# Define subdirectories in private user src directory
if test x$have_private_user_sources = xtrue; then \
PRIVATE_USER_SRC_SUBDIRECTORIES=`cd private/user_src/ && echo */`
echo "Do have private/user_src: " $PRIVATE_USER_SRC_SUBDIRECTORIES; \
else \
PRIVATE_USER_SRC_SUBDIRECTORIES=""; \
echo "Don't have private/user_src: " $PRIVATE_USER_SRC_SUBDIRECTORIES; \
fi;
AC_SUBST(PRIVATE_USER_SRC_SUBDIRECTORIES)
# Do we have private user drivers?
AC_CHECK_FILES(private/user_drivers,
echo "Found private/user_drivers"; have_private_user_drivers=true,
have_private_user_drivers=false)
AM_CONDITIONAL(HAVE_PRIVATE_USER_DRIVERS, test x$have_private_user_drivers = xtrue)
# Define subdirectories in private user drivers directory
if test x$have_private_user_drivers = xtrue; then \
PRIVATE_USER_DRIVER_SUBDIRECTORIES=`cd private/user_drivers/ && echo */`
echo "Do have private/user_drivers: " $PRIVATE_USER_DRIVER_SUBDIRECTORIES; \
else \
PRIVATE_USER_DRIVER_SUBDIRECTORIES=""; \
echo "Don't have private/user_drivers: " $PRIVATE_USER_DRIVER_SUBDIRECTORIES; \
fi;
AC_SUBST(PRIVATE_USER_DRIVER_SUBDIRECTORIES)
# Initialiase flags that contains all external libraries that come with
#----------------------------------------------------------------------
# their own distribution and may be installed anywhere.
#------------------------------------------------------
# These are distributed to all Makefile.am-s via the AM_CPPFLAGS
#---------------------------------------------------------------
# and AM_LDFLAGS variables so *everything* links against them
#------------------------------------------------------------
external_dist_libraries=''
external_dist_libraries_lib=''
external_dist_libraries_include=''
#................................................................
#................................................................
#---------------------------------------------------
# Potential location for the blas libraries.
#
# If the complete blas library is available on
# your machine, specify the absolute path to the
# library with --with-blas
#----------------------------------------------------
BLAS_LIB=
check_for_blas=false
AC_ARG_WITH(blas,
[ --with-blas[=ABSOLUTE_PATH] use blas library specified via ABSOLUTE PATH
e.g. /usr/local/lib/blas.a
or specify "auto" (without quotation marks!)
if the library is specified automatically
by your compiler/linker],[
if test "$withval" != "no" -a "$withval" != "yes"; then
check_for_blas=true
BLAS_LIB=$withval
fi
])
# Do they exist?
have_blas=false
if test x$check_for_blas = xtrue; then \
if test -e $BLAS_LIB; then \
have_blas=true; \
echo "Found the blas library "; \
echo " "; \
echo " " $BLAS_LIB ; \
echo " "; \
# Make the variable available to all Makefile.am-s
AC_SUBST(BLAS_LIB)
else \
if test "$BLAS_LIB" == "auto"; then
have_blas=true; \
echo "Will assume that blas library is specified automatically by"; \
echo "compiler/linker."; \
else \
have_blas=false; \
echo "Did NOT find the blas library"; \
echo " "; \
echo " " $BLAS_LIB ; \
echo " "; \
fi; \
fi; \
else \
echo "No blas library specified"; \
fi
#Tell everybody about it...
AM_CONDITIONAL(ALREADY_HAVE_BLAS, test x$have_blas = xtrue)
#................................................................
#................................................................
#---------------------------------------------------
# Potential location for the lapack libraries.
#
# If the complete lapack library is available on
# your machine, specify the absolute path to the
# library with --with-lapack
#----------------------------------------------------
LAPACK_LIB=
check_for_lapack=false
AC_ARG_WITH(lapack,
[ --with-lapack[=ABSOLUTE_PATH] use lapack library specified via ABSOLUTE PATH
e.g. /usr/local/lib/lapack.a
or specify "auto" (without quotation marks!)
if the library is specified automatically
by your compiler/linker],[
if test "$withval" != "no" -a "$withval" != "yes"; then
check_for_lapack=true
LAPACK_LIB=$withval
fi
])
# Do they exist?
have_lapack=false
if test x$check_for_lapack = xtrue; then \
if test -e $LAPACK_LIB; then \
have_lapack=true; \
echo "Found the lapack library "; \
echo " "; \
echo " " $LAPACK_LIB ; \
echo " "; \
# Make the variable available to all Makefile.am-s
AC_SUBST(LAPACK_LIB)
else \
if test "$LAPACK_LIB" == "auto"; then
have_lapack=true; \
echo "Will assume that lapack library is specified automatically by"; \
echo "compiler/linker."; \
else \
have_lapack=false; \
echo "Did NOT find the lapack library"; \
echo " "; \
echo " " $LAPACK_LIB ; \
echo " "; \
fi \
fi; \
else \
echo "No lapack library specified"; \
fi
#Tell everybody about it...
AM_CONDITIONAL(ALREADY_HAVE_LAPACK, test x$have_lapack = xtrue)
#................................................................
#................................................................
#----------------------------------------------------------------
# Allow suppression of oomph-lib's triangle build (there are some subtle
# comiler problems on some machines; if they exist we'd rather bin
# the third-party code rather than endangering the entire oomph-lib
# build
#----------------------------------------------------------------
have_triangle_lib=false
AC_ARG_ENABLE(suppress-triangle,
[ --enable-suppress-triangle Supress build/use of
oomph-lib's own copy of the triangle library. ],
[suppress_triangle=true],
[suppress_triangle=false])
if test x$suppress_triangle = xtrue; then
echo "Suppressing build of oomph-lib's own copy of the triangle library."
echo "This disables a lot of useful functionality but may be"
echo "necessary where the compiler struggles to compile the"
echo "triangle sources. In that case, triangle should be "
echo "installed separately (by whatever method it takes) "
echo "and included in the linker path (similar to the way we handle "
echo "blas and lapack, say), but this hasn't been implemented"
echo "in our build machinery. Please contact the developers if you"
echo "need this..."
else
echo "Building/using oomph-lib's own copy of the triangle library"
fi
#Tell everybody about it...
AM_CONDITIONAL(SUPPRESS_TRIANGLE_LIB, test x$suppress_triangle = xtrue)
# Add flag
if test x$suppress_triangle = xfalse; then \
accumulated_cpp_flags=`echo $accumulated_cpp_flags " -DOOMPH_HAS_TRIANGLE_LIB"`; \
fi;
#................................................................
#----------------------------------------------------------------
# Allow suppression of oomph-lib's tetgen build (there may be subtle
# comiler problems on some machines; if they exist we'd rather bin
# the third-party code rather than endangering the entire oomph-lib
# build
#----------------------------------------------------------------
have_tetgen_lib=false