summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac147
1 files changed, 85 insertions, 62 deletions
diff --git a/configure.ac b/configure.ac
index d5b91ce..09f99e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,6 @@ AC_MSG_RESULT([done])
## MPE: whether MPE option is enabled. Default no.
## STATIC_EXEC: whether static-exec is enabled. Default no.
## HDF_FORTRAN: whether Fortran is enabled. Default no.
-## HDF_FORTRAN2003: whether Fortran 2003 is enabled. Default no.
## FC: Fortran compiler.
## HDF_CXX: whether C++ is enabled. Default no.
## CXX: C++ compiler.
@@ -157,6 +156,7 @@ AC_MSG_RESULT([done])
## INSTRUMENT: whether INSTRUMENT is enabled. No default set here.
## CODESTACK: whether CODESTACK is enabled. Default no.
## HAVE_DMALLOC: whether system has dmalloc support. Default no.
+## HAVE_FLOAT128: whether system has Quad-Precision Math Library. Default no.
## DIRECT_VFD: whether DIRECT_VFD is enabled. Default no.
## THREADSAFE: whether THREADSAFE is enabled. Default no.
## STATIC_SHARED: whether static and/or shared libraries are requested.
@@ -168,9 +168,7 @@ AC_SUBST([EXTERNAL_FILTERS])
AC_SUBST([MPE]) MPE=no
AC_SUBST([STATIC_EXEC]) STATIC_EXEC=no
AC_SUBST([HDF_FORTRAN]) HDF_FORTRAN=no
-AC_SUBST([HDF_FORTRAN2003]) HDF_FORTRAN2003=no
AC_SUBST([FC]) HDF_FORTRAN=no
-AC_SUBST([FC2003]) HDF_FORTRAN2003=no
AC_SUBST([HDF_CXX]) HDF_CXX=no
AC_SUBST([CXX]) HDF_CXX=no
AC_SUBST([HDF5_HL]) HDF5_HL=yes
@@ -346,6 +344,8 @@ case "X-$ALLOW_UNSUPPORTED" in
;;
esac
+AC_CHECK_SIZEOF([long double], [8])
+
## ----------------------------------------------------------------------
## Check if they would like the Fortran interface compiled
##
@@ -362,35 +362,16 @@ else
echo "no"
fi
-
-## ----------------------------------------------------------------------
-## Check if they would like the Fortran 2003 interface compiled
-##
-AC_MSG_CHECKING([if Fortran 2003 interface enabled])
-AC_ARG_ENABLE([fortran2003],
- [AS_HELP_STRING([--enable-fortran2003],
- [Compile the Fortran 2003 interface, must also specify --enable-fortran [default=no]])],
- [HDF_FORTRAN2003=$enableval])
-
-## ----------------------------------------------------------------------
-## Check to make sure --enable-fortran is present if --enable-fortran2003
-## was specified
-
-if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then
- echo "no"
- AC_MSG_ERROR([--enable-fortran must be used with --enable-fortran2003])
-else
- if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xyes"; then
- echo "yes"
- else
- echo "no"
- fi
-fi
-
if test "X$HDF_FORTRAN" = "Xyes"; then
+## We will output an include file for Fortran, H5config_f.inc which
+## contains various configure definitions used by the Fortran Library.
+## Prepend H5_ to all macro names. This avoids name conflict between HDF5 macro
+## names and those generated by another software package that uses the HDF5 library.
+ AC_CONFIG_HEADERS([fortran/src/H5config_f.inc],
+ [sed -i '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' fortran/src/H5config_f.inc])
+
AC_SUBST([FC]) HDF_FORTRAN=yes
- AC_SUBST([HAVE_FORTRAN_2003])
HDF5_INTERFACES="$HDF5_INTERFACES fortran"
@@ -423,6 +404,16 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
## Change to the Fortran 90 language
AC_LANG_PUSH(Fortran)
+ ## Checking if the compiler supports the required Fortran 2003 features and
+ ## stopping if it does not.
+ PAC_PROG_FC_HAVE_F2003_REQUIREMENTS
+
+ if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then
+ AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran])
+ else
+ HAVE_FORTRAN_2003="yes"
+ fi
+
## --------------------------------------------------------------------
## Define wrappers for the C compiler to use Fortran function names
##
@@ -434,26 +425,60 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
## See if the fortran compiler supports the intrinsic function "C_SIZEOF"
PAC_PROG_FC_C_SIZEOF
-
+
## See if the fortran compiler supports the intrinsic function "STORAGE_SIZE"
- PAC_PROG_FC_STORAGE_SIZE
-
- ## Check to see if -r8 was specified to determine if we need to
- ## compile the DOUBLE PRECISION interfaces.
- PAC_PROG_FC_DEFAULT_REALisDBLE
+ PAC_PROG_FC_STORAGE_SIZE
+
+ ## See if C_LONG_DOUBLE is available, and if it is different from C_DOUBLE
+ PAC_PROG_FC_HAVE_C_LONG_DOUBLE
+
+ ## See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV"
+ PAC_PROG_FC_ISO_FORTRAN_ENV
+
+ PAC_FC_NATIVE_INTEGER
+
+ PAC_FC_AVAIL_KINDS
+ PAC_FC_SIZEOF_INT_KINDS
+ PAC_FC_SIZEOF_REAL_KINDS
+
+ AC_SUBST([PAC_FC_ALL_REAL_KINDS])
+ AC_SUBST([PAC_FC_ALL_INTEGER_KINDS])
+ AC_SUBST([PAC_FC_ALL_REAL_KINDS_SIZEOF])
+ AC_SUBST([PAC_FC_ALL_INTEGER_KINDS_SIZEOF])
+ AC_SUBST([PAC_FORTRAN_NATIVE_INTEGER_KIND])
+ AC_SUBST([PAC_FORTRAN_NATIVE_INTEGER_SIZEOF])
+ AC_SUBST([PAC_FORTRAN_NATIVE_REAL_KIND])
+ AC_SUBST([PAC_FORTRAN_NATIVE_REAL_SIZEOF])
+ AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_KIND])
+ AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF])
+
+ ##if test $PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF > ${ac_cv_sizeof_long_double}; then
+ ## AC_MSG_ERROR([Fortran default DOUBLE PRECISION ("X$PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF" Bytes) can not be represented in C ])
+ ##fi
+
+ ##PAC_FC_AVAIL_INTEGER_MODELS
+
+ ## If neither intrinsic functions SIZEOF or STORAGE_SIZE is available then stop configure with an error
+ if test "X$HAVE_SIZEOF_FORTRAN" = "Xno" && test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xno"; then
+ AC_MSG_ERROR([Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE])
+ fi
+
+ if test "X$HAVE_STORAGE_SIZE_FORTRAN" = "Xyes"; then
+ AC_DEFINE([FORTRAN_HAVE_STORAGE_SIZE], [1], [Define if we have Fortran intrinsic STORAGE_SIZE])
+ fi
- if test "X$HDF_FORTRAN2003" = "Xyes"; then
+ if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then
+ AC_DEFINE([FORTRAN_HAVE_C_SIZEOF], [1], [Define if we have Fortran intrinsic C_SIZEOF])
+ fi
+
+ if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then
+ AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF])
+ fi
- ## Checking if the compiler supports the required Fortran 2003 features and
- ## disable Fortran 2003 if it does not.
- PAC_PROG_FC_HAVE_F2003_REQUIREMENTS
-
- if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then
- AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003])
- else
- HAVE_FORTRAN_2003="yes"
- fi
+ if test "X$HAVE_C_LONG_DOUBLE_FORTRAN" = "Xyes"; then
+ AC_DEFINE([FORTRAN_HAVE_C_LONG_DOUBLE], [1], [Define if we have Fortran C_LONG_DOUBLE])
fi
+ AC_DEFINE([FORTRAN_SIZEOF_LONG_DOUBLE], [SIZEOF_LONG_DOUBLE], [Determine the size of C long double])
else
FC="no"
fi
@@ -461,12 +486,6 @@ fi
## Change back to the C language
AC_LANG_POP(Fortran)
-AM_CONDITIONAL([FORTRAN_HAVE_SIZEOF], [test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"])
-AM_CONDITIONAL([FORTRAN_HAVE_C_SIZEOF], [test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"])
-AM_CONDITIONAL([FORTRAN_HAVE_STORAGE_SIZE], [test "X$HAVE_STORAGE_SIZE_FORTRAN" = "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"])
-
## ----------------------------------------------------------------------
## Check if they would like the C++ interface compiled
##
@@ -530,12 +549,6 @@ if test "X$HDF5_HL" = "Xyes"; then
HL="hl"
AC_DEFINE([INCLUDE_HL], [1],
[Define if HDF5's high-level library headers should be included in hdf5.h])
-
- ## If Fortran's default real is double precision and HL is being built then configure
- ## should fail due to bug HDFFV-889.
- if test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"; then
- AC_MSG_ERROR([Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use configure option --disable-hl.])
- fi
else
echo "no"
fi
@@ -975,7 +988,7 @@ case "$host_cpu-$host_vendor-$host_os" in
##
## POSIX feature information can be found in the gcc manual at:
## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
- H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS"
+##SCOT H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS"
## Need to add this so that O_DIRECT is visible for the direct
## VFD on Linux systems.
@@ -1039,7 +1052,7 @@ AC_CHECK_SIZEOF([long long], [8])
AC_CHECK_SIZEOF([__int64], [8])
AC_CHECK_SIZEOF([float], [4])
AC_CHECK_SIZEOF([double], [8])
-AC_CHECK_SIZEOF([long double], [8])
+## MOVED EARLIER FOR FORTRAN --MSB-- AC_CHECK_SIZEOF([long double], [8])
## Checkpoint the cache
AC_CACHE_SAVE
@@ -1096,6 +1109,15 @@ AC_CHECK_SIZEOF([off64_t], [8])
## Checkpoint the cache
AC_CACHE_SAVE
+## Check for the __FLOAT128
+AC_MSG_CHECKING([for __float128])
+AC_TRY_COMPILE([],
+ [__float128 x;],
+ [AC_DEFINE([HAVE_FLOAT128], [1], [Determine if __float128 is available])
+ AC_MSG_RESULT([yes])],
+ AC_MSG_RESULT([no])
+)
+
## ----------------------------------------------------------------------
## Check if the dev_t type is a scalar type (must come after the check for
## sys/types.h)
@@ -1784,18 +1806,18 @@ all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z"
case "X-$DEBUG_PKG" in
X-yes)
DEBUG_PKG="d,e,f,g,hg,i,mm,o,p,s,t,v,z"
- H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG"
+## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG"
AC_MSG_RESULT([default ($DEBUG_PKG)])
;;
X-all)
DEBUG_PKG=$all_packages
- H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG"
+## H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG"
AC_MSG_RESULT([all ($DEBUG_PKG)])
;;
X-no|X-none)
AC_MSG_RESULT([none])
DEBUG_PKG=
- H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG"
+## H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG"
;;
*)
AC_MSG_RESULT([$DEBUG_PKG])
@@ -2867,6 +2889,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
fortran/Makefile
fortran/src/h5fc
fortran/src/Makefile
+ fortran/src/H5fort_type_defines.h
fortran/test/Makefile
fortran/testpar/Makefile
fortran/examples/Makefile