From fca395fc83701d767d3e541b7c61b1c3d11b4d28 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 8 Jan 2001 08:32:03 +0000 Subject: [PATCH] Add some Fortran checks and the like. git-svn-id: https://svn.dealii.org/trunk@3598 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/Make.global_options.in | 7 + deal.II/configure | 367 +++++++++++++++++------ deal.II/configure.in | 124 +++++++- deal.II/doc/development/Makefile | 5 + deal.II/doc/development/makefiles.1.html | 53 +++- 5 files changed, 450 insertions(+), 106 deletions(-) diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index c16afd41ad..911c08df1a 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -23,6 +23,9 @@ CC = @CC@ CXX = @CXX@ GXX-VERSION = @GXX_VERSION@ LDFLAGS = @LDFLAGS@ +F77 = @F77@ +F77-VERSION = @F77_VERSION@ +F77LDFLAGS = @F77LDFLAGS@ LIBS = @LIBS@ PERL = @PERL@ enable-multithreading= @enablemultithreading@ @@ -82,6 +85,10 @@ INCLUDE += $(addprefix -I, $(include-path-base) \ CXXFLAGS.g = @DEFS@ @CXXFLAGSG@ $(INCLUDE) CXXFLAGS.o = @DEFS@ @CXXFLAGSO@ $(INCLUDE) +F77FLAGS.g = @DEFS@ @F77FLAGSG@ $(INCLUDE) +F77FLAGS.o = @DEFS@ @F77FLAGSO@ $(INCLUDE) + + # if multithread support in the library is requested, then set the # respective flags diff --git a/deal.II/configure b/deal.II/configure index 1e20ee1298..05aa26b3ca 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.41 +# From configure.in Revision: 1.42 @@ -1216,43 +1216,6 @@ fi -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1223: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$PERL" in - /*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_PERL="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -PERL="$ac_cv_path_PERL" -if test -n "$PERL"; then - echo "$ac_t""$PERL" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - if test $GXX = yes ; then @@ -1301,12 +1264,19 @@ fi echo $ac_n "checking whether -ggdb works for long symbols""... $ac_c" 1>&6 -echo "configure:1305: checking whether -ggdb works for long symbols" >&5 +echo "configure:1268: checking whether -ggdb works for long symbols" >&5 case "$target" in alpha*-osf*) CXXFLAGS="-ggdb $CXXFLAGSG" + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + cat > conftest.$ac_ext < @@ -1327,7 +1297,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* CXXFLAGSG="-ggdb $CXXFLAGSG" @@ -1355,11 +1325,17 @@ esac echo $ac_n "checking whether AssertThrow works with debug flags""... $ac_c" 1>&6 -echo "configure:1359: checking whether AssertThrow works with debug flags" >&5 - +echo "configure:1329: checking whether AssertThrow works with debug flags" >&5 + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXFLAGS=$CXXFLAGSG cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1387,11 +1363,17 @@ fi rm -f conftest* echo $ac_n "checking whether AssertThrow works with optimized flags""... $ac_c" 1>&6 -echo "configure:1391: checking whether AssertThrow works with optimized flags" >&5 - +echo "configure:1367: checking whether AssertThrow works with optimized flags" >&5 + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXFLAGS=$CXXFLAGSO cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1421,6 +1403,166 @@ rm -f conftest* +# Extract the first word of "f77", so it can be a program name with args. +set dummy f77; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1410: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_F77'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$F77" in + /*) + ac_cv_path_F77="$F77" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_F77="$F77" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_F77="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +F77="$ac_cv_path_F77" +if test -n "$F77"; then + echo "$ac_t""$F77" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "x$F77" = "x" ; then + # Extract the first word of "g77", so it can be a program name with args. +set dummy g77; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1446: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_F77'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$F77" in + /*) + ac_cv_path_F77="$F77" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_F77="$F77" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_F77="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +F77="$ac_cv_path_F77" +if test -n "$F77"; then + echo "$ac_t""$F77" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi + +F77_VERSION_STRING=`($F77 -v 2>&1)` +if test -n "`echo $F77_VERSION_STRING | grep \"GNU F77\"`" ; then + G77_VERSION_STRING="`($F77 -v 2>&1) | grep \"gcc version\"`" + case "$G77_VERSION_STRING" in + *"egcs-1.1"*) + echo "$ac_t""compiler is egcs-1.1" 1>&6 + F77_VERSION=egcs1.1 + ;; + *2.95*) + echo "$ac_t""compiler is gcc-2.95" 1>&6 + F77_VERSION=gcc2.95 + ;; + *2.96*) + echo "$ac_t""compiler is gcc-2.96" 1>&6 + F77_VERSION=gcc2.96 + ;; + *2.97*) + echo "$ac_t""compiler is gcc-2.97" 1>&6 + F77_VERSION=gcc2.97 + ;; + *2.4* | *2.5* | *2.6* | *2.7* | *2.8*) + echo "$ac_t""compiler is $G77_VERSION_STRING" 1>&6 + { echo "configure: error: compiler is not supported" 1>&2; exit 1; } + ;; + *) + echo "$ac_t""compiler is unknown but accepted gcc version" 1>&6 + F77_VERSION=other + ;; + esac + + F77FLAGSG="$FFLAGS -ggdb -DDEBUG -pedantic -W -Wall" + F77FLAGSO="$FFLAGS -O2" + + if test "x$F77_VERSION" != "xegcs1.1" ; then + F77FLAGSO="$F77FLAGSO -funroll-loops -funroll-all-loops -fstrict-aliasing" + fi + + F77LDFLAGS=-lg2c + +else + F77_VERSION +fi + + + + + + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1531: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + + + # Check whether --enable-multithreading or --disable-multithreading was given. @@ -1437,7 +1579,7 @@ fi if test $enablemultithreading = yes ; then echo $ac_n "checking for platform specific thread flags""... $ac_c" 1>&6 -echo "configure:1441: checking for platform specific thread flags" >&5 +echo "configure:1583: checking for platform specific thread flags" >&5 for i in threads mt pthread pthreads mthreads Kthread kthread invalid_last_entry; do CXXFLAGS="$CXXFLAGSG -$i" @@ -1473,10 +1615,16 @@ echo "configure:1441: checking for platform specific thread flags" >&5 echo $ac_n "checking for platform specific multi-threading defines""... $ac_c" 1>&6 -echo "configure:1477: checking for platform specific multi-threading defines" >&5 - +echo "configure:1619: checking for platform specific multi-threading defines" >&5 + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""not necessary"" 1>&6 @@ -1532,7 +1680,7 @@ fi if test $withmultithreading != no ; then echo $ac_n "checking for ACE""... $ac_c" 1>&6 -echo "configure:1536: checking for ACE" >&5 +echo "configure:1684: checking for ACE" >&5 if test -d $withmultithreading ; then echo "$ac_t""found" 1>&6 else @@ -1552,7 +1700,7 @@ if test "${with_blas+set}" = set; then withval="$with_blas" if test $withval != no ; then echo $ac_n "checking for BLAS""... $ac_c" 1>&6 -echo "configure:1556: checking for BLAS" >&5 +echo "configure:1704: checking for BLAS" >&5 if test -r $withval ; then echo "$ac_t""found" 1>&6 else @@ -1568,7 +1716,7 @@ EOF else echo $ac_n "checking for main in -lblas""... $ac_c" 1>&6 -echo "configure:1572: checking for main in -lblas" >&5 +echo "configure:1720: checking for main in -lblas" >&5 ac_lib_var=`echo blas'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1576,14 +1724,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1615,7 +1763,7 @@ if test "${with_lapack+set}" = set; then withval="$with_lapack" if test $withval != no ; then echo $ac_n "checking for LAPACK""... $ac_c" 1>&6 -echo "configure:1619: checking for LAPACK" >&5 +echo "configure:1767: checking for LAPACK" >&5 if test -r $withval ; then echo "$ac_t""found" 1>&6 else @@ -1631,7 +1779,7 @@ EOF else echo $ac_n "checking for dgels_ in -llapack""... $ac_c" 1>&6 -echo "configure:1635: checking for dgels_ in -llapack" >&5 +echo "configure:1783: checking for dgels_ in -llapack" >&5 ac_lib_var=`echo lapack'_'dgels_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1639,7 +1787,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llapack $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1720,7 +1868,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:1724: checking for kdoc" >&5 +echo "configure:1872: checking for kdoc" >&5 if test "$kdocdir" != ${DEAL2_DIR}/contrib/kdoc/bin ; then if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 @@ -1756,7 +1904,7 @@ if test "$docxx" = to-be-determined ; then # Extract the first word of ""doc++"", so it can be a program name with args. set dummy "doc++"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1760: checking for $ac_word" >&5 +echo "configure:1908: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1790,7 +1938,7 @@ fi else echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:1794: checking for doc++" >&5 +echo "configure:1942: checking for doc++" >&5 if test -x "$docxx" ; then echo "$ac_t""yes" 1>&6 else @@ -1805,7 +1953,7 @@ fi echo $ac_n "checking whether getrusage is properly declared""... $ac_c" 1>&6 -echo "configure:1809: checking whether getrusage is properly declared" >&5 +echo "configure:1957: checking whether getrusage is properly declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1813,9 +1961,8 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross - cat > conftest.$ac_ext < @@ -1827,7 +1974,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1845,12 +1992,18 @@ fi rm -f conftest* echo $ac_n "checking whether isnan is declared with debug flags""... $ac_c" 1>&6 -echo "configure:1849: checking whether isnan is declared with debug flags" >&5 - +echo "configure:1996: checking whether isnan is declared with debug flags" >&5 + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXFLAGS=$CXXFLAGSG deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1862,7 +2015,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1878,7 +2031,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -1890,7 +2043,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -1910,7 +2063,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSG $testflag" cat > conftest.$ac_ext < @@ -1922,7 +2075,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -1935,7 +2088,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -1947,7 +2100,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -1969,12 +2122,18 @@ rm -f conftest* fi echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6 -echo "configure:1973: checking whether isnan is declared with optimized flags" >&5 - +echo "configure:2126: checking whether isnan is declared with optimized flags" >&5 + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXFLAGS=$CXXFLAGSO deal_II_isnan_flag="" cat > conftest.$ac_ext < @@ -1986,7 +2145,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2002,7 +2161,7 @@ rm -f conftest* if test "x$deal_II_isnan_flag" = "x" ; then cat > conftest.$ac_ext < @@ -2014,7 +2173,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""yes"" 1>&6 @@ -2034,7 +2193,7 @@ rm -f conftest* for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do CXXFLAGS="$CXXFLAGSO $testflag" cat > conftest.$ac_ext < @@ -2046,7 +2205,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_ISNAN $testflag" @@ -2059,7 +2218,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -2071,7 +2230,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" @@ -2097,18 +2256,25 @@ rm -f conftest* +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + CXXFLAGS="$CXXFLAGSG" echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6 -echo "configure:2103: checking for consistency of CXXFLAGSG flags" >&5 +echo "configure:2269: checking for consistency of CXXFLAGSG flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -2126,16 +2292,16 @@ rm -f conftest* CXXFLAGS="$CXXFLAGSO" echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6 -echo "configure:2130: checking for consistency of CXXFLAGSO flags" >&5 +echo "configure:2296: checking for consistency of CXXFLAGSO flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -2154,6 +2320,8 @@ rm -f conftest* + + subdirs="tests contrib" @@ -2283,9 +2451,14 @@ s%@lib_suffix@%$lib_suffix%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@GXX_VERSION@%$GXX_VERSION%g -s%@PERL@%$PERL%g s%@CXXFLAGSG@%$CXXFLAGSG%g s%@CXXFLAGSO@%$CXXFLAGSO%g +s%@F77@%$F77%g +s%@F77_VERSION@%$F77_VERSION%g +s%@F77FLAGSO@%$F77FLAGSO%g +s%@F77FLAGSG@%$F77FLAGSG%g +s%@F77LDFLAGS@%$F77LDFLAGS%g +s%@PERL@%$PERL%g s%@enablemultithreading@%$enablemultithreading%g s%@withmultithreading@%$withmultithreading%g s%@enablemultigrid@%$enablemultigrid%g diff --git a/deal.II/configure.in b/deal.II/configure.in index 9b44edc7b5..3bc84b804f 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -149,10 +149,6 @@ AC_SUBST(GXX_VERSION) -dnl Find path to perl -AC_PATH_PROG(PERL, perl) - - dnl ------------------------------------------------------------- dnl Set compiler flags to their default values. They will be @@ -235,6 +231,7 @@ case "$target" in dnl On Alpha, use the special treatment alpha*-osf*) CXXFLAGS="-ggdb $CXXFLAGSG" + AC_LANG_CPLUSPLUS AC_TRY_COMPILE( [ #include @@ -285,6 +282,90 @@ DEAL_II_CHECK_ASSERT_THROW(optimized, $CXXFLAGSO, CXXFLAGSO="-DDISABLE_ASSERT_TH +dnl Find path to a Fortran 77 compiler. By default try to find a +dnl vendor compiler which is usually names `f77', and only if that could +dnl not be found, use `g77' instead. The reasoning is that usually vendor +dnl compilers are much better adapted to the system at hand, and since +dnl Fortran code is often used for efficiency reasons, this is +dnl important. Likewise, if external Fortran code is imported, it is +dnl usually code that is well tested and does not need much debugging, so +dnl good optimizations are helpful again. +AC_PATH_PROG(F77,f77) +if test "x$F77" = "x" ; then + dnl Could not find an executable names `f77'. Try `g77' + AC_PATH_PROG(F77,g77) +fi +dnl It is possible that no Fortran 77 compiler was found. Don't care, +dnl it may be that we don't need one (but we check below, when we must +dnl have it). + +dnl Next try to find out something about the name and version of the compiler +F77_VERSION_STRING=`($F77 -v 2>&1)` +if test -n "`echo $F77_VERSION_STRING | grep \"GNU F77\"`" ; then + dnl Yes, this is a GNU g77 version. find out the right version + G77_VERSION_STRING="`($F77 -v 2>&1) | grep \"gcc version\"`" + case "$G77_VERSION_STRING" in + *"egcs-1.1"*) + AC_MSG_RESULT(compiler is egcs-1.1) + F77_VERSION=egcs1.1 + ;; + *2.95*) + AC_MSG_RESULT(compiler is gcc-2.95) + F77_VERSION=gcc2.95 + ;; + *2.96*) + AC_MSG_RESULT(compiler is gcc-2.96) + F77_VERSION=gcc2.96 + ;; + *2.97*) + AC_MSG_RESULT(compiler is gcc-2.97) + F77_VERSION=gcc2.97 + ;; + *2.4* | *2.5* | *2.6* | *2.7* | *2.8*) + dnl These compilers are too old to support a useful subset + dnl of modern C++, so we don't support them + AC_MSG_RESULT(compiler is $G77_VERSION_STRING) + AC_MSG_ERROR(compiler is not supported) + ;; + *) + AC_MSG_RESULT(compiler is unknown but accepted gcc version) + F77_VERSION=other + ;; + esac + + dnl For g77 versions, it is simple which flags to use since we already + dnl know them mostly from the C++ compiler + F77FLAGSG="$FFLAGS -ggdb -DDEBUG -pedantic -W -Wall" + F77FLAGSO="$FFLAGS -O2" + + dnl Some flags can only be set for some compilers as others either + dnl did not accept them or were buggy on them (see the explanation + dnl for CXXFLAGS for an explanation of some of these cases) + if test "x$F77_VERSION" != "xegcs1.1" ; then + F77FLAGSO="$F77FLAGSO -funroll-loops -funroll-all-loops -fstrict-aliasing" + fi + + dnl Then we have to set the set of libraries we have to link with + dnl when linking C++ and Fortran code with the C++ compiler. For + dnl g77, this is only libg2c + F77LDFLAGS=-lg2c + +else + dnl No GNU g77 version, something else. Don't set anything + F77_VERSION +fi +AC_SUBST(F77_VERSION) +AC_SUBST(F77FLAGSO) +AC_SUBST(F77FLAGSG) +AC_SUBST(F77LDFLAGS) + + +dnl Find path to perl +AC_PATH_PROG(PERL, perl) +AC_SUBST(PERL) + + + dnl ------------------------------------------------------------- dnl Multithreading @@ -469,8 +550,9 @@ DEAL_II_CHECK_ISNAN dnl ------------------------------------------------------------- -dnl Last check: test whether CXXFLAGS are ok +dnl Last check: test whether CXXFLAGS and F77FLAGS are ok dnl ------------------------------------------------------------- +AC_LANG_CPLUSPLUS CXXFLAGS="$CXXFLAGSG" AC_MSG_CHECKING(for consistency of CXXFLAGSG flags) AC_TRY_COMPILE( @@ -498,6 +580,38 @@ AC_TRY_COMPILE( ]) +dnl Err, well -- we'd like to have checked these flags, but autoconf +dnl has a problem here: when writing the compile file, a newline is +dnl missing, leading to an error when executing ./configure. So: +dnl while this is not fixed in autoconf, disable the respective tests +dnl AC_LANG_FORTRAN77 +dnl FFLAGS="$F77FLAGSG" +dnl AC_MSG_CHECKING(for consistency of F77FLAGSG flags) +dnl AC_TRY_COMPILE( +dnl [], +dnl [], +dnl [ +dnl AC_MSG_RESULT(yes) +dnl ], +dnl [ +dnl AC_MSG_ERROR(invalid combination of flags!) +dnl exit 1; +dnl ]) +dnl +dnl FFLAGS="$F77FLAGSO" +dnl AC_MSG_CHECKING(for consistency of F77FLAGSO flags) +dnl AC_TRY_COMPILE( +dnl [], +dnl [], +dnl [ +dnl AC_MSG_RESULT(yes) +dnl ], +dnl [ +dnl AC_MSG_ERROR(invalid combination of flags!) +dnl exit 1; +dnl ]) + + dnl ------------------------------------------------------------- dnl Configure other packages diff --git a/deal.II/doc/development/Makefile b/deal.II/doc/development/Makefile index 943b99f7a5..30f9c89ccb 100644 --- a/deal.II/doc/development/Makefile +++ b/deal.II/doc/development/Makefile @@ -14,6 +14,8 @@ makefiles.html: Makefile makefiles.1.html $D/common/Make.global_options makefile @echo '
  • CXX=$(CXX)' >> $@ @echo '
  • CC=$(CC)' >> $@ @echo '
  • GXX-VERSION=$(GXX-VERSION)' >> $@ + @echo '
  • F77=$(F77)' >> $@ + @echo '
  • F77-VERSION=$(F77-VERSION)' >> $@ @echo '
  • PERL=$(PERL)' >> $@ @echo '
  • DEAL_II_MAJOR=$(DEAL_II_MAJOR)' >> $@ @echo '
  • DEAL_II_MINOR=$(DEAL_II_MINOR)' >> $@ @@ -37,7 +39,10 @@ makefiles.html: Makefile makefiles.1.html $D/common/Make.global_options makefile @echo '
  • INCLUDE=$(INCLUDE)' >> $@ @echo '
  • CXXFLAGS.g=$(CXXFLAGS.g)' >> $@ @echo '
  • CXXFLAGS.o=$(CXXFLAGS.o)' >> $@ + @echo '
  • F77FLAGS.g=$(F77FLAGS.g)' >> $@ + @echo '
  • F77FLAGS.o=$(F77FLAGS.o)' >> $@ @echo '
  • LDFLAGS=$(LDFLAGS)' >> $@ + @echo '
  • F77LDFLAGS=$(F77LDFLAGS)' >> $@ @echo '
  • LIBS=$(LIBS)' >> $@ @echo '
  • ACE_ROOT=$(ACE_ROOT)' >> $@ @echo '
  • lib-ACE=$(lib-ACE)' >> $@ diff --git a/deal.II/doc/development/makefiles.1.html b/deal.II/doc/development/makefiles.1.html index e199f69570..ca5c20636d 100644 --- a/deal.II/doc/development/makefiles.1.html +++ b/deal.II/doc/development/makefiles.1.html @@ -60,7 +60,27 @@
    GXX-VERSION

    - Version of the GNU C++ compiler if that is used + Version of the GNU C++ compiler if that is used. Possible + names presently include egcs1.1, + gcc2.95, gcc2.96, and gcc2.97 +

    +
    + + +
    F77
    +

    + Executable name of the F77 compiler; often, no Fortran + compiler is needed, in which case the variable may be empty if + none was found +

    +
    + + +
    F77-VERSION
    +

    + Name and version of the Fortran 77 compiler. Possible + names presently include egcs1.1, + gcc2.95, gcc2.96, and gcc2.97

    @@ -215,14 +235,27 @@
    CXXFLAGS.g

    - Compiler flags for debug mode + C++ compiler flags for debug mode

    CXXFLAGS.o

    - Compiler flags for optimized mode + C++ compiler flags for optimized mode +

    +
    + +
    F77FLAGS.g
    +

    + Fortran 77 compiler flags for debug mode +

    +
    + + +
    F77FLAGS.o
    +

    + Fortran 77 compiler flags for optimized mode

    @@ -238,13 +271,25 @@

    +
    F77LDFLAGS
    +

    + Linker flags when linking Fortran 77 code into the + executable where the main part is C++. This includes + libraries as libg2c for g77, or vendor libraries +

    +
    + +
    LIBS

    - Additional libraries found by configure + Additional libraries found by configure and needed to be + linked with based on the flags given to + ./configure, e.g. BLAS or LAPACK

    +
  • Variables in multithreading mode

    -- 2.39.5