Skip to content

Commit 0ea284d

Browse files
committed
Make libnetcdff.settings.in a little more verbose. If HDF5_PLUGIN_PATH is not set but zstd support is enabled in libnetcdf-c, zstd support is disabled in libnetcdff, but a diagnostic message is printed. Added to autotools, next up: cmake.
1 parent 666eb96 commit 0ea284d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

configure.ac

+13-7
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ if test "x$enable_zstandard_plugin" = xyes; then
7676
choke me
7777
#endif]])], [nc_has_zstd=yes], [nc_has_zstd=no])
7878

79-
if test "x$nc_has_zstd" = xyes; then
80-
81-
AC_DEFINE([ENABLE_ZSTD], [1], [Enable Zstandard compression support])
82-
fi
8379
AC_MSG_RESULT([$nc_has_zstd])
8480

8581
if test "x$nc_has_zstd" = xyes; then
@@ -89,10 +85,16 @@ if test "x$enable_zstandard_plugin" = xyes; then
8985
AC_MSG_WARN([libnetcdf was built with zstd support, but HDF5_PLUGIN_PATH is not set. Either set the HDF5_PLUGIN_PATH environmental variable if zstandard tests fail, or use --disable-zstandard-plugin when running configure.])
9086
AC_MSG_WARN([------------------------------------------])
9187
AC_MSG_WARN([ ])
88+
nf_has_zstd=no
89+
nc_hdf5_plugin_path=""
90+
else
91+
nf_has_zstd=yes
92+
nc_hdf5_plugin_path="(HDF5_PLUGIN_PATH: ${HDF5_PLUGIN_PATH})"
93+
AC_DEFINE([ENABLE_ZSTD], [1], [Enable Zstandard compression support])
9294
fi
9395
fi
9496
else
95-
nc_has_zstd=no
97+
nf_has_zstd=no
9698
fi
9799
###
98100
# End Zstandard logic stanza
@@ -594,6 +596,7 @@ AM_CONDITIONAL([BUILD_PARALLEL4], [test "x$nc_has_parallel4" = xyes])
594596
AM_CONDITIONAL([BUILD_PARALLEL], [test "x$nc_has_pnetcdf" = xyes -o "x$nc_has_parallel4" = xyes])
595597
AM_CONDITIONAL([TEST_FILTERS], [test "x$enable_filter_test" = xyes])
596598

599+
597600
AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE([NO_STDLIB_H], [], [no stdlib.h]))
598601
AC_CHECK_HEADER(sys/types.h, ,AC_DEFINE([NO_SYS_TYPES_H], [], [no sys_types.h]))
599602
AC_CHECK_HEADERS([sys/param.h])
@@ -662,13 +665,14 @@ AC_SUBST(HAS_DAP,[$nc_has_dap])
662665
AC_SUBST(HAS_NC2,[$nc_build_v2])
663666
AC_SUBST(HAS_NC4,[$nc_build_v4])
664667
AC_SUBST(HAS_SZIP_WRITE,[$nc_has_szip_write])
665-
AC_SUBST(HAS_ZSTD,[$nc_has_zstd])
668+
AC_SUBST(HAS_ZSTD,[$nf_has_zstd])
666669
AC_SUBST(HAS_QUANTIZE,[$nc_has_quantize])
667670
AC_SUBST(HAS_LOGGING,[$nc_has_logging])
668671
AC_SUBST(HAS_CDF5,[$nc_has_cdf5])
669672
AC_SUBST(HAS_PNETCDF,[$nc_has_pnetcdf])
670673
AC_SUBST(HAS_NC4_PARALLEL,[$nc_has_parallel4])
671674
AC_SUBST(HAS_PARALLEL,[$nc_has_parallel])
675+
AC_SUBST(NF_HDF5_PLUGIN_PATH, [$nc_hdf5_plugin_path])
672676

673677
# Some files need to exist in build directories that do not correspond
674678
# to their source directory, or the test program makes an assumption
@@ -708,16 +712,18 @@ cat libnetcdff.settings
708712
# we will do it this way.
709713
##
710714
if test "x$nc_has_zstd" = xyes; then
715+
if test "x$nf_has_zstd" = xno; then
711716
if test "x${HDF5_PLUGIN_PATH}" = "x"; then
712717
echo ""
713718
AC_MSG_WARN([ ])
714719
AC_MSG_WARN([------------------------------------------])
715-
AC_MSG_WARN([libnetcdf was built with zstd support, but HDF5_PLUGIN_PATH is not set. Either set the HDF5_PLUGIN_PATH environmental variable if zstandard tests fail, or use --disable-zstandard-plugin when running configure.])
720+
AC_MSG_WARN([libnetcdf was built with zstd support, but HDF5_PLUGIN_PATH is not set, so zstd support is not enabled in libnetcdff. Set HDF5_PLUGIN_PATH and re-run configure if you want to enable zstd support.])
716721
echo ""
717722
AC_MSG_WARN([You can use `nc-config --plugindir` to determine the appropriate value for HDF5_PLUGIN_PATH])
718723
AC_MSG_WARN([------------------------------------------])
719724
AC_MSG_WARN([ ])
720725
fi
726+
fi
721727
fi
722728

723729

libnetcdff.settings.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ Parallel IO: @HAS_PARALLEL@
3333
NetCDF4 Parallel IO: @HAS_NC4_PARALLEL@
3434
PnetCDF Parallel IO: @HAS_PNETCDF@
3535
SZIP Write Support: @HAS_SZIP_WRITE@
36-
Zstandard Support: @HAS_ZSTD@
36+
Zstandard Support: @HAS_ZSTD@ @NF_HDF5_PLUGIN_PATH@
3737
Quantize: @HAS_QUANTIZE@

0 commit comments

Comments
 (0)