separation of libhdf5 from libsrc4

This commit is contained in:
Ed Hartnett 2018-11-29 07:02:31 -07:00
parent 104b4b50fe
commit e55b9d697e
3 changed files with 33 additions and 32 deletions

View File

@ -203,8 +203,14 @@ fi
AC_MSG_RESULT([$enable_netcdf_4])
# Does the user want to use HDF5?
enable_hdf5=$enable_netcdf_4
AC_MSG_CHECKING([whether we should build with HDF5])
enable_hdf5=$enable_netcdf_4
dnl AC_ARG_ENABLE([hdf5], [AS_HELP_STRING([--disable-hdf5],
dnl [do not build with HDF5])])
dnl test "x$enable_hdf5" = xno || enable_hdf5=yes
dnl if test "x$enable_netcdf_4" = xno ; then
dnl enable_hdf5=no
dnl fi
AC_MSG_RESULT([$enable_hdf5])
# Does the user require dynamic loading?
@ -1007,9 +1013,13 @@ AC_CHECK_LIB([m], [floor], [],
[AC_MSG_ERROR([Can't find or link to the math library.])])
if test "x$enable_netcdf_4" = xyes; then
AC_DEFINE([USE_NETCDF4], [1], [if true, build netCDF-4])
fi
hdf5_parallel=no
if test "x$enable_hdf5" = xyes; then
AC_DEFINE([USE_HDF5], [1], [if true, use HDF5])
AC_DEFINE([USE_NETCDF4], [1], [if true, build netCDF-4])
AC_DEFINE([H5_USE_16_API], [1], [use HDF5 1.6 API])
# Check for the main hdf5 and hdf5_hl library.
@ -1021,20 +1031,10 @@ if test "x$enable_netcdf_4" = xyes; then
AC_CHECK_HEADERS([hdf5.h], [], [AC_MSG_ERROR([Compiling a test with HDF5 failed. Either hdf5.h cannot be found, or config.log should be checked for other reason.])])
AC_CHECK_FUNCS([H5Z_SZIP])
hdf5_parallel=no
# H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12.
# Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead.
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops])
# The user may have parallel HDF5 based on MPI POSIX.
# if test "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
# AC_DEFINE([USE_PARALLEL_POSIX], [1], [if true, compile in parallel netCDF-4 based on MPI/POSIX])
# fi
# The user may have parallel HDF5 based on MPI mumble mumble.
# if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes; then
# AC_DEFINE([USE_PARALLEL_MPIO], [1], [if true, compile in parallel netCDF-4 based on MPI/IO])
# fi
# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
@ -1042,7 +1042,6 @@ if test "x$enable_netcdf_4" = xyes; then
fi
# If parallel is available in hdf5, enable it in the C code. Also add some stuff to netcdf.h.
hdf5_parallel=no
if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes -o "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
hdf5_parallel=yes
fi
@ -1073,21 +1072,22 @@ if test "x$enable_netcdf_4" = xyes; then
AC_DEFINE([HDF5_HAS_LIBVER_BOUNDS], [1], [if true, netcdf4 file properties will be set using H5Pset_libver_bounds])
fi
# If the user wants hdf4 built in, check it out.
if test "x$enable_hdf4" = xyes; then
AC_CHECK_LIB([jpeg], [jpeg_CreateCompress], [],
[AC_MSG_ERROR([Jpeg library required for --enable-hdf4 builds.])])
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
if test "x$nc_mfhdf_h_missing" = xyes; then
AC_MSG_ERROR([Cannot find mfhdf.h, yet --enable-hdf4 was used.])
fi
AC_CHECK_LIB([df], [Hclose], [], [AC_MSG_ERROR([Can't find or link to the hdf4 df library. See config.log for errors.])])
AC_CHECK_LIB([mfhdf], [NC_arrayfill], [AC_MSG_ERROR([HDF4 library must be built with --disable-netcdf.])], [])
AC_CHECK_LIB([mfhdf], [SDcreate], [], [AC_MSG_ERROR([Can't find or link to the hdf4 mfhdf library. See config.log for errors.])])
fi
AC_CHECK_LIB([jpeg], [jpeg_set_quality], [], [AC_MSG_ERROR([Can't find or link to the jpeg library (required by hdf4). See config.log for errors.])])
AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too])
# If the user wants hdf4 built in, check it out.
if test "x$enable_hdf4" = xyes; then
AC_CHECK_LIB([jpeg], [jpeg_CreateCompress], [],
[AC_MSG_ERROR([Jpeg library required for --enable-hdf4 builds.])])
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
if test "x$nc_mfhdf_h_missing" = xyes; then
AC_MSG_ERROR([Cannot find mfhdf.h, yet --enable-hdf4 was used.])
fi
AC_CHECK_LIB([df], [Hclose], [], [AC_MSG_ERROR([Can't find or link to the hdf4 df library. See config.log for errors.])])
AC_CHECK_LIB([mfhdf], [NC_arrayfill], [AC_MSG_ERROR([HDF4 library must be built with --disable-netcdf.])], [])
AC_CHECK_LIB([mfhdf], [SDcreate], [], [AC_MSG_ERROR([Can't find or link to the hdf4 mfhdf library. See config.log for errors.])])
AC_CHECK_LIB([jpeg], [jpeg_set_quality], [], [AC_MSG_ERROR([Can't find or link to the jpeg library (required by hdf4). See config.log for errors.])])
AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too])
fi
# There are several cases for parallelism:
@ -1097,7 +1097,7 @@ fi
# b. do want to use it for netcdf4
# Should we provide parallel io for netcdf-4?
if test "x$enable_netcdf_4" = xyes ; then
if test "x$enable_hdf5" = xyes ; then
AC_ARG_ENABLE([parallel4],
[AS_HELP_STRING([--disable-parallel4],
[disable parallel I/O for netcdf-4, even if it's enabled in libhdf5])],

View File

@ -17,7 +17,9 @@ redistribution conditions. */
#include <stdlib.h>
#include <stdio.h>
#include "assert.h"
#ifdef USE_HDF5
#include <hdf5.h>
#endif /* USE_HDF5 */
/* This contents of this file get skipped if LOGGING is not defined
* during compile. */
@ -64,10 +66,12 @@ nc_log(int severity, const char *fmt, ...)
fflush(stderr);
}
void
void
nc_log_hdf5(void)
{
#ifdef USE_HDF5
H5Eprint(NULL);
#endif /* USE_HDF5 */
}
#endif /* ifdef LOGGING */

View File

@ -1412,10 +1412,7 @@ int
nc_set_log_level(int new_level)
{
#ifdef LOGGING
if(!nc4_hdf5_initialized)
nc4_hdf5_initialize();
/* Now remember the new level. */
/* Remember the new level. */
nc_log_level = new_level;
LOG((4, "log_level changed to %d", nc_log_level));
#endif /*LOGGING */