Skip to content

Commit

Permalink
Set feature flags for HDF5 SWMR support in netcdf_meta.h/nc-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Mar 7, 2023
1 parent ccdc9ff commit 2509d84
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,7 @@ is_enabled(ENABLE_V2_API HAS_NC2)
is_enabled(ENABLE_NETCDF_4 HAS_NC4)
is_enabled(ENABLE_HDF4 HAS_HDF4)
is_enabled(USE_HDF5 HAS_HDF5)
is_enabled(HDF5_HAS_SWMR HAS_HDF5_SWMR)
is_enabled(OFF HAS_BENCHMARKS)
is_enabled(STATUS_PNETCDF HAS_PNETCDF)
is_enabled(STATUS_PARALLEL HAS_PARALLEL)
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,7 @@ AC_SUBST(HAS_CDF5,[$enable_cdf5])
AC_SUBST(HAS_HDF4,[$enable_hdf4])
AC_SUBST(HAS_BENCHMARKS,[$enable_benchmarks])
AC_SUBST(HAS_HDF5,[$enable_hdf5])
AC_SUBST(HAS_HDF5_SWMR,[$hdf5_swmr])
AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
AC_SUBST(HAS_LOGGING, [$enable_logging])
AC_SUBST(HAS_PARALLEL,[$enable_parallel])
Expand Down Expand Up @@ -2060,6 +2061,7 @@ AX_SET_META([NC_HAS_NC4],[$enable_netcdf_4],[yes])
AX_SET_META([NC_HAS_HDF4],[$enable_hdf4],[yes])
AX_SET_META([NC_HAS_BENCHMARKS],[$enable_benchmarks],[yes])
AX_SET_META([NC_HAS_HDF5],[$enable_hdf5],[yes])
AX_SET_META([NC_HAS_HDF5_SWMR],[$enable_hdf5_swmr],[yes])
AX_SET_META([NC_HAS_DAP2],[$enable_dap],[yes])
AX_SET_META([NC_HAS_DAP4],[$enable_dap4],[yes])
AX_SET_META([NC_HAS_DISKLESS],[yes],[yes])
Expand Down
1 change: 1 addition & 0 deletions include/netcdf_meta.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define NC_HAS_NC4 @NC_HAS_NC4@ /*!< API version 4 support. */
#define NC_HAS_HDF4 @NC_HAS_HDF4@ /*!< HDF4 support. */
#define NC_HAS_HDF5 @NC_HAS_HDF5@ /*!< HDF5 support. */
#define NC_HAS_HDF5_SWMR @NC_HAS_HDF5_SWMR@ /*!< HDF5 single-writer multiple reader support. */
#define NC_HAS_SZIP @NC_HAS_SZIP@ /*!< szip support */
#define NC_HAS_SZIP_WRITE @NC_HAS_SZIP@ /*!< szip write support */
#define NC_HAS_DAP2 @NC_HAS_DAP2@ /*!< DAP2 support. */
Expand Down
13 changes: 13 additions & 0 deletions nc-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ else
has_hdf5="yes"
fi

has_hdf5_swmr="@HDF5_HAS_SWMR@"
if [ -z "$has_hdf5_swmr" -o "$has_hdf5_swmr" = "OFF" ]; then
has_hdf5_swmr="no"
else
has_hdf5_swmr="yes"
fi

has_szlib="@USE_SZIP@"
if [ -z "$has_szlib" -o "$has_szlib" = "OFF" ]; then
has_szlib="no"
Expand Down Expand Up @@ -157,6 +164,7 @@ Available values for OPTION include:
--has-nc2 whether NetCDF-2 API is enabled
--has-nc4 whether NetCDF-4/HDF-5 is enabled in this build
--has-hdf5 whether HDF5 is used in build (always the same as --has-nc4)
--has-hdf5-swmr whether HDF5 single-writer multiple-reader mode is supported
--has-hdf4 whether HDF4 was used in build
--has-logging whether logging is enabled with --enable-logging.
--has-pnetcdf whether PnetCDF was used in build
Expand Down Expand Up @@ -202,6 +210,7 @@ all()
echo " --has-nc2 -> $has_nc2"
echo " --has-nc4 -> $has_nc4"
echo " --has-hdf5 -> $has_hdf5"
echo " --has-hdf5-swmr -> $has_hdf5_swmr"
echo " --has-hdf4 -> $has_hdf4"
echo " --has-logging -> $has_logging"
echo " --has-pnetcdf -> $has_pnetcdf"
Expand Down Expand Up @@ -293,6 +302,10 @@ while test $# -gt 0; do
echo $has_hdf5
;;

--has-hdf5-swmr)
echo $has_hdf5_swmr
;;

--has-hdf4)
echo $has_hdf4
;;
Expand Down
7 changes: 7 additions & 0 deletions nc-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ has_nc4="@HAS_NC4@"
has_hdf4="@HAS_HDF4@"
has_pnetcdf="@HAS_PNETCDF@"
has_hdf5="@HAS_HDF5@"
has_hdf5_swmr="@HAS_HDF5_SWMR@"
has_logging="@HAS_LOGGING@"
has_cdf5="@HAS_CDF5@"
has_szlib="@HAS_SZLIB@"
Expand Down Expand Up @@ -59,6 +60,7 @@ Available values for OPTION include:
--has-nc2 whether NetCDF-2 API is enabled
--has-nc4 whether NetCDF-4/HDF-5 is enabled in this build
--has-hdf5 whether HDF5 is used in build (always the same as --has-nc4)
--has-hdf5-swmr whether HDF5 single-writer multiple-reader mode is supported
--has-hdf4 whether HDF4 was used in build
--has-logging whether logging is enabled with --enable-logging.
--has-pnetcdf whether PnetCDF was used in build
Expand Down Expand Up @@ -101,6 +103,7 @@ all()
echo " --has-nc2 -> $has_nc2"
echo " --has-nc4 -> $has_nc4"
echo " --has-hdf5 -> $has_hdf5"
echo " --has-hdf5-swmr -> $has_hdf5_swmr"
echo " --has-hdf4 -> $has_hdf4"
echo " --has-logging -> $has_logging"
echo " --has-pnetcdf -> $has_pnetcdf"
Expand Down Expand Up @@ -193,6 +196,10 @@ while test $# -gt 0; do
echo $has_hdf5
;;

--has-hdf5-swmr)
echo $has_hdf5_swmr
;;

--has-hdf4)
echo $has_hdf4
;;
Expand Down
1 change: 1 addition & 0 deletions netCDFConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set(netCDF_HAS_NC2 @HAS_NC2@)
set(netCDF_HAS_NC4 @HAS_NC4@)
set(netCDF_HAS_HDF4 @HAS_HDF4@)
set(netCDF_HAS_HDF5 @HAS_HDF5@)
set(netCDF_HAS_HDF5_SWMR @HAS_HDF5_SWMR@)
set(netCDF_HAS_PNETCDF @HAS_PNETCDF@)
set(netCDF_HAS_PARALLEL @HAS_PARALLEL@)
set(netCDF_HAS_DAP @HAS_DAP2@)
Expand Down

0 comments on commit 2509d84

Please sign in to comment.