From c4ecdd640357eda178b0217882c89813e15ef9d6 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 24 Jul 2023 16:20:26 -0600 Subject: [PATCH 1/2] Fix a number of minor bugs 1. Fix a shift bug in ncexhash.c (Issue https://github.com/Unidata/netcdf-c/issues/2702) 2. Fix an S3 related error in test_byterange.sh 3. Fix bz2/bzip2 handling in configure.ac --- configure.ac | 11 +++++++++++ libdispatch/ncexhash.c | 2 +- nc_test/test_byterange.sh | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9acb948729..264332ed04 100644 --- a/configure.ac +++ b/configure.ac @@ -749,6 +749,17 @@ fi AC_MSG_CHECKING([whether libbz2 library is available]) AC_MSG_RESULT([${have_bz2}]) +if test "x$have_bz2" = x ; then +# How about bzip2 +AC_CHECK_LIB([bzip2],[BZ2_bzCompress],[have_bz2=yes],[have_bz2=no]) +if test "x$have_bz2" = "xyes" ; then + AC_SEARCH_LIBS([BZ2_bzCompress],[bzip2 bzip2.dll cygbzip2.dll], [], []) + AC_DEFINE([HAVE_BZ2], [1], [if true, bzip2 library is installed]) +fi +AC_MSG_CHECKING([whether libbzip2 library is available]) +AC_MSG_RESULT([${have_bz2}]) +fi + if test "x$have_bz2" = "xno" ; then have_local_bz2=yes AC_MSG_NOTICE([Defaulting to internal libbz2]) diff --git a/libdispatch/ncexhash.c b/libdispatch/ncexhash.c index dcaa919dca..d1677805e7 100644 --- a/libdispatch/ncexhash.c +++ b/libdispatch/ncexhash.c @@ -854,7 +854,7 @@ ncexhashprintstats(NCexhashmap* map) fprintf(stderr," |leaf|=%d nactive/nleaves=%g", map->leaflen, leafavg); fprintf(stderr," load=%g",leafload); fprintf(stderr,"]\n"); - dirsize = (1<<(map->depth)*((unsigned long long)sizeof(void*))); + dirsize = (1<<(map->depth))*((unsigned long long)sizeof(void*)); leafsize = (nleaves)*((unsigned long long)sizeof(NCexleaf)); total = dirsize + leafsize; fprintf(stderr,"\tsizeof(directory)=%llu sizeof(leaves)=%lld total=%lld\n", diff --git a/nc_test/test_byterange.sh b/nc_test/test_byterange.sh index 38923bfa03..59fc07ea68 100755 --- a/nc_test/test_byterange.sh +++ b/nc_test/test_byterange.sh @@ -26,9 +26,10 @@ URL4d="s3://unidata-zarr-test-data/byterangefiles/upload4.nc#bytes&aws.profile=u fi URL4f="https://crudata.uea.ac.uk/cru/data/temperature/HadCRUT.4.6.0.0.median.nc#mode=bytes" +if test "x$FEATURE_S3TESTS" = xyes ; then # Do not use unless we know it has some permanence (note the segment 'testing' in the URL); URL4x="https://s3.us-west-2.amazonaws.com/coawst-public/testing/HadCRUT.4.6.0.0.median.nc#mode=bytes,&aws.profile=none" - +fi echo "" @@ -86,7 +87,9 @@ ${NCDUMP} -n nc_enddef "$U" >tmp_${TAG}.cdl diff -wb tmp_$TAG.cdl ${srcdir}/nc_enddef.cdl } +if test "x$FEATURE_S3TESTS" = xyes ; then testsetup https://s3.us-east-1.amazonaws.com/unidata-zarr-test-data +fi echo "*** Testing reading NetCDF-3 file with http" From ccfe62de72875348d84b2cce75899eb1a11b9761 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 11 Aug 2023 11:29:30 -0600 Subject: [PATCH 2/2] Fix a missing 'fi' --- configure.ac | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 94dd4bdbf6..7a67b53d6c 100644 --- a/configure.ac +++ b/configure.ac @@ -799,7 +799,7 @@ AC_ARG_ENABLE([filter-bz2], [AS_HELP_STRING([--disable-filter-bz2], [disable external bz2 filter support. bz2 support defaults to internal implementation if this is disabled or if the external library is not found.])]) test "x$enable_filter_bz2" = xno || enable_filter_bz2=yes -AC_MSG_RESULT($enable_filter_bz2) +AC_MSG_RESULT([$enable_filter_bz2]) if test "x$enable_filter_bz2" = "xyes" ; then @@ -811,15 +811,20 @@ if test "x$enable_filter_bz2" = "xyes" ; then AC_MSG_CHECKING([whether libbz2 library is available]) AC_MSG_RESULT([${have_bz2}]) -if test "x$have_bz2" = x ; then -# How about bzip2 -AC_CHECK_LIB([bzip2],[BZ2_bzCompress],[have_bz2=yes],[have_bz2=no]) -if test "x$have_bz2" = "xyes" ; then - AC_SEARCH_LIBS([BZ2_bzCompress],[bzip2 bzip2.dll cygbzip2.dll], [], []) - AC_DEFINE([HAVE_BZ2], [1], [if true, bzip2 library is installed]) fi -AC_MSG_CHECKING([whether libbzip2 library is available]) -AC_MSG_RESULT([${have_bz2}]) + +# How about bzip2 + +if test "x$have_bz2" = x ; then + + AC_CHECK_LIB([bzip2],[BZ2_bzCompress],[have_bz2=yes],[have_bz2=no]) + if test "x$have_bz2" = "xyes" ; then + AC_SEARCH_LIBS([BZ2_bzCompress],[bzip2 bzip2.dll cygbzip2.dll], [], []) + AC_DEFINE([HAVE_BZ2], [1], [if true, bzip2 library is installed]) + fi + AC_MSG_CHECKING([whether libbzip2 library is available]) + AC_MSG_RESULT([${have_bz2}]) + fi if test "x$have_bz2" = "xno" ; then