Skip to content

Commit f75c1c4

Browse files
authored
Merge branch 'master' into dispatchversion.dmh
2 parents 125d318 + a9ba3c5 commit f75c1c4

File tree

146 files changed

+4329
-2628
lines changed

Some content is hidden

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

146 files changed

+4329
-2628
lines changed

CMakeLists.txt

+34-4
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ IF(USE_HDF5)
661661
IF(HDF5_VERSION_STRING AND NOT HDF5_VERSION)
662662
SET(HDF5_VERSION ${HDF5_VERSION_STRING})
663663
ENDIF()
664-
665664
IF("${HDF5_VERSION}" STREQUAL "")
666665
MESSAGE(STATUS "Unable to determine hdf5 version. NetCDF requires at least version ${HDF5_VERSION_REQUIRED}")
667666
ELSE()
@@ -723,7 +722,7 @@ IF(USE_HDF5)
723722
FIND_PACKAGE(Threads)
724723

725724
# There is a missing case in the above code so default it
726-
IF(NOT HDF5_C_LIBRARY_HDF5 OR "${HDF5_C_LIBRARY_hdf5}" STREQUAL "" )
725+
IF(NOT HDF5_C_LIBRARY_hdf5 OR "${HDF5_C_LIBRARY_hdf5}" STREQUAL "" )
727726
SET(HDF5_C_LIBRARY_hdf5 "${HDF5_C_LIBRARY}")
728727
ENDIF()
729728

@@ -802,6 +801,15 @@ IF(USE_HDF5)
802801
SET(HAS_PAR_FILTERS no CACHE STRING "")
803802
ENDIF()
804803

804+
# Check to see if HDF5 library is 1.10.6 or greater.
805+
# Used to control path name conversion
806+
IF(${HDF5_VERSION} VERSION_LESS "1.10.6")
807+
SET(HDF5_UTF8_PATHS FALSE)
808+
ELSE()
809+
SET(HDF5_UTF8_PATHS TRUE)
810+
ENDIF()
811+
MESSAGE("-- Checking for HDF5 version 1.10.6 or later: ${HDF5_UTF8_PATHS}")
812+
805813
SET(H5_USE_16_API 1)
806814
OPTION(NC_ENABLE_HDF_16_API "Enable HDF5 1.6.x Compatibility(Required)" ON)
807815
IF(NOT NC_ENABLE_HDF_16_API)
@@ -833,7 +841,7 @@ IF(USE_HDF5)
833841
#option to include HDF5 High Level header file (hdf5_hl.h) in case we are not doing a make install
834842
INCLUDE_DIRECTORIES(${HDF5_HL_INCLUDE_DIR})
835843

836-
# Check to see if we have libcurl 7.66 or later
844+
# Check HDF5 version
837845
CHECK_C_SOURCE_COMPILES("
838846
#include <H5public.h>
839847
int main() {
@@ -941,6 +949,17 @@ OPTION(ENABLE_DAP_LONG_TESTS "Enable DAP long tests." OFF)
941949
OPTION(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON)
942950
SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
943951

952+
# See if we have libzip
953+
FIND_PACKAGE(Zip)
954+
955+
# Define a test flag for have curl library
956+
IF(Zip_FOUND)
957+
INCLUDE_DIRECTORIES(${Zip_INCLUDE_DIRS})
958+
SET(ENABLE_NCZARR_ZIP TRUE)
959+
ELSE()
960+
SET(ENABLE_NCZARR_ZIP FALSE)
961+
ENDIF()
962+
944963
# Enable some developer-only tests
945964
OPTION(ENABLE_EXTRA_TESTS "Enable Extra tests. Some may not work because of known issues. Developers only." OFF)
946965
IF(ENABLE_EXTRA_TESTS)
@@ -1016,6 +1035,10 @@ IF(NOT ENABLE_S3_SDK)
10161035
ENDIF()
10171036
ENDIF()
10181037

1038+
IF(ENABLE_NCZARR_S3_TESTS)
1039+
message(WARNING "**** DO NOT ENABLE_NCZARR_S3_TESTS UNLESS YOU HAVE ACCESS TO THE UNIDATA S3 BUCKET! ***")
1040+
ENDIF()
1041+
10191042
# Start disabling if curl not found
10201043
IF(NOT FOUND_CURL)
10211044
IF(ENABLE_BYTERANGE)
@@ -1035,6 +1058,11 @@ IF(NOT FOUND_CURL)
10351058
ENDIF()
10361059
ENDIF(NOT FOUND_CURL)
10371060

1061+
IF(NOT ENABLE_BYTERANGE AND ENABLE_HDF5_ROS3)
1062+
MESSAGE(WARNING "ROS3 support requires ENABLE_BYTERANGE=TRUE; disabling ROS3 support")
1063+
SET(ENABLE_HDF5_ROS3 OFF CACHE BOOL "ROS3 support" FORCE)
1064+
ENDIF()
1065+
10381066
##
10391067
# Enable Tests
10401068
##
@@ -2144,8 +2172,9 @@ is_enabled(ENABLE_ERANGE_FILL HAS_ERANGE_FILL)
21442172
is_enabled(HAVE_H5Z_SZIP HAS_SZLIB)
21452173
is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)
21462174
is_enabled(ENABLE_NCZARR HAS_NCZARR)
2147-
is_enabled(ENABLE_NCZARR_S3_TESTS DO_S3_TESTS)
2175+
is_enabled(ENABLE_NCZARR_S3_TESTS DO_NCZARR_S3_TESTS)
21482176
is_enabled(ENABLE_MULTIFILTERS HAS_MULTIFILTERS)
2177+
is_enabled(ENABLE_NCZARR_ZIP DO_NCZARR_ZIP_TESTS)
21492178

21502179
# Generate file from template.
21512180
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libnetcdf.settings.in"
@@ -2189,6 +2218,7 @@ configure_file(
21892218
SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/test_common.in)
21902219
SET(TOPSRCDIR "${CMAKE_CURRENT_SOURCE_DIR}")
21912220
SET(TOPBUILDDIR "${CMAKE_CURRENT_BINARY_DIR}")
2221+
SET(ISMSVC "${MSVC}")
21922222
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_common.in ${CMAKE_CURRENT_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF)
21932223

21942224

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ software for various languages:
4747

4848
* [C library and utilities](http://github.com/Unidata/netcdf-c)
4949
* [Fortran](http://github.com/Unidata/netcdf-fortran)
50-
* [Java](http://www.unidata.ucar.edu/downloads/netcdf/netcdf-java-4/)
50+
* [Java](https://www.unidata.ucar.edu/downloads/netcdf-java/
5151
* [Python](http://github.com/Unidata/netcdf4-python)
5252
* [C++](http://github.com/Unidata/netcdf-cxx4)
5353

RELEASE_NOTES.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ This file contains a high-level description of this package's evolution. Release
88
## 4.8.0 - TBD
99

1010
* [Enhancement] Bump the NC_DISPATCH_VERSION from 2 to 3, and as a side effect, unify the definition of NC_DISPATCH_VERSION so it only needs to be defined in CMakeLists.txt and configure.ac. See [Github #1945](https://github.com/Unidata/netcdf-c/pull/1945) for more information.
11+
* [Enhancement] Provide better cross platform path name management. This converts paths for various platforms (e.g. Windows, MSYS, etc.) so that they are in the proper format for the executing platform. See [Github #1958](https://github.com/Unidata/netcdf-c/pull/1958) for more information.
12+
* [Bug Fixes] The nccopy program was treating -d0 as turning deflation on rather than interpreting it as "turn off deflation". See [Github #1944](https://github.com/Unidata/netcdf-c/pull/1944) for more information.
13+
* [Enhancement] Add support for storing NCZarr data in zip files. See [Github #1942](https://github.com/Unidata/netcdf-c/pull/1942) for more information.
1114
* [Bug Fixes] Make fillmismatch the default for DAP2 and DAP4; too many servers ignore this requirement.
1215
* [Bug Fixes] Fix some memory leaks in NCZarr, fix a bug with long strides in NCZarr. See [Github #1913](https://github.com/Unidata/netcdf-c/pull/1913) for more information.
1316
* [Enhancement] Add some optimizations to NCZarr, dosome cleanup of code cruft, add some NCZarr test cases, add a performance test to NCZarr. See [Github #1908](https://github.com/Unidata/netcdf-c/pull/1908) for more information.

cmake/modules/FindZip.cmake

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Searches for an installation of the zip library. On success, it sets the following variables:
2+
#
3+
# Zip_FOUND Set to true to indicate the zip library was found
4+
# Zip_INCLUDE_DIRS The directory containing the header file zip/zip.h
5+
# Zip_LIBRARIES The libraries needed to use the zip library
6+
#
7+
# To specify an additional directory to search, set Zip_ROOT.
8+
#
9+
# Author: Siddhartha Chaudhuri, 2009
10+
#
11+
12+
# Look for the header, first in the user-specified location and then in the system locations
13+
SET(Zip_INCLUDE_DOC "The directory containing the header file zip/zip.h")
14+
FIND_PATH(Zip_INCLUDE_DIRS NAMES zip.h zip/zip.h PATHS ${Zip_ROOT} ${Zip_ROOT}/include DOC ${Zip_INCLUDE_DOC} NO_DEFAULT_PATH)
15+
IF(NOT Zip_INCLUDE_DIRS) # now look in system locations
16+
FIND_PATH(Zip_INCLUDE_DIRS NAMES zip.h zip/zip.h DOC ${Zip_INCLUDE_DOC})
17+
ENDIF(NOT Zip_INCLUDE_DIRS)
18+
19+
SET(Zip_FOUND FALSE)
20+
21+
IF(Zip_INCLUDE_DIRS)
22+
SET(Zip_LIBRARY_DIRS ${Zip_INCLUDE_DIRS})
23+
24+
IF("${Zip_LIBRARY_DIRS}" MATCHES "/include$")
25+
# Strip off the trailing "/include" in the path.
26+
GET_FILENAME_COMPONENT(Zip_LIBRARY_DIRS ${Zip_LIBRARY_DIRS} PATH)
27+
ENDIF("${Zip_LIBRARY_DIRS}" MATCHES "/include$")
28+
29+
IF(EXISTS "${Zip_LIBRARY_DIRS}/lib")
30+
SET(Zip_LIBRARY_DIRS ${Zip_LIBRARY_DIRS}/lib)
31+
ENDIF(EXISTS "${Zip_LIBRARY_DIRS}/lib")
32+
33+
# Find Zip libraries
34+
FIND_LIBRARY(Zip_DEBUG_LIBRARY NAMES zipd zip_d libzipd libzip_d libzip
35+
PATH_SUFFIXES Debug ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Debug
36+
PATHS ${Zip_LIBRARY_DIRS} NO_DEFAULT_PATH)
37+
FIND_LIBRARY(Zip_RELEASE_LIBRARY NAMES zip libzip
38+
PATH_SUFFIXES Release ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Release
39+
PATHS ${Zip_LIBRARY_DIRS} NO_DEFAULT_PATH)
40+
41+
SET(Zip_LIBRARIES )
42+
IF(Zip_DEBUG_LIBRARY AND Zip_RELEASE_LIBRARY)
43+
SET(Zip_LIBRARIES debug ${Zip_DEBUG_LIBRARY} optimized ${Zip_RELEASE_LIBRARY})
44+
ELSEIF(Zip_DEBUG_LIBRARY)
45+
SET(Zip_LIBRARIES ${Zip_DEBUG_LIBRARY})
46+
ELSEIF(Zip_RELEASE_LIBRARY)
47+
SET(Zip_LIBRARIES ${Zip_RELEASE_LIBRARY})
48+
ENDIF(Zip_DEBUG_LIBRARY AND Zip_RELEASE_LIBRARY)
49+
50+
IF(Zip_LIBRARIES)
51+
SET(Zip_FOUND TRUE)
52+
ENDIF(Zip_LIBRARIES)
53+
ENDIF(Zip_INCLUDE_DIRS)
54+
55+
IF(Zip_FOUND)
56+
# IF(NOT Zip_FIND_QUIETLY)
57+
MESSAGE(STATUS "Found Zip: headers at ${Zip_INCLUDE_DIRS}, libraries at ${Zip_LIBRARY_DIRS}")
58+
MESSAGE(STATUS " library is ${Zip_LIBRARIES}")
59+
# ENDIF(NOT Zip_FIND_QUIETLY)
60+
ELSE(Zip_FOUND)
61+
IF(Zip_FIND_REQUIRED)
62+
MESSAGE(FATAL_ERROR "Zip library not found")
63+
ENDIF(Zip_FIND_REQUIRED)
64+
ENDIF(Zip_FOUND)

config.h.cmake.in

+6
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ are set when opening a binary file on Windows. */
156156
/* if true, enable S3 support */
157157
#cmakedefine ENABLE_NCZARR_S3 1
158158

159+
/* if true, enable nczarr zip support */
160+
#cmakedefine ENABLE_NCZARR_ZIP 1
161+
159162
/* if true, enable S3 testing*/
160163
#cmakedefine ENABLE_NCZARR_S3_TESTS 1
161164

@@ -310,6 +313,9 @@ are set when opening a binary file on Windows. */
310313
/* Define to 1 if you have the `MPI_Comm_f2c' function. */
311314
#cmakedefine HAVE_MPI_COMM_F2C 1
312315

316+
/* Define to 1 if you have the `MPI_Info_f2c' function. */
317+
#cmakedefine HAVE_MPI_INFO_F2C 1
318+
313319
/* Define to 1 if you have the `mremap' function. */
314320
#cmakedefine HAVE_MREMAP 1
315321

configure.ac

+24-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ AC_MSG_NOTICE([checking supported formats])
7979
# An explicit disable of netcdf-4 | netcdf4 is treated as if it was disable-hdf5
8080
AC_MSG_CHECKING([whether we should build with netcdf4 (alias for HDF5)])
8181
AC_ARG_ENABLE([netcdf4], [AS_HELP_STRING([--disable-netcdf4],
82-
[(synonym for --enable-hdf5)])])
82+
[(deprecated synonym for --enable-hdf5)])])
8383
test "x$enable_netcdf4" = xno || enable_netcdf4=yes
84-
AC_MSG_RESULT([$enable_netcdf4])
84+
AC_MSG_RESULT([$enable_netcdf4 (deprecated; Please use with --disable-hdf5)])
8585
AC_MSG_CHECKING([whether we should build with netcdf-4 (alias for HDF5)])
8686
AC_ARG_ENABLE([netcdf-4], [AS_HELP_STRING([--disable-netcdf-4],
8787
[(synonym for --disable-netcdf4)])])
@@ -629,6 +629,27 @@ if test "x$enable_nczarr_s3_tests" = xyes ; then
629629
fi
630630
AM_CONDITIONAL(ENABLE_NCZARR_S3_TESTS, [test "x$enable_nczarr_s3_tests" = xyes])
631631

632+
if test "x$enable_nczarr_s3_tests" = xyes ; then
633+
AC_MSG_WARN([*** DO NOT ENABLE_NCZARR_S3_TESTS UNLESS YOU HAVE ACCESS TO THE UNIDATA S3 BUCKET! ***])
634+
fi
635+
636+
# Set default
637+
# See if we have libzip
638+
AC_CHECK_LIB([zip],[zip_open],[have_zip=yes],[have_zip=no])
639+
if test "x$have_zip" = "xyes" ; then
640+
AC_SEARCH_LIBS([zip_open],[zip zip.dll cygzip.dll], [],
641+
[AC_MSG_ERROR([libzip search failed.])])
642+
fi
643+
AC_MSG_CHECKING([whether libzip library is available])
644+
AC_MSG_RESULT([${have_zip}])
645+
646+
enable_nczarr_zip=${have_zip} # alias
647+
648+
if test "x$enable_nczarr_zip" = xyes ; then
649+
AC_DEFINE([ENABLE_NCZARR_ZIP], [1], [If true, then libzip found])
650+
fi
651+
AM_CONDITIONAL(ENABLE_NCZARR_ZIP, [test "x$enable_nczarr_zip" = xyes])
652+
632653
# Did the user specify a default cache size for NCZarr?
633654
AC_MSG_CHECKING([whether a default file cache size for NCZarr was specified])
634655
AC_ARG_WITH([chunk-cache-size-nczarr],
@@ -1589,6 +1610,7 @@ AC_SUBST([HAS_PAR_FILTERS], [$hdf5_supports_par_filters])
15891610
AC_SUBST(HAS_NCZARR,[$enable_nczarr])
15901611
AC_SUBST(DO_NCZARR_S3_TESTS,[$enable_nczarr_s3_tests])
15911612
AC_SUBST(HAS_MULTIFILTERS,[$has_multifilters])
1613+
AC_SUBST(DO_NCZARR_ZIP_TESTS,[$enable_nczarr_zip])
15921614

15931615
# Include some specifics for netcdf on windows.
15941616
#AH_VERBATIM([_WIN32_STRICMP],

dap4_test/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ clean-local: clean-local-check
7373

7474
clean-local-check:
7575
-rm -rf results results_test_parse results_test_data \
76-
results_test_hyrax results_test_meta
76+
results_test_hyrax results_test_meta results_test_raw
7777
-rm -f .dodsrc .daprc
7878

7979
# The shell file maketests.sh is used to build the testdata

dap4_test/dump.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#endif
2222

2323
#include "netcdf.h"
24+
#include "netcdf_aux.h"
2425
#include "ncbytes.h"
2526
#include "ncpathmgr.h"
2627

2728
extern void NCD4_dumpbytes(size_t size, const void* data0, int swap);
2829
extern void NCD4_tagdump(size_t size, const void* data0, int swap, const char* tag);
29-
extern int NC_readfile(const char* filename, NCbytes* content);
3030

3131
static char* progname = NULL;
3232

@@ -42,7 +42,6 @@ main(int argc, char *argv[])
4242
{
4343
int c;
4444
char* fname = NULL;
45-
NCbytes* contents = ncbytesnew();
4645
char* tag = NULL;
4746
size_t offset = 0;
4847
size_t len = 0;
@@ -81,12 +80,10 @@ main(int argc, char *argv[])
8180
}
8281

8382
if(tag == NULL) tag = strdup(progname);
84-
if(NC_readfile(fname,contents)) usage();
85-
len = ncbyteslength(contents) - offset;
86-
data = (char*)ncbytescontents(contents);
83+
if(ncaux_readfile(fname,&len,&((void*)data))) usage();
8784
data += offset;
8885
NCD4_tagdump(len,data,swap,tag);
89-
86+
nullfree(data);
9087
return 0;
9188
}
9289

0 commit comments

Comments
 (0)