Commit bc2125ad authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

config: added HAVE_NC4HDF5

parent 62184f18
......@@ -264,6 +264,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -237,6 +237,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -695,6 +695,7 @@ JASPER_LIBS
NETCDF_LIBS
NETCDF_INCLUDE
NETCDF_ROOT
ENABLE_NC4HDF5
ENABLE_NC4
ENABLE_NC2
ENABLE_NETCDF
......@@ -1596,7 +1597,7 @@ Optional Packages:
--with-hdf5=<yes|no|directory> (default=no)
location of HDF5 library
--with-netcdf=<yes|no|directory> (default=no)
location of netcdf library (lib and include subdirs)
location of NetCDF library (lib and include subdirs)
--with-jasper=<directory>
Specify location of JASPER library. You must specify
its location if GRIB_API was built with JASPER.
......@@ -27363,13 +27364,14 @@ NETCDF_LIBS=''
ENABLE_NETCDF=no
ENABLE_NC2=no
ENABLE_NC4=no
ENABLE_NC4HDF5=no
 
# Check whether --with-netcdf was given.
if test "${with_netcdf+set}" = set; then :
withval=$with_netcdf; case "$with_netcdf" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for netcdf library" >&5
$as_echo_n "checking for netcdf library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library" >&5
$as_echo_n "checking for NetCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
......@@ -27443,7 +27445,7 @@ $as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
 
ENABLE_NETCDF=yes
else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
as_fn_error $? "Could not link to NetCDF library" "$LINENO" 5
fi
 
NETCDF_LIBS=" -lnetcdf"
......@@ -27510,6 +27512,19 @@ $as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4/hdf5 support" >&5
$as_echo_n "checking netcdf's nc4/hdf5 support... " >&6; }
if test "x$($NC_CONFIG --has-hdf5)" = "xyes"; then :
$as_echo "#define HAVE_NC4HDF5 1" >>confdefs.h
ENABLE_NC4HDF5=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
else
$as_echo Could not find nc-config! go on with default configuration
......@@ -27589,7 +27604,7 @@ $as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
 
ENABLE_NETCDF=yes
else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
as_fn_error $? "Could not link to NetCDF library" "$LINENO" 5
fi
 
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
......@@ -27636,11 +27651,11 @@ fi
if test "x$NC_CONFIG" != "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's OpenDAP support" >&5
$as_echo_n "checking netcdf's OpenDAP support... " >&6; }
if test "x$($NC_CONFIG --has-dap)" = "xyes"; then :
if test "x$($NC_CONFIG --has-dap)" = "xyes"; then :
 
$as_echo "#define HAVE_LIBNC_DAP 1" >>confdefs.h
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
......@@ -27671,26 +27686,102 @@ $as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4/hdf5 support" >&5
$as_echo_n "checking netcdf's nc4/hdf5 support... " >&6; }
if test "x$($NC_CONFIG --has-hdf5)" = "xyes"; then :
$as_echo "#define HAVE_NC4HDF5 1" >>confdefs.h
ENABLE_NC4HDF5=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not find nc-config! go on with default configuration" >&5
$as_echo "Could not find nc-config! go on with default configuration" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NETCDF suppressed" >&5
$as_echo "$as_me: $with_netcdf is not a directory! NETCDF suppressed" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NetCDF suppressed" >&5
$as_echo "$as_me: $with_netcdf is not a directory! NetCDF suppressed" >&6;}
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETCDF library" >&5
$as_echo_n "checking for NETCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library" >&5
$as_echo_n "checking for NetCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
 
 
if test "x$ENABLE_NC4HDF5" = "xyes"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5TS_mutex_lock" >&5
$as_echo_n "checking for library containing H5TS_mutex_lock... " >&6; }
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char H5TS_mutex_lock ();
int
main ()
{
return H5TS_mutex_lock ();
;
return 0;
}
_ACEOF
for ac_lib in '' netcdf; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib -lhdf5_hl -lhdf5 $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_H5TS_mutex_lock=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
break
fi
done
if ${ac_cv_search_H5TS_mutex_lock+:} false; then :
else
ac_cv_search_H5TS_mutex_lock=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5TS_mutex_lock" >&5
$as_echo "$ac_cv_search_H5TS_mutex_lock" >&6; }
ac_res=$ac_cv_search_H5TS_mutex_lock
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_NC4HDF5_THREADSAFE 1" >>confdefs.h
fi
fi
 
 
 
......@@ -285,6 +285,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -279,6 +279,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -263,6 +263,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -114,30 +114,36 @@ NETCDF_LIBS=''
ENABLE_NETCDF=no
ENABLE_NC2=no
ENABLE_NC4=no
ENABLE_NC4HDF5=no
AC_ARG_WITH([netcdf],
[AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=no)],[location of netcdf library (lib and include subdirs)])],
[AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=no)],[location of NetCDF library (lib and include subdirs)])],
[AS_CASE(["$with_netcdf"],
[no],[AC_MSG_CHECKING([for netcdf library])
[no],[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netcdf library])])
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -lnetcdf"
AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AS_ECHO([Could not find nc-config! go on with default configuration])])],
[*],[AS_IF([test -d "$with_netcdf"],
[NETCDF_ROOT=$with_netcdf
......@@ -146,35 +152,47 @@ AC_ARG_WITH([netcdf],
AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netcdf library])])
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
AC_MSG_CHECKING([nc-config script])
AC_CHECK_PROG(NC_CONFIG,nc-config,[$NETCDF_ROOT/bin/nc-config],,["$NETCDF_ROOT/bin"])
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's OpenDAP support])
AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NETCDF OpenDAP])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NetCDF OpenDAP])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AC_MSG_RESULT([Could not find nc-config! go on with default configuration])])],
[AC_MSG_NOTICE([$with_netcdf is not a directory! NETCDF suppressed])])])],
[AC_MSG_CHECKING([for NETCDF library])
[AC_MSG_NOTICE([$with_netcdf is not a directory! NetCDF suppressed])])])],
[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])])
AS_IF([test "x$ENABLE_NC4HDF5" = "xyes"],
[AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NetCDF4/HDF5 threadsafe support])],,
[-lhdf5_hl -lhdf5])])
AC_SUBST([ENABLE_NETCDF])
AC_SUBST([ENABLE_NC2])
AC_SUBST([ENABLE_NC4])
AC_SUBST([ENABLE_NC4HDF5])
AC_SUBST([NETCDF_ROOT])
AC_SUBST([NETCDF_INCLUDE])
AC_SUBST([NETCDF_LIBS])
......
......@@ -348,6 +348,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
......@@ -23,8 +23,8 @@ const char *cdfLibraryVersion(void)
#endif
}
#if defined(HAVE_LIBHDF5)
#if defined(__cplusplus)
#if defined(HAVE_NC4HDF5)
#if defined(__cplusplus)
extern "C" {
#endif
int H5get_libversion(unsigned *, unsigned *, unsigned *);
......@@ -35,7 +35,7 @@ extern "C" {
const char *hdfLibraryVersion(void)
{
#if defined(HAVE_LIBHDF5)
#if defined(HAVE_NC4HDF5)
static char hdf_libvers[256];
unsigned majnum, minnum, relnum;
......
......@@ -132,7 +132,7 @@ void cdiPrintVersion(void)
#if defined (HAVE_LIBNETCDF)
fprintf(stderr, " NetCDF library version : %s\n", cdfLibraryVersion());
#endif
#if defined (HAVE_LIBHDF5)
#if defined (HAVE_NC4HDF5)
fprintf(stderr, " HDF5 library version : %s\n", hdfLibraryVersion());
#endif
#if defined (HAVE_LIBSERVICE)
......
......@@ -118,10 +118,10 @@
/* Define to 1 if you have the `malloc' library (-lmalloc). */
#undef HAVE_LIBMALLOC
/* Define to 1 for NETCDF OpenDAP */
/* Define to 1 for NetCDF OpenDAP */
#undef HAVE_LIBNC_DAP
/* Define to 1 for NETCDF support */
/* Define to 1 for NetCDF support */
#undef HAVE_LIBNETCDF
/* Define to 1 for JPEG compression for GRIB2 */
......@@ -148,10 +148,16 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 for NETCDF2 support */
/* Define to 1 for NetCDF4/HDF5 support */
#undef HAVE_NC4HDF5
/* Define to 1 for NetCDF4/HDF5 threadsafe support */
#undef HAVE_NC4HDF5_THREADSAFE
/* Define to 1 for NetCDF2 support */
#undef HAVE_NETCDF2
/* Define to 1 for NETCDF4 support */
/* Define to 1 for NetCDF4 support */
#undef HAVE_NETCDF4
/* Define to 1 if you have the <netcdf.h> header file. */
......
......@@ -361,6 +361,7 @@ ENABLE_IEG = @ENABLE_IEG@
ENABLE_MPI = @ENABLE_MPI@
ENABLE_NC2 = @ENABLE_NC2@
ENABLE_NC4 = @ENABLE_NC4@
ENABLE_NC4HDF5 = @ENABLE_NC4HDF5@
ENABLE_NETCDF = @ENABLE_NETCDF@
ENABLE_PYTHON = @ENABLE_PYTHON@
ENABLE_RUBY = @ENABLE_RUBY@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment