From 0c883b26e9bcb43d29140cc4f3460551fb45aeed Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Tue, 20 Sep 2022 14:35:27 -0600 Subject: [PATCH 1/2] restore --- nczarr_test/run_unknown.sh | 110 ------------------------------------- 1 file changed, 110 deletions(-) delete mode 100755 nczarr_test/run_unknown.sh diff --git a/nczarr_test/run_unknown.sh b/nczarr_test/run_unknown.sh deleted file mode 100755 index 6e01131241..0000000000 --- a/nczarr_test/run_unknown.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -TESTNCZARR=1 -#!/bin/bash - -if test "x$srcdir" = x ; then srcdir=`pwd`; fi -. ../test_common.sh - -if test "x$TESTNCZARR" = x1 ; then -. "$srcdir/test_nczarr.sh" -fi - -set -e - -# Load the findplugins function -. ${builddir}/findplugin.sh -echo "findplugin.sh loaded" - -# Set up HDF5_PLUGIN_PATH -export HDF5_PLUGIN_PATH=${HDF5_PLUGIN_DIR} - -# Test operation with an unknown filter - -# Function to remove selected -s attributes from file; -# These attributes might be platform dependent -sclean() { - cat $1 \ - | sed -e '/:_IsNetcdf4/d' \ - | sed -e '/:_Endianness/d' \ - | sed -e '/_NCProperties/d' \ - | sed -e '/_SuperblockVersion/d' \ - | cat > $2 -} - -# Function to extract _Filter attribute from a file -# These attributes might be platform dependent -getfilterattr() { -sed -e '/var.*:_Filter/p' -ed <$1 >$2 -} - -# Function to extract _Codecs attribute from a file -# These attributes might be platform dependent -getcodecsattr() { -sed -e '/var.*:_Codecs/p' -ed <$1 >$2 -} - -trimleft() { -sed -e 's/[ ]*\([^ ].*\)/\1/' <$1 >$2 -} - -# Locate the plugin path and the library names; argument order is critical - -# Find noop and capture -findplugin h5unknown -UNKNOWNDIR="${HDF5_PLUGIN_DIR}" -UNKNOWNLIB="${HDF5_PLUGIN_LIB}" -UNKNOWNFILTER="${HDF5_PLUGIN_DIR}/${UNKNOWNLIB}" - -# Getting the name is especially tricky for dylib, which puts the version before the .dylib - -# Verify -if ! test -f ${UNKNOWNFILTER} ; then echo "Unable to locate ${UNKNOWNFILTER}"; exit 1; fi - -testunk() { -zext=$1 -echo "*** Testing access to filter info when filter implementation is not available for map $zext" -if test "x$TESTNCZARR" = x1 ; then -fileargs tmp_known -deletemap $zext $file -else -file="tmp_known_${zfilt}.nc" -rm -f $file -fileurl="$file" -fi -# build .nc file using unknown -${NCGEN} -lb -4 -o $fileurl ${srcdir}/../nc_test4/unknown.cdl -# dump and clean file when filter is avail -${NCDUMP} -hs $fileurl > ./tmp_known_$zext.txt -# Remove irrelevant -s output -sclean ./tmp_known_$zext.txt tmp_known_$zext.dump -# Hide the filter -rm -fr ${UNKNOWNDIR}/save -mkdir -p ${UNKNOWNDIR}/save -# Figure out all matching libs; make sure to remove .so, so.0, etc -LSRC=`${execdir}/../ncdump/ncpathcvt -F "${UNKNOWNDIR}"` -LDST=`${execdir}/../ncdump/ncpathcvt -F ${UNKNOWNDIR}/save` -mv ${LSRC}/*unknown* ${LDST} -# Verify that the filter is no longer defined -# Try to read the data; should xfail -if ${NCDUMP} -s $fileurl > ./tmp_unk_$zext.dmp ; then -echo "*** FAIL: filter found" -found=1 -else -echo "*** XFAIL: filter not found" -found=0 -fi -# Restore the filter -mv ${LDST}/*unknown* ${LSRC} -rm -fr ${UNKNOWNDIR}/save -if test "x$found" = x1 ; then exit 1; fi -} - -if test "x$TESTNCZARR" = x1 ; then - testunk file - if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testunk zip ; fi - if test "x$FEATURE_S3TESTS" = xyes ; then testunk s3 ; fi -else -testunk nc -fi - -exit 0 From 52a4ecad600f7dc30cd063ef182fc3b4e9edc9ab Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sun, 9 Oct 2022 19:32:20 -0600 Subject: [PATCH 2/2] Move construction of VERSION file to end of the build re: https://github.com/Unidata/netcdf-c/issues/2521 Charlie Zender has discovered that the netcdf created file VERSION conflicts with the C++ version file on OSX case-insensitive file systems, and maybe other case-insensitvie file systems. Note: 1. Cmake does not create the VERSION file 2. The VERSION file is not installed 3. It turns out that the VERSION file is not required by the autoconf build. It is possible that clients or package build system (e.g apt or brew) might use the VERSION file, so we cannot delete it altogether. So as a fix, we move the creation of the VERSION file to after the build is complete by inserting a all-local hook into netcdf-c/Makefile.am. # Misc. other changes 1. Suppressed warning by making use of the systeminfo command contingent on the platform being Windows. --- Makefile.am | 8 ++++++++ configure.ac | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index f5ea3906c3..d6e7da0255 100644 --- a/Makefile.am +++ b/Makefile.am @@ -217,3 +217,11 @@ install-data-hook: @echo '| https://www.unidata.ucar.edu |' @echo '+-------------------------------------------------------------+' @echo '' + + +# Create the VERSION file after the build +# in case it is being used by packagers +all-local: liblib/libnetcdf.la + echo ${PACKAGE_VERSION} > VERSION +# Remove the VERSION file +CLEANFILES = VERSION diff --git a/configure.ac b/configure.ac index ee74eefcb0..fafb3034e5 100644 --- a/configure.ac +++ b/configure.ac @@ -36,9 +36,10 @@ AC_SUBST([netCDF_SO_VERSION]) netCDF_SO_VERSION=20:0:1 # pattered after the files generated by libhdf4, libhdf5. ##### -# Create the VERSION file, which contains the package version from -# AC_INIT. -echo AC_PACKAGE_VERSION>VERSION +# Create the VERSION file, which contains the package version from AC_INIT. +# This file is apparently unused. But see the bottom of Makefile.am +# echo AC_PACKAGE_VERSION>VERSION + AC_SUBST(PACKAGE_VERSION) AC_MSG_NOTICE([netCDF AC_PACKAGE_VERSION]) @@ -115,7 +116,11 @@ ISMSYS=yes fi # Get windows version info +if text "x$ISMSVC" = xyes ; then WINVER=`systeminfo | sed -e '/^OS Version:/p' -ed | sed -e 's|[^0-9]*\([0-9.]*\).*|\1|'` +else +WINVER="0.0.0" +fi WINVERMAJOR=`echo $WVER | sed -e 's|\([^.]*\)[.]\([^.]*\)[.]\(.*\)|\1|'` WINVERBUILD=`echo $WVER | sed -e 's|\([^.]*\)[.]\([^.]*\)[.]\(.*\)|\3|'` if test "x$WINVERMAJOR" = x ; then WINVERMAJOR=0; fi