diff --git a/CMakeLists.txt b/CMakeLists.txt index 08e21f8e2d..7adc310a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2051,6 +2051,7 @@ is_enabled(ENABLE_HDF4 HAS_HDF4) is_enabled(USE_HDF5 HAS_HDF5) is_enabled(USE_SZIP HAS_SZIP) is_enabled(USE_SZIP HAS_SZIP_WRITE) +is_enabled(USE_SZIP HAS_SZLIB_WRITE) is_enabled(STATUS_PNETCDF HAS_PNETCDF) is_enabled(STATUS_PARALLEL HAS_PARALLEL) is_enabled(ENABLE_PARALLEL4 HAS_PARALLEL4) diff --git a/configure.ac b/configure.ac index 86cd3b66b8..9bcbf3c513 100644 --- a/configure.ac +++ b/configure.ac @@ -1494,14 +1494,15 @@ enable_filter_testing=no enable_clientside_filters=no fi -AM_CONDITIONAL(ENABLE_CLIENTSIDE_FILTERS, [test x$enable_clientside_filters = xyes]) -AM_CONDITIONAL(ENABLE_FILTER_TESTING, [test x$enable_filter_testing = xyes]) - if test "x$enable_shared" = xno ; then AC_MSG_WARN([Shared libraries are disabled => --disable-filter-testing]) enable_filter_testing=no fi +AM_CONDITIONAL(ENABLE_CLIENTSIDE_FILTERS, [test x$enable_clientside_filters = xyes]) +AM_CONDITIONAL(ENABLE_FILTER_TESTING, [test x$enable_filter_testing = xyes]) + + AC_SUBST(NC_LIBS,[$NC_LIBS]) AC_SUBST(HAS_DAP,[$enable_dap]) AC_SUBST(HAS_DAP2,[$enable_dap]) diff --git a/libdispatch/ncbytes.c b/libdispatch/ncbytes.c index 11fbfd6ded..81e7e7fbeb 100644 --- a/libdispatch/ncbytes.c +++ b/libdispatch/ncbytes.c @@ -62,7 +62,7 @@ ncbytessetalloc(NCbytes* bb, unsigned long sz) return TRUE; } -void +EXTERNL void ncbytesfree(NCbytes* bb) { if(bb == NULL) return; diff --git a/libnczarr/zdebug.c b/libnczarr/zdebug.c index 0759fe210e..8ef1c1fb79 100644 --- a/libnczarr/zdebug.c +++ b/libnczarr/zdebug.c @@ -11,6 +11,13 @@ /* Mnemonic */ #define RAW 1 +/**************************************************/ +/* Data Structure */ + +struct ZUTEST* zutest = NULL; + +/**************************************************/ + #ifdef ZCATCH /* Place breakpoint here to catch errors close to where they occur*/ int @@ -34,13 +41,6 @@ zthrow(int err, const char* file, int line) } #endif -/**************************************************/ -/* Data Structure */ - -#ifdef ZUT -struct ZUTEST zutest; -#endif - /**************************************************/ /* Data Structure printers */ diff --git a/libnczarr/zdebug.h b/libnczarr/zdebug.h index d5c6544dd3..5c5bb31786 100644 --- a/libnczarr/zdebug.h +++ b/libnczarr/zdebug.h @@ -5,9 +5,6 @@ #ifndef ZDEBUG_H #define ZDEBUG_H -/* Enable unit testing; on by default */ -#define ZUT - #undef ZDEBUG /* general debug */ #undef ZDEBUG1 /* detailed debug */ @@ -65,12 +62,11 @@ EXTERNL void NCZbacktrace(void); #define UTEST_WALK 2 #define UTEST_TRANSFER 4 -#ifdef ZUT -EXTERNL struct ZUTEST { +struct ZUTEST { int tests; void (*print)(int sort,...); -} zutest; -#endif +}; +EXTERNL struct ZUTEST* zutest; #endif /*ZDEBUG_H*/ diff --git a/libnczarr/zwalk.c b/libnczarr/zwalk.c index 11ac198bcf..f50d29d38e 100644 --- a/libnczarr/zwalk.c +++ b/libnczarr/zwalk.c @@ -172,10 +172,8 @@ fprintf(stderr,"allprojections:\n%s",nczprint_allsliceprojections(common->rank,c slpslices[r] = proj[r]->chunkslice; memslices[r] = proj[r]->memslice; } -#ifdef ZUT - if(zutest.tests & UTEST_TRANSFER) - zutest.print(UTEST_TRANSFER, common, chunkodom, slpslices, memslices); -#endif + if(zutest && zutest->tests & UTEST_TRANSFER) + zutest->print(UTEST_TRANSFER, common, chunkodom, slpslices, memslices); slpodom = nczodom_fromslices(common->rank,slpslices); memodom = nczodom_fromslices(common->rank,memslices); @@ -251,10 +249,8 @@ fflush(stderr); #endif LOG((1,"%s: slpptr0=%p memptr0=%p slpoffset=%llu memoffset=%lld",__func__,slpptr0,memptr0,slpoffset,memoffset)); -#ifdef ZUT - if(zutest.tests & UTEST_WALK) - zutest.print(UTEST_WALK, common, chunkodom, slpodom, memodom); -#endif + if(zutest && zutest->tests & UTEST_WALK) + zutest->print(UTEST_WALK, common, chunkodom, slpodom, memodom); if((stat = transfern(slpodom,memodom,common,slpptr0,memptr0))) goto done; nczodom_next(memodom); } else break; /* slpodom exhausted */ diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt index eb8858f820..0a6d325587 100644 --- a/ncdump/CMakeLists.txt +++ b/ncdump/CMakeLists.txt @@ -25,6 +25,11 @@ ADD_EXECUTABLE(ncdump ${ncdump_FILES}) ADD_EXECUTABLE(nccopy ${nccopy_FILES}) ADD_EXECUTABLE(ncvalidator ${ncvalidator_FILES}) +IF(USE_HDF5) + SET(nc4print_FILES nc4print.c) + ADD_EXECUTABLE(nc4print ${nc4print_FILES}) +ENDIF(USE_HDF5) + IF(ENABLE_DAP) ADD_EXECUTABLE(ocprint ${ocprint_FILES}) ENDIF(ENABLE_DAP) @@ -33,6 +38,10 @@ TARGET_LINK_LIBRARIES(ncdump netcdf ${ALL_TLL_LIBS}) TARGET_LINK_LIBRARIES(nccopy netcdf ${ALL_TLL_LIBS}) TARGET_LINK_LIBRARIES(ncvalidator netcdf ${ALL_TLL_LIBS}) +IF(USE_HDF5) + TARGET_LINK_LIBRARIES(nc4print netcdf ${ALL_TLL_LIBS}) +ENDIF(USE_HDF5) + IF(ENABLE_DAP) TARGET_LINK_LIBRARIES(ocprint netcdf ${ALL_TLL_LIBS}) ENDIF(ENABLE_DAP) @@ -65,6 +74,16 @@ IF(MSVC) SET_TARGET_PROPERTIES(ncvalidator PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) + IF(USE_HDF5) + + SET_TARGET_PROPERTIES(ncvalidator PROPERTIES RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}) + SET_TARGET_PROPERTIES(ncvalidator PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + ${CMAKE_CURRENT_BINARY_DIR}) + SET_TARGET_PROPERTIES(ncvalidator PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE + ${CMAKE_CURRENT_BINARY_DIR}) + ENDIF(USE_HDF5) + IF(ENABLE_DAP) SET_TARGET_PROPERTIES(ocprint PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) @@ -272,7 +291,7 @@ ENDIF(MSVC) SET_TESTS_PROPERTIES(ncdump_run_ncgen_nc4_tests.sh ncdump_tst_nccopy4.sh ncdump_tst_ncgen_shared.sh ncdump_tst_netcdf4.sh PROPERTIES ENVIRONMENT NC_VLEN_NOTEST=1) ENDIF() - + ENDIF() ENDIF() diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am index 6cf1bf9047..4deab81b48 100644 --- a/ncdump/Makefile.am +++ b/ncdump/Makefile.am @@ -44,12 +44,14 @@ ncvalidator_SOURCES = ncvalidator.c # A simple netcdf-4 metadata -> xml printer. Do not install. if USE_HDF5 +bin_PROGRAMS += nc4print noinst_PROGRAMS += nc4print nc4print_SOURCES = nc4print.c endif # Conditionally build the ocprint program, but do not install if ENABLE_DAP +bin_PROGRAMS += ocprint noinst_PROGRAMS += ocprint ocprint_SOURCES = ocprint.c endif diff --git a/nczarr_test/ut_chunking.c b/nczarr_test/ut_chunking.c index e0b9f456be..8199c3cb93 100755 --- a/nczarr_test/ut_chunking.c +++ b/nczarr_test/ut_chunking.c @@ -3,8 +3,6 @@ * See netcdf/COPYRIGHT file for copying and redistribution conditions. */ -#define ZUT - #include "ut_includes.h" void ut_chunk_print(int sort, ...); @@ -29,8 +27,9 @@ main(int argc, char** argv) if((stat = ut_init(argc, argv, &utoptions))) goto done; /* Set the printer */ - zutest.tests = UTEST_RANGE; - zutest.print = ut_chunk_print; + zutester.tests = UTEST_RANGE; + zutester.print = ut_chunk_print; + zutest = &zutester; var = nclistget(utoptions.vardefs,0); diff --git a/nczarr_test/ut_includes.h b/nczarr_test/ut_includes.h index c1de825ffe..7dbcc47a4d 100644 --- a/nczarr_test/ut_includes.h +++ b/nczarr_test/ut_includes.h @@ -25,4 +25,6 @@ #include "ut_test.h" #include "ut_util.h" +static struct ZUTEST zutester; + #endif /*UT_INCLUDES_H*/ diff --git a/nczarr_test/ut_projections.c b/nczarr_test/ut_projections.c index 0eaa97ec49..3433746b97 100644 --- a/nczarr_test/ut_projections.c +++ b/nczarr_test/ut_projections.c @@ -27,8 +27,9 @@ main(int argc, char** argv) if((stat = ut_init(argc, argv, &utoptions))) goto done; /* printer off for these tests */ - zutest.tests = 0; - zutest.print = NULL; + zutester.tests = 0; + zutester.print = NULL; + zutest = &zutester; var = nclistget(utoptions.vardefs,0);