From 090012657333456ea9deff62e964377f01de67e1 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 30 Jul 2020 08:21:53 -0600 Subject: [PATCH 1/3] added netCDF-4 and netcdf-4 par to list of features in summary --- CMakeLists.txt | 24 +++++++++++++++++++++++- configure.ac | 24 +++++++++++++++++++++--- libpio.settings.in | 3 +++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 871051c62fa..03f19c2cd0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,6 +273,26 @@ find_package (PnetCDF) SET(STATUS_PNETCDF PnetCDF_C_FOUND) +### +# Check to see if netcdf-4 capability is present in netcdf-c. +### +CHECK_C_SOURCE_COMPILES(" +#include +#if !NC_HAS_NC4 + choke me +#endif +int main() {return 0;}" HAVE_NETCDF4) + +### +# Check to see if netcdf-4 parallel I/O capability is present in netcdf-c. +### +CHECK_C_SOURCE_COMPILES(" +#include +#if !NC_HAS_PARALLEL4 + choke me +#endif +int main() {return 0;}" HAVE_NETCDF_PAR) + ### # Check to see if szip write capability is present in netcdf-c. ### @@ -285,7 +305,7 @@ CHECK_C_SOURCE_COMPILES(" int main() {return 0;}" HAVE_SZIP_WRITE) ### -# Check to see if szip write capability is present in netcdf-c. +# Check to see if paraellel filters are supported by HDF5/netcdf-c. ### CHECK_C_SOURCE_COMPILES(" #include @@ -339,6 +359,8 @@ is_enabled(USE_SZIP HAS_SZIP_WRITE) is_enabled(STATUS_PNETCDF HAS_PNETCDF) is_enabled(HAVE_H5Z_SZIP HAS_SZLIB) is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS) +is_enabled(HAVE_NETCDF4 HAS_NETCDF4) +is_enabled(HAVE_NETCDF_PAR HAS_NETCDF4_PAR) # Generate file from template. CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libpio.settings.in" diff --git a/configure.ac b/configure.ac index 071fd729067..f4884c70bec 100644 --- a/configure.ac +++ b/configure.ac @@ -257,12 +257,23 @@ if test x$ac_cv_lib_pnetcdf_ncmpi_create = xyes; then AC_DEFINE([USE_PNETCDF_VARN_ON_READ], [1], [defined by CMake build]) fi +# Do we have netCDF-4? +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], +[[#if !NC_HAS_NC4 +# error +#endif] +])], [have_netcdf4=yes], [have_netcdf4=no]) +AC_MSG_CHECKING([whether netCDF provides netCDF/HDF5]) +AC_MSG_RESULT([${have_netcdf4}]) + # Do we have a parallel build of netCDF-4? AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], -[[#if !NC_HAS_PARALLEL +[[#if !NC_HAS_PARALLEL4 # error #endif] ])], [have_netcdf_par=yes], [have_netcdf_par=no]) +AC_MSG_CHECKING([whether netCDF provides parallel I/O for netCDF/HDF5]) +AC_MSG_RESULT([${have_netcdf_par}]) # Do we have szip? AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], @@ -270,6 +281,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], # error #endif] ])], [have_szip_write=yes], [have_szip_write=no]) +AC_MSG_CHECKING([whether netCDF provides szip write capability]) +AC_MSG_RESULT([${have_szip_write}]) # Do we have parallel filter support? AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], @@ -277,9 +290,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], # error #endif] ])], [have_par_filters=yes], [have_par_filters=no]) +AC_MSG_CHECKING([whether netCDF provides parallel filter support]) +AC_MSG_RESULT([${have_par_filters}]) -AC_MSG_CHECKING([whether netCDF provides parallel IO]) -AC_MSG_RESULT([${have_netcdf_par}]) +# Set some build settings for when netcdf-4 is supported. if test x$have_netcdf_par = xyes; then AC_DEFINE([_NETCDF4],[1],[Does netCDF library provide netCDF-4 with parallel access]) fi @@ -378,6 +392,8 @@ AC_DEFUN([AX_SET_META],[ AX_SET_META([PIO_HAS_SZIP_WRITE],[$have_szip_write],[yes]) AX_SET_META([PIO_HAS_PNETCDF],[$enable_pnetcdf],[yes]) AX_SET_META([PIO_HAS_PAR_FILTERS], [$have_par_filters],[yes]) +AX_SET_META([PIO_HAS_NETCDF4], [$have_netcdf4],[yes]) +AX_SET_META([PIO_HAS_NETCDF4_PAR], [$have_netcdf_par],[yes]) # Create output variables from various shell variables, for use in # generating libpio.settings. @@ -393,6 +409,8 @@ AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf]) AC_SUBST(HAS_LOGGING, [$enable_logging]) AC_SUBST(HAS_SZIP_WRITE, [$have_szip_write]) AC_SUBST([HAS_PAR_FILTERS], [$have_par_filters]) +AC_SUBST([HAS_NETCDF4], [$have_netcdf4]) +AC_SUBST([HAS_NETCDF4_PAR], [$have_netcdf_par]) # Create the build summary file. AC_CONFIG_FILES([libpio.settings diff --git a/libpio.settings.in b/libpio.settings.in index 9b1459d7933..d25d732d605 100644 --- a/libpio.settings.in +++ b/libpio.settings.in @@ -29,3 +29,6 @@ FPPFLAGS: @FPPFLAGS@ PnetCDF Support: @HAS_PNETCDF@ SZIP Write Support: @HAS_SZIP_WRITE@ Parallel Filters: @HAS_PAR_FILTERS@ +NetCDF/HDF5 Support: @HAS_NETCDF4@ +NetCDF/HDF5 Par I/O: @HAS_NETCDF4_PAR@ + From 0ff7f7b0383f5f4a6cbae4073ce452c103fea1ad Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 30 Jul 2020 08:25:03 -0600 Subject: [PATCH 2/3] added new feature settings to pio_meta.h --- src/clib/pio_meta.h.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clib/pio_meta.h.in b/src/clib/pio_meta.h.in index 1729254398c..0b364df626c 100644 --- a/src/clib/pio_meta.h.in +++ b/src/clib/pio_meta.h.in @@ -23,8 +23,10 @@ #define PIO_VERSION_PATCH @PIO_VERSION_PATCH@ /*!< pio-c patch version. */ #define PIO_VERSION "@PACKAGE_VERSION@" -#define PIO_HAS_SZIP_WRITE @PIO_HAS_SZIP_WRITE@ /*!< szip write support */ -#define PIO_HAS_PNETCDF @PIO_HAS_PNETCDF@ /*!< PnetCDF support. */ -#define PIO_HAS_PAR_FILTERS @PIO_HAS_PAR_FILTERS@ /* NetCDF supports parallel I/O with filters. */ +#define PIO_HAS_SZIP_WRITE @PIO_HAS_SZIP_WRITE@ /*!< szip write support */ +#define PIO_HAS_PNETCDF @PIO_HAS_PNETCDF@ /*!< PnetCDF support. */ +#define PIO_HAS_PAR_FILTERS @PIO_HAS_PAR_FILTERS@ /*!< NetCDF supports parallel I/O with filters. */ +#define PIO_HAS_NETCDF4 @PIO_HAS_NETCDF4@ /*!< NetCDF-4 supported. */ +#define PIO_HAS_NETCDF4_PAR @PIO_HAS_NETCDF4_PAR@ /*!< NetCDF-4 parallel I/O supported. */ #endif From 3601aeab046d46157b5fd9faf12568900dcc3a85 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Thu, 30 Jul 2020 08:41:27 -0600 Subject: [PATCH 3/3] clean up --- CMakeLists.txt | 8 +++++--- configure.ac | 6 ++++-- libpio.settings.in | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03f19c2cd0b..92a016c4c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,11 +284,13 @@ CHECK_C_SOURCE_COMPILES(" int main() {return 0;}" HAVE_NETCDF4) ### -# Check to see if netcdf-4 parallel I/O capability is present in netcdf-c. +# Check to see if netcdf-4 parallel I/O capability is present in +# netcdf-c. (Really we should be checking NC_HAS_PARALLEL4, but that +# was only recently introduced, so we will go with NC_HAS_PARALLEL.) ### CHECK_C_SOURCE_COMPILES(" #include -#if !NC_HAS_PARALLEL4 +#if !NC_HAS_PARALLEL choke me #endif int main() {return 0;}" HAVE_NETCDF_PAR) @@ -305,7 +307,7 @@ CHECK_C_SOURCE_COMPILES(" int main() {return 0;}" HAVE_SZIP_WRITE) ### -# Check to see if paraellel filters are supported by HDF5/netcdf-c. +# Check to see if parallel filters are supported by HDF5/netcdf-c. ### CHECK_C_SOURCE_COMPILES(" #include diff --git a/configure.ac b/configure.ac index f4884c70bec..0ccc1ee2150 100644 --- a/configure.ac +++ b/configure.ac @@ -266,9 +266,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], AC_MSG_CHECKING([whether netCDF provides netCDF/HDF5]) AC_MSG_RESULT([${have_netcdf4}]) -# Do we have a parallel build of netCDF-4? +# Do we have a parallel build of netCDF-4? (Really we should be +# checking NC_HAS_PARALLEL4, but that was only recently introduced, so +# we will go with NC_HAS_PARALLEL.) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"], -[[#if !NC_HAS_PARALLEL4 +[[#if !NC_HAS_PARALLEL # error #endif] ])], [have_netcdf_par=yes], [have_netcdf_par=no]) diff --git a/libpio.settings.in b/libpio.settings.in index d25d732d605..44785afd6a5 100644 --- a/libpio.settings.in +++ b/libpio.settings.in @@ -27,8 +27,8 @@ FPPFLAGS: @FPPFLAGS@ # Features -------- PnetCDF Support: @HAS_PNETCDF@ -SZIP Write Support: @HAS_SZIP_WRITE@ -Parallel Filters: @HAS_PAR_FILTERS@ -NetCDF/HDF5 Support: @HAS_NETCDF4@ +SZIP Write Support: @HAS_SZIP_WRITE@ +Parallel Filters: @HAS_PAR_FILTERS@ +NetCDF/HDF5 Support: @HAS_NETCDF4@ NetCDF/HDF5 Par I/O: @HAS_NETCDF4_PAR@