summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2011-08-21 03:17:37 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2011-08-21 03:17:37 (GMT)
commit8137c9fda74ddbcd99083cd95a1a866dfab75a86 (patch)
tree53cf3eee6cc3fc14adf26e0a7ee50e7f0df0ca2b /configure.in
parentde1609418532ebef39eec211cd8a9ea85333a9e1 (diff)
downloadhdf5-8137c9fda74ddbcd99083cd95a1a866dfab75a86.zip
hdf5-8137c9fda74ddbcd99083cd95a1a866dfab75a86.tar.gz
hdf5-8137c9fda74ddbcd99083cd95a1a866dfab75a86.tar.bz2
[svn-r21275] Description: Changed the --enable-fortran2003 behavior to:
1) --enable-fortran2003 will enable only F2003 features. It is not a replacement for --enable-fortran. If compiler is not F2003 compliant configure should fail. 2) if --enable-fortran2003 is specified with out --enable-fortran configure fails 3) Configure help indicates that --enable-fortran2003 is in addition to --enable-fortran Updated the version checks of different compilers. Tested: jam (gcc 4.1 4.6, intel 10.1 11.1 12.0, pgi)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in230
1 files changed, 127 insertions, 103 deletions
diff --git a/configure.in b/configure.in
index 4c36451..2d632e2 100644
--- a/configure.in
+++ b/configure.in
@@ -376,29 +376,41 @@ AC_ARG_ENABLE([fortran],
[Compile the Fortran 77/90/95 interface [default=no]])],
[HDF_FORTRAN=$enableval])
+if test "X$HDF_FORTRAN" = "Xyes"; then
+ echo "yes"
+else
+ echo "no"
+fi
+
+
dnl ----------------------------------------------------------------------
dnl Check if they would like the Fortran 2003 interface compiled
dnl
+AC_MSG_CHECKING([if Fortran 2003 interface enabled])
AC_ARG_ENABLE([fortran2003],
[AC_HELP_STRING([--enable-fortran2003],
- [Compile the Fortran 2003 interface [default=no]])],
+ [Compile the Fortran 2003 interface, must also specify --enable-fortran [default=no]])],
[HDF_FORTRAN2003=$enableval])
-HAVE_SIZEOF="no"
-FORTRAN_DEFAULT_REALisDBLE="no"
-
-dnl If FORTRAN 2003 interface enabled then mark that the general
-dnl Fortran interface is also enabled
+dnl ----------------------------------------------------------------------
+dnl Check to make sure --enable-fortran is present if --enable-fortran2003
+dnl was specified
-if test "X$HDF_FORTRAN2003" = "Xyes"; then
- AC_SUBST(FC) HDF_FORTRAN=yes
+if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then
+ echo "yes"
+ AC_MSG_ERROR([--enable-fortran must be used with --enable-fortran2003])
+else
+ echo "no"
fi
-AC_SUBST([HAVE_FORTRAN_2003])
+HAVE_SIZEOF="no"
+FORTRAN_DEFAULT_REALisDBLE="no"
if test "X$HDF_FORTRAN" = "Xyes"; then
- echo "yes"
+ AC_SUBST(FC) HDF_FORTRAN=yes
+ AC_SUBST([HAVE_FORTRAN_2003])
+
HDF5_INTERFACES="$HDF5_INTERFACES fortran"
dnl --------------------------------------------------------------------
@@ -455,16 +467,16 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
dnl --------------------------------------------------------------------
dnl See if the compiler will support the "-I." option
dnl
-dnl AM_FCFLAGS_saved=$AM_FCFLAGS
-dnl AM_FCFLAGS="${AM_FCFLAGS} -I."
+ dnl AM_FCFLAGS_saved=$AM_FCFLAGS
+ dnl AM_FCFLAGS="${AM_FCFLAGS} -I."
-dnl AC_MSG_CHECKING(if compiler supports -I. option)
-dnl AC_TRY_FCOMPILE([
-dnl program conftest
-dnl end
-dnl ], AC_MSG_RESULT(yes),
-dnl AC_MSG_RESULT(no)
-dnl AM_FCFLAGS="$AM_FCFLAGS_saved")
+ dnl AC_MSG_CHECKING(if compiler supports -I. option)
+ dnl AC_TRY_FCOMPILE([
+ dnl program conftest
+ dnl end
+ dnl ], AC_MSG_RESULT(yes),
+ dnl AC_MSG_RESULT(no)
+ dnl AM_FCFLAGS="$AM_FCFLAGS_saved")
dnl --------------------------------------------------------------------
dnl See if the fortran compiler supports the intrinsic function "SIZEOF"
@@ -511,98 +523,110 @@ dnl AM_FCFLAGS="$AM_FCFLAGS_saved")
if test "X$HDF_FORTRAN2003" = "Xyes"; then
- dnl Checking if the compiler supports the ISO_C_BINDING module, if it does
- dnl not then don't bother checking any other fortran 2003 features and
- dnl disable fortran 2003.
+ dnl Checking if the compiler supports the ISO_C_BINDING module, if it does
+ dnl not then don't bother checking any other Fortran 2003 features and
+ dnl disable Fortran 2003.
- AC_MSG_CHECKING([if Fortran compiler supports ISO_C_BINDING module])
-
- AC_TRY_COMPILE(,[
- USE iso_c_binding
- ], [AC_MSG_RESULT(yes)
- HAVE_ISO_C_BINDING="yes"] ,
- AC_MSG_RESULT(no))
-
- if test "X$HAVE_ISO_C_BINDING" = "Xyes"; then
-
- AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF])
- HAVE_FORTRAN_2003="no"
-
- dnl Sun compiler
- if (${FC} -V 2>&1 | grep 'Sun Fortran') > /dev/null; then
- vers=[`${FC} -V 2>&1 | sed -rn '\|Fortran 95 | s|.* ([0-9.]+) .*|\1|p' | sed -e 's/[^0-9]//g'`]
- if test -n "$vers" && test "$vers" -ge 86; then
- HAVE_FORTRAN_2003="yes"
- echo $HAVE_FORTRAN_2003
- else
- echo $HAVE_FORTRAN_2003
- AC_MSG_WARN([Only Sun Fortran Compiler, Version >= 8.6 supported; disabling Fortran 2003 features])
- fi
- fi
-
- dnl Intel compiler
- if (${FC} -V 2>&1 | grep '^Intel(R) Fortran') > /dev/null; then
- vers=[`${FC} -v 2>&1 | sed -e 's/[^0-9]//g'`]
- if test -n "$vers" && test "$vers" -ge 101; then
- HAVE_FORTRAN_2003="yes"
- echo $HAVE_FORTRAN_2003
- else
- echo $HAVE_FORTRAN_2003
- AC_MSG_WARN([Only Intel Fortran Compiler, Version > 10.1 supported; disabling Fortran 2003 features])
- fi
- fi
-
- dnl g95 compiler
- if (${FC} -dumpversion 2>&1 | grep 'G95') > /dev/null; then
- vers=[`${FC} -dumpversion 2>&1 | grep -o '[^ ]*!' | sed -e 's/[^0-9]//g'`]
- if test -n "$vers" && test "$vers" -ge 90; then
- HAVE_FORTRAN_2003="yes"
- echo $HAVE_FORTRAN_2003
- else
- echo $HAVE_FORTRAN_2003
- AC_MSG_WARN([Only G95 Fortran Compiler, Version > .9 supported; disabling Fortran 2003 features])
- fi
- fi
-
- dnl gfortran
- if (${FC} --version 2>&1 | grep 'GNU Fortran') > /dev/null; then
- vers_major=[`${FC} --version 2>&1 | grep 'GNU Fortran (' | grep -o ' [0-9]*\.' | sed -e 's/[^0-9]//g'`]
- vers_minor=[`${FC} --version 2>&1 | grep 'GNU Fortran (' | grep -o '\.[0-9]*\.' | sed -e 's/[^0-9]//g'`]
-
- if test -n "$vers_major" && test -n "$vers_minor" && test "$vers_major" -ge 4 && test "$vers_minor" -ge 1; then
- HAVE_FORTRAN_2003="yes"
- echo $HAVE_FORTRAN_2003
- else
- echo $HAVE_FORTRAN_2003
- AC_MSG_WARN([Only GNU Fortran Compiler, Version > 4.1.0 supported; disabling Fortran 2003 features])
- fi
- fi
-
- dnl The Portland Group
- if (${FC} -V 2>&1 | grep 'Portland Group') > /dev/null; then
- vers=[`${FC} -V 2>&1 | grep 'pgf' | grep -o '[^ ]*[^ ]\.[^ ]' | sed -e 's/[^0-9]//g'`]
- if test -n "$vers" && test "$vers" -ge 104; then
- HAVE_FORTRAN_2003="yes"
- echo $HAVE_FORTRAN_2003
- else
- echo $HAVE_FORTRAN_2003
- AC_MSG_WARN([Only The Portland Group Compiler, Version > 10.4-0 supported; disabling Fortran 2003 features])
- fi
-
- fi
+ AC_MSG_CHECKING([if Fortran compiler supports ISO_C_BINDING module])
+ AC_TRY_COMPILE(,[
+ USE iso_c_binding
+ ], [AC_MSG_RESULT(yes)
+ HAVE_ISO_C_BINDING="yes"],
+ AC_MSG_RESULT(no))
+
+ if test "X$HAVE_ISO_C_BINDING" = "Xno"; then
+ AC_MSG_ERROR([Fortran compiler does not have ISO_C_BINDING; unsupported Fortran 2003 compiler, remove --enable-fortran2003])
+ fi
+
+ AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF])
+ HAVE_FORTRAN_2003="no"
+
+ dnl Sun compiler
+ if (${FC} -V 2>&1 | grep 'Sun Fortran') > /dev/null; then
+ vers=[`${FC} -V 2>&1 | sed -rn '\|Fortran 95 | s|.* ([0-9.]+) .*|\1|p' | sed -e 's/[^0-9]//g'`]
+ if test -n "$vers" && test "$vers" -ge 86; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ echo $HAVE_FORTRAN_2003
+ AC_MSG_ERROR([Only Sun Fortran Compiler, Version >= 8.6 F2003 supported; remove --enable-fortran2003])
+ fi
+ fi
+ dnl Intel compiler
+ if (${FC} -V 2>&1 | grep '^Intel(R) Fortran') > /dev/null; then
+ vers_major=[`${FC} -v 2>&1 | grep -o ' [0-9]*\.' | sed -e 's/[^0-9]//g'`]
+ vers_minor=[`${FC} -v 2>&1 | grep -o '\.[0-9]*[.? ?]' | sed -e 's/[^0-9]//g'`]
+ if test -n "$vers_major" && test "$vers_major" -gt 10; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ if test -n "$vers_major" && test "$vers_major" = 10 && test -n "$vers_minor" && test "$vers_minor" -ge 1; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ echo $HAVE_FORTRAN_2003
+ AC_MSG_ERROR([Only Intel Fortran Compiler, Version >= 10.1 F2003 supported; remove --enable-fortran2003])
fi
+ fi
+ fi
- fi
+ dnl g95 compiler
+ if (${FC} -dumpversion 2>&1 | grep 'G95') > /dev/null; then
+ vers=[`${FC} -dumpversion 2>&1 | grep -o '[^ ]*!' | sed -e 's/[^0-9]//g'`]
+ if test -n "$vers" && test "$vers" -ge 90; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ echo $HAVE_FORTRAN_2003
+ AC_MSG_ERROR([Only G95 Fortran Compiler, Version >= .9 F2003 supported; remove --enable-fortran2003])
+ fi
+ fi
- dnl Change back to the C language
- AC_LANG_POP(Fortran)
-else
- echo "no"
- FC="no"
+ dnl gfortran
+ if (${FC} --version 2>&1 | grep 'GNU Fortran') > /dev/null; then
+ vers_major=[`${FC} --version 2>&1 | grep 'GNU Fortran (' | grep -o ') [0-9]*\.' | sed -e 's/[^0-9]//g'`]
+ vers_minor=[`${FC} --version 2>&1 | grep 'GNU Fortran (' | grep -o '\.[0-9]*\.' | sed -e 's/[^0-9]//g'`]
+
+ if test -n "$vers_major" && test "$vers_major" -gt 4; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ if test -n "$vers_major" && test "$vers_major" = 4 && test -n "$vers_minor" && test "$vers_minor" -gt 1; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ echo $HAVE_FORTRAN_2003
+ AC_MSG_ERROR([Only GNU Fortran Compiler, Version > 4.1.0 F2003 supported; remove --enable-fortran2003])
+ fi
+ fi
+ fi
+
+ dnl The Portland Group
+ if (${FC} -V 2>&1 | grep 'Portland Group') > /dev/null; then
+ vers_major=[`${FC} -V 2>&1 | grep 'pgf' | grep -o ' [0-9]*\.' | sed -e 's/[^0-9]//g'`]
+ vers_minor=[`${FC} -V 2>&1 | grep 'pgf' | grep -o '\.[0-9]*\-' | sed -e 's/[^0-9]//g'`]
+
+ if test -n "$vers_major" && test "$vers_major" -gt 10; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ if test -n "$vers_major" && test "$vers_major" = 10 && test -n "$vers_minor" && test "$vers_minor" -gt 4; then
+ HAVE_FORTRAN_2003="yes"
+ echo $HAVE_FORTRAN_2003
+ else
+ echo $HAVE_FORTRAN_2003
+ AC_MSG_ERROR([Only The Portland Group Compiler, Version >= 10.4-0 F2003 supported; remove --enable-fortran2003])
+ fi
+ fi
+ fi
+ fi
fi
+dnl Change back to the C language
+AC_LANG_POP(Fortran)
+
AM_CONDITIONAL([FORTRAN_HAVE_SIZEOF], [test "X$HAVE_SIZEOF" = "Xyes"])
AM_CONDITIONAL([FORTRAN_2003_CONDITIONAL_F], [test "X$HAVE_FORTRAN_2003" = "Xyes"])
AM_CONDITIONAL([FORTRAN_DEFAULT_REALisDBLE_F], [test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"])