Skip to content

Commit 7b09290

Browse files
Improve filter installation process to avoid use of an extra shell script
re: Unidata#2338 re: Unidata#2294 In issue Unidata#2338, Ed Hartnett suggested a better way to install filters to a user defined location -- for Automake, anyway. This PR implements that suggestion. It turns out to be more complicated than it appears, so there are fair number of changes; mostly to shell scripts. Most of the change is in plugins/Makefile.am. NOTE: this PR still does NOT address the use of HDF5_PLUGIN_PATH as the default; this turns out to be complex when dealing with NCZarr. So this will be addressed in a subsequent post 4.9.0 PR. ## Misc. Changes 1. Record the occurrences of incomplete codecs in libnczarr so that they can be included in _Codecs attribute correctly. This allows users to see what missing filters are referenced in the Zarr file. Primarily affects libnczarr/zfilter.[ch]. Also required creating a new no-effect filter: H5Zunknown.c. 2. Move the unknown filter test to a separate test file. 3. Incorporates PR Unidata#2343
1 parent 0dd0769 commit 7b09290

41 files changed

Lines changed: 1004 additions & 322 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,10 +1862,10 @@ ENDIF(ENABLE_MMAP)
18621862
#CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
18631863

18641864
# Used in the `configure_file` calls below
1865-
SET(ISCMAKE "1")
1865+
SET(ISCMAKE "yes")
18661866
IF(MSVC)
1867-
SET(ISMSVC ON CACHE BOOL "" FORCE)
1868-
SET(REGEDIT ON CACHE BOOL "" FORCE)
1867+
SET(ISMSVC yes CACHE BOOL "" FORCE)
1868+
SET(REGEDIT yes CACHE BOOL "" FORCE)
18691869
# Get windows major version and build number
18701870
EXECUTE_PROCESS(COMMAND "systeminfo" OUTPUT_VARIABLE WININFO)
18711871
IF(WININFO STREQUAL "")
@@ -2509,25 +2509,15 @@ configure_file(
25092509
SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/test_common.in)
25102510
SET(TOPSRCDIR "${CMAKE_CURRENT_SOURCE_DIR}")
25112511
SET(TOPBUILDDIR "${CMAKE_CURRENT_BINARY_DIR}")
2512-
SET(ISMSVC "${MSVC}")
25132512
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_common.in ${CMAKE_CURRENT_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF)
25142513

25152514
#####
2516-
# Build nc_test4/findplugin.sh
2515+
# Build and copy nc_test4/findplugin.sh to various places
25172516
#####
25182517
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/nc_test4/findplugin.sh @ONLY NEWLINE_STYLE LF)
2519-
2520-
IF(ENABLE_NCZARR)
25212518
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/nczarr_test/findplugin.sh @ONLY NEWLINE_STYLE LF)
2522-
ENDIF()
2523-
2524-
IF(ENABLE_PLUGINS)
25252519
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/plugins/findplugin.sh @ONLY NEWLINE_STYLE LF)
2526-
ENDIF()
2527-
2528-
IF(ENABLE_EXAMPLES)
25292520
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/examples/C/findplugin.sh @ONLY NEWLINE_STYLE LF)
2530-
ENDIF()
25312521

25322522
IF(ENABLE_TESTS)
25332523
#####

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.8.2 - TBD
99

10+
* [Enhancement] Improve filter installation process to avoid use of an extra shell script. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????).
11+
* [Bug Fix] Get "make distcheck" to work See [Github #/2343](https://github.com/Unidata/netcdf-c/pull/2343).
1012
* [Enhancement] Update the documentation to match the current filter capabilities See [Github #2249](https://github.com/Unidata/netcdf-c/pull/2249).
1113
* [Enhancement] Support installation of pre-built standard filters into user-specified location. See [Github #2318](https://github.com/Unidata/netcdf-c/pull/2318).
1214
* [Enhancement] Improve filter support. More specifically (1) add nc_inq_filter_avail to check if a filter is available, (2) add the notion of standard filters, (3) cleanup szip support to fix interaction with NCZarr. See [Github #2245](https://github.com/Unidata/netcdf-c/pull/2245).

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,10 +1993,10 @@ AC_CONFIG_FILES(nczarr_test/findplugin.sh:nc_test4/findplugin.in)
19931993
AC_CONFIG_FILES(plugins/findplugin.sh:nc_test4/findplugin.in)
19941994
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
19951995
AC_CONFIG_FILES(ncdap_test/findtestserver.c:ncdap_test/findtestserver.c.in)
1996+
AC_CONFIG_FILES([nc_test/run_pnetcdf_tests.sh:nc_test/run_pnetcdf_tests.sh.in],[chmod ugo+x nc_test/run_pnetcdf_tests.sh])
19961997
AC_CONFIG_FILES(dap4_test/findtestserver4.c:ncdap_test/findtestserver.c.in)
19971998
AC_CONFIG_FILES(dap4_test/pingurl4.c:ncdap_test/pingurl.c)
19981999
AC_CONFIG_FILES([h5_test/run_par_tests.sh], [chmod ugo+x h5_test/run_par_tests.sh])
1999-
AC_CONFIG_FILES([nc_test/run_pnetcdf_tests.sh], [chmod ugo+x nc_test/run_pnetcdf_tests.sh])
20002000
AC_CONFIG_FILES([nc_test4/run_par_test.sh], [chmod ugo+x nc_test4/run_par_test.sh])
20012001
AC_CONFIG_FILES([nc_perf/run_par_bm_test.sh], [chmod ugo+x nc_perf/run_par_bm_test.sh])
20022002
AC_CONFIG_FILES([nc_perf/run_gfs_test.sh], [chmod ugo+x nc_perf/run_gfs_test.sh])

dap4_test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LDADD = ${top_builddir}/liblib/libnetcdf.la
1919
AM_CPPFLAGS += -I$(top_srcdir)/liblib
2020
AM_CPPFLAGS += -I$(top_srcdir)/libdap4
2121
AM_CPPFLAGS += -DTOPSRCDIR=${abs_top_srcdir}
22-
AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
22+
AM_CPPFLAGS += -DTOPBINDIR=${abs_top_builddir}
2323

2424
# Set up the tests; do the .sh first, then .c
2525
check_PROGRAMS =

examples/C/run_filter.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ set -e
1515

1616
echo "*** running test_filter example..."
1717
. ${builddir}/findplugin.sh
18+
echo "findplugin.sh loaded"
1819

1920
# Locate the plugin path and the library names; argument order is critical
2021
# Find bzip2 and capture
2122
findplugin h5bzip2
22-
BZIP2PATH="${HDF5_PLUGIN_DIR}/${HDF5_PLUGIN_LIB}"
23+
BZIP2LIB="${HDF5_PLUGIN_LIB}"
24+
BZIP2DIR="${HDF5_PLUGIN_DIR}"
25+
BZIP2PATH="${BZIP2DIR}/${BZIP2LIB}"
2326

2427
# Verify
2528
if ! test -f ${BZIP2PATH} ; then echo "Unable to locate ${BZIP2PATH}"; exit 1; fi

libnczarr/zclose.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ zclose_vars(NC_GRP_INFO_T* grp)
167167
#ifdef ENABLE_NCZARR_FILTERS
168168
/* Reclaim filters */
169169
if(var->filters != NULL) {
170-
(void)NCZ_filter_freelist(var);
170+
(void)NCZ_filter_freelists(var);
171171
}
172172
var->filters = NULL;
173173
#endif

0 commit comments

Comments
 (0)