Skip to content

Commit ac4ade4

Browse files
committed
Merge branch '4.8.0-wellspring-prs.wif' into 4.8.0-wellspring.wif
2 parents 4a7f5ae + fc4bfc6 commit ac4ade4

19 files changed

+60
-62
lines changed

CMakeLists.txt

+9-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SET(PACKAGE_VERSION ${VERSION})
3737

3838
# Version of the dispatch table. This must match the value in
3939
# configure.ac.
40-
SET(NC_DISPATCH_VERSION 2)
40+
SET(NC_DISPATCH_VERSION 3)
4141

4242
# Get system configuration, Use it to determine osname, os release, cpu. These
4343
# will be used when committing to CDash.
@@ -163,8 +163,6 @@ SET(EXTRA_DEPS "")
163163
# Set CTest Properties
164164
################################
165165

166-
167-
168166
ENABLE_TESTING()
169167
INCLUDE(CTest)
170168

@@ -262,6 +260,7 @@ ENDIF()
262260
#####
263261
# System inspection checks
264262
#####
263+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
265264
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
266265
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/oc2)
267266
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libsrc)
@@ -766,7 +765,6 @@ IF(USE_HDF5)
766765

767766
#Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
768767
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_all_coll_metadata_ops "" HDF5_HAS_COLL_METADATA_OPS)
769-
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HAVE_H5PSET_LIBVER_BOUNDS)
770768
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY)
771769
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5allocate_memory "" HAVE_H5ALLOCATE_MEMORY)
772770
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5resize_memory "" HAVE_H5RESIZE_MEMORY)
@@ -2235,6 +2233,13 @@ configure_file(
22352233
${netCDF_SOURCE_DIR}/include/netcdf_meta.h.in
22362234
${netCDF_BINARY_DIR}/include/netcdf_meta.h @ONLY)
22372235

2236+
#####
2237+
# Create 'netcdf_dispatch.h' include file.
2238+
#####
2239+
configure_file(
2240+
${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h.in
2241+
${netCDF_BINARY_DIR}/include/netcdf_dispatch.h @ONLY NEWLINE_STYLE LF)
2242+
22382243
#####
22392244
# Build test_common.sh
22402245
#####

RELEASE_NOTES.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.8.0 - March 22, 2021
99

10+
* [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.
1011
* [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.
1112
* [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.
1213
* [Enhancement] Add support for storing NCZarr data in zip files. See [Github #1942](https://github.com/Unidata/netcdf-c/pull/1942) for more information.

config.h.cmake.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ are set when opening a binary file on Windows. */
256256
/* Define to 1 if you have the `gettimeofday' function. */
257257
#cmakedefine HAVE_STRUCT_TIMESPEC 1
258258

259-
/* if true, netcdf4 file properties will be set using H5Pset_libver_bounds */
260-
#cmakedefine HAVE_H5PSET_LIBVER_BOUNDS 1
261-
262259
/* Define to 1 if you have the `H5Z_SZIP' function. */
263260
#cmakedefine HAVE_H5Z_SZIP 1
264261

@@ -463,6 +460,9 @@ with zip */
463460
/* Add extra properties to _NCProperties attribute */
464461
#cmakedefine NCPROPERTIES_EXTRA ${NCPROPERTIES_EXTRA}
465462

463+
/* Idspatch table version */
464+
#cmakedefine NC_DISPATCH_VERSION ${NC_DISPATCH_VERSION}
465+
466466
/* no IEEE float on this platform */
467467
#cmakedefine NO_IEEE_FLOAT 1
468468

configure.ac

+7-2
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,8 @@ if test "x$enable_hdf5" = xyes; then
12161216

12171217
# H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12.
12181218
# Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead.
1219-
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops H5Literate])
1219+
1220+
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_all_coll_metadata_ops H5Literate])
12201221

12211222
# Check to see if HDF5 library has H5Literate (HDF5 1.8.x, 1.10.x)
12221223
if test "x$ac_cv_func_H5Literate" = xno; then
@@ -1229,6 +1230,7 @@ if test "x$enable_hdf5" = xyes; then
12291230
AC_MSG_RESULT(yes)
12301231
fi
12311232

1233+
12321234
# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
12331235
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
12341236
AC_DEFINE([HDF5_HAS_COLL_METADATA_OPS], [1], [if true, use collective metadata ops in parallel netCDF-4])
@@ -1700,7 +1702,9 @@ AX_SET_META([NC_HAS_MULTIFILTERS],[$has_multifilters],[yes])
17001702
# applications like PIO can determine whether they have an appropriate
17011703
# dispatch table to submit. If this is changed, make sure the value in
17021704
# CMakeLists.txt also changes to match.
1703-
AC_SUBST([NC_DISPATCH_VERSION], [2])
1705+
1706+
AC_SUBST([NC_DISPATCH_VERSION], [3])
1707+
AC_DEFINE_UNQUOTED([NC_DISPATCH_VERSION], [${NC_DISPATCH_VERSION}], [Dispatch table version.])
17041708

17051709
#####
17061710
# End netcdf_meta.h definitions.
@@ -1734,6 +1738,7 @@ AC_CONFIG_FILES([Makefile
17341738
libnetcdf.settings
17351739
postinstall.sh
17361740
include/netcdf_meta.h
1741+
include/netcdf_dispatch.h
17371742
include/Makefile
17381743
h5_test/Makefile
17391744
hdf4_test/Makefile

h5_test/tst_h_atts3.c

-4
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,7 @@ main()
209209
hid_t file_typeid1[NUM_OBJ_1], native_typeid1[NUM_OBJ_1];
210210
hid_t file_typeid2, native_typeid2;
211211
hsize_t num_obj;
212-
#if H5_VERSION_GE(1,12,0)
213-
H5O_info2_t obj_info;
214-
#else
215212
H5O_info_t obj_info;
216-
#endif
217213
char obj_name[STR_LEN + 1];
218214
hsize_t dims[1] = {ATT_LEN}; /* netcdf attributes always 1-D. */
219215

include/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_filter.h
2828
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
2929
COMPONENT headers)
3030

31-
INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h
31+
INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_dispatch.h
3232
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
3333
COMPONENT headers)
3434

include/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ if ENABLE_BYTERANGE
2929
noinst_HEADERS += nchttp.h
3030
endif
3131

32-
EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in
32+
EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in netcdf_dispatch.in

include/ncdispatch.h

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
#define ATOMICTYPEMAX3 NC_DOUBLE
8181
#define ATOMICTYPEMAX5 NC_UINT64
8282

83-
/* Define an alias for int to indicate an error return */
84-
typedef int NCerror;
85-
8683
#if !defined HDF5_PARALLEL && !defined USE_PNETCDF
8784
typedef int MPI_Comm;
8885
typedef int MPI_Info;

include/nchttp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct NC_HTTP_STATE {
2323
char errbuf[1024]; /* assert(CURL_ERROR_SIZE <= 1024) */
2424
} NC_HTTP_STATE;
2525

26-
extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, size64_t* lenp);
26+
extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, long long* lenp);
2727
extern int nc_http_size(NC_HTTP_STATE* state, const char* url, size64_t* sizep);
2828
extern int nc_http_read(NC_HTTP_STATE* state, const char* url, size64_t start, size64_t count, NCbytes* buf);
2929
extern int nc_http_close(NC_HTTP_STATE* state);

include/netcdf_dispatch.h include/netcdf_dispatch.h.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
/* This is the version of the dispatch table. It should be changed
2727
* when new functions are added to the dispatch table. */
28-
#define NC_DISPATCH_VERSION 3
28+
#ifndef NC_DISPATCH_VERSION
29+
#define NC_DISPATCH_VERSION @NC_DISPATCH_VERSION@
30+
#endif /*NC_DISPATCH_VERSION*/
2931

3032
/* This is the dispatch table, with a pointer to each netCDF
3133
* function. */

libdap2/dapincludes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "oc.h"
3333

3434
#include "ncdap.h"
35+
#include "nccommon.h"
3536
#include "dapdebug.h"
3637
#include "daputil.h"
3738

@@ -47,7 +48,6 @@ struct NCsegment;
4748

4849
/**************************************************/
4950

50-
#include "nccommon.h"
5151
#include "getvara.h"
5252
#include "constraints.h"
5353

libdap2/daputil.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ simplepathstring(NClist* names, char* separator)
435435
/* Define a number of location tests */
436436

437437
/* Is node contained (transitively) in a sequence ? */
438-
BOOL
438+
int
439439
dapinsequence(CDFnode* node)
440440
{
441441
if(node == NULL || node->container == NULL) return TRUE;
@@ -446,7 +446,7 @@ dapinsequence(CDFnode* node)
446446
}
447447

448448
/* Is node contained (transitively) in a structure array */
449-
BOOL
449+
int
450450
dapinstructarray(CDFnode* node)
451451
{
452452
if(node == NULL) return TRUE;
@@ -459,7 +459,7 @@ dapinstructarray(CDFnode* node)
459459
}
460460

461461
/* Is node a map field of a grid? */
462-
BOOL
462+
int
463463
dapgridmap(CDFnode* node)
464464
{
465465
if(node != NULL && node->container != NULL
@@ -471,7 +471,7 @@ dapgridmap(CDFnode* node)
471471
}
472472

473473
/* Is node an array field of a grid? */
474-
BOOL
474+
int
475475
dapgridarray(CDFnode* node)
476476
{
477477
if(node != NULL && node->container != NULL
@@ -482,31 +482,31 @@ dapgridarray(CDFnode* node)
482482
return FALSE;
483483
}
484484

485-
BOOL
485+
int
486486
dapgridelement(CDFnode* node)
487487
{
488488
return dapgridarray(node)
489489
|| dapgridmap(node);
490490
}
491491

492492
/* Is node a top-level grid node? */
493-
BOOL
493+
int
494494
daptopgrid(CDFnode* grid)
495495
{
496496
if(grid == NULL || grid->nctype != NC_Grid) return FALSE;
497497
return daptoplevel(grid);
498498
}
499499

500500
/* Is node a top-level sequence node? */
501-
BOOL
501+
int
502502
daptopseq(CDFnode* seq)
503503
{
504504
if(seq == NULL || seq->nctype != NC_Sequence) return FALSE;
505505
return daptoplevel(seq);
506506
}
507507

508508
/* Is node a top-level node? */
509-
BOOL
509+
int
510510
daptoplevel(CDFnode* node)
511511
{
512512
if(node->container == NULL

libdap2/nccommon.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#include "dapincludes.h"
1010

1111
/* Mnemonics */
12-
#ifndef BOOL
13-
#define BOOL int
14-
#endif
1512
#ifndef TRUE
1613
#define TRUE 1
1714
#define FALSE 0
1815
#endif
1916

17+
/* Define an alias for int to indicate an error return */
18+
typedef int NCerror;
19+
2020
#ifndef nullfree
2121
#define nullfree(m) {if((m)!=NULL) {free(m);} else {}}
2222
#endif
@@ -206,7 +206,7 @@ typedef struct NCD2alignment {
206206
} NCD2alignment;
207207

208208
typedef struct NCtypesize {
209-
BOOL aligned; /* have instance and field been defined? */
209+
int aligned; /* have instance and field been defined? */
210210
NCD2alignment instance; /* Alignment, etc for instance data */
211211
NCD2alignment field; /* Alignment, etc WRT to parent */
212212
} NCtypesize;
@@ -232,13 +232,13 @@ typedef struct CDFnode {
232232
int ncid; /* relevant NC id for this object*/
233233
unsigned long maxstringlength;
234234
unsigned long sequencelimit; /* 0=>unlimited */
235-
BOOL usesequence; /* If this sequence is usable */
236-
BOOL elided; /* 1 => node does not partipate in naming*/
235+
int usesequence; /* If this sequence is usable */
236+
int elided; /* 1 => node does not partipate in naming*/
237237
struct CDFnode* basenode; /* derived tree map to pattern tree */
238-
BOOL invisible; /* 1 => do not show to user */
239-
BOOL zerodim; /* 1 => node has a zero dimension */
238+
int invisible; /* 1 => do not show to user */
239+
int zerodim; /* 1 => node has a zero dimension */
240240
/* These two flags track the effects on grids of constraints */
241-
BOOL nc_virtual; /* node added by regrid */
241+
int nc_virtual; /* node added by regrid */
242242
struct CDFnode* attachment; /* DDS<->DATADDS cross link*/
243243
struct CDFnode* pattern; /* temporary field for regridding */
244244
/* Fields for use by libncdap4 */
@@ -249,8 +249,8 @@ typedef struct CDFnode {
249249
char* vlenname; /* for sequence types */
250250
int singleton; /* for singleton sequences */
251251
unsigned long estimatedsize; /* > 0 Only for var nodes */
252-
BOOL whole; /* projected as whole node */
253-
BOOL prefetchable; /* eligible to be prefetched (if whole) */
252+
int whole; /* projected as whole node */
253+
int prefetchable; /* eligible to be prefetched (if whole) */
254254
} CDFnode;
255255

256256
/**************************************************/

libdap4/ncd4.h

-12
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ extern int dsp_close(ND4dsp* dsp);
7171
/* DSP API */
7272
extern int dsp_open(const char* path, ND4dsp** dspp);
7373

74-
/*
75-
extern NCerror dapbuildvaraprojection(CDFnode*,
76-
const size_t* startp, const size_t* countp, const ptrdiff_t* stridep,
77-
struct DCEprojection** projectionlist);
78-
79-
extern NCerror NCD4_getvarx(int ncid, int varid,
80-
const size_t *startp,
81-
const size_t *countp,
82-
const ptrdiff_t *stridep,
83-
void *data,
84-
nc_type dsttype0);
85-
*/
8674
#endif
8775

8876
/**************************************************/

libdispatch/dhttp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Trace(const char* fcn)
7171
*/
7272

7373
int
74-
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, size64_t* filelenp)
74+
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, long long* filelenp)
7575
{
7676
int stat = NC_NOERR;
7777
int i;

libdispatch/dinfermodel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct MagicFile {
4444
struct NCURI* uri;
4545
int omode;
4646
NCmodel* model;
47-
fileoffset_t filelen;
47+
long long filelen;
4848
int use_parallel;
4949
void* parameters; /* !NULL if inmemory && !diskless */
5050
FILE* fp;
@@ -937,7 +937,7 @@ check_file_type(const char *path, int omode, int use_parallel,
937937
if((status = openmagic(&magicinfo))) goto done;
938938

939939
/* Verify we have a large enough file */
940-
if(magicinfo.filelen < MAGIC_NUMBER_LEN)
940+
if(magicinfo.filelen < (long long)MAGIC_NUMBER_LEN)
941941
{status = NC_ENOTNC; goto done;}
942942
if((status = readmagic(&magicinfo,0L,magic)) != NC_NOERR) {
943943
status = NC_ENOTNC;

libhdf5/hdf5create.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,19 @@ nc4_create_file(const char *path, int cmode, size_t initialsz,
163163
nc4_chunk_cache_preemption));
164164
}
165165

166-
#ifdef HAVE_H5PSET_LIBVER_BOUNDS
167166
#if H5_VERSION_GE(1,10,2)
168-
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0)
167+
/* lib versions 1.10.2 and higher */
168+
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
169169
#else
170-
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST,
171-
H5F_LIBVER_LATEST) < 0)
170+
#if H5_VERSION_GE(1,10,0)
171+
/* lib versions 1.10.0, 1.10.1 */
172+
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
173+
#else
174+
/* all HDF5 1.8 lib versions */
175+
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
172176
#endif
173-
BAIL(NC_EHDFERR);
174177
#endif
178+
BAIL(NC_EHDFERR);
175179

176180
/* Create the property list. */
177181
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)

ncdump/tst_netcdf4.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cleanncprops() {
1414
rm -f $dst
1515
cat $src \
1616
| sed -e '/:_Endianness/d' \
17-
| sed -e 's/_SuperblockVersion = 1/_SuperblockVersion = 0/' \
17+
| sed -e 's/_SuperblockVersion = [12]/_SuperblockVersion = 0/' \
1818
| sed -e 's/\(netcdflibversion\|netcdf\)=.*|/\1=NNNN|/' \
1919
| sed -e 's/\(hdf5libversion\|hdf5\)=.*"/\1=HHHH"/' \
2020
| grep -v '_NCProperties' \

0 commit comments

Comments
 (0)