Skip to content

Commit 67018ec

Browse files
authored
Merge branch 'v4.5.0-release-branch' into netrc.dmh
2 parents 95f697f + 8b824a3 commit 67018ec

Some content is hidden

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

42 files changed

+673
-570
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,11 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
757757

758758
ENDIF(USE_HDF5 OR ENABLE_NETCDF_4)
759759

760+
# Option to turn on CDF5 support.
761+
OPTION(ENABLE_CDF5 "Enable CDF5 Support." OFF)
762+
IF(ENABLE_CDF5)
763+
SET(USE_CDF5 ON CACHE BOOL "")
764+
ENDIF(ENABLE_CDF5)
760765

761766
# Option to Build DAP2+DAP4 Clients
762767
OPTION(ENABLE_DAP "Enable DAP2 and DAP4 Client." ON)
@@ -805,6 +810,12 @@ IF(ENABLE_DAP)
805810
#include <curl/curl.h>
806811
int main() {int x = CURLOPT_CHUNK_BGN_FUNCTION;}" HAVE_CURLOPT_CHUNK_BGN_FUNCTION)
807812

813+
# Check to see if CURLINFO_HTTP_CODE is defined.
814+
# It showed up in curl 7.10.7.
815+
CHECK_C_SOURCE_COMPILES("
816+
#include <curl/curl.h>
817+
int main() {int x = CURLINFO_HTTP_CODE;}" HAVE_CURLINFO_HTTP_CODE)
818+
808819
ELSE()
809820
SET(ENABLE_DAP2 OFF)
810821
SET(ENABLE_DAP4 OFF)
@@ -1891,6 +1902,7 @@ is_enabled(USE_DISKLESS HAS_DISKLESS)
18911902
is_enabled(USE_MMAP HAS_MMAP)
18921903
is_enabled(JNA HAS_JNA)
18931904
is_enabled(STATUS_RELAX_COORD_BOUND RELAX_COORD_BOUND)
1905+
is_enabled(ENABLE_CDF5 HAS_CDF5)
18941906

18951907
# Generate file from template.
18961908
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libnetcdf.settings.in"

RELEASE_NOTES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Release Notes {#RELEASE_NOTES}
1+
qRelease Notes {#RELEASE_NOTES}
22
=============
33

44
\brief Release notes file for the netcdf-c package.
@@ -7,6 +7,10 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.5.0 - TBD
99

10+
* [Bug] Corrected an issue where older versions of curl might fail. See [GitHub #487](https://github.com/Unidata/netcdf-c/issues/487) for more information.
11+
* [Enhancement] Added options to enable/disable `CDF5` support at configure time for autotools and cmake-based builds. The options are `--enable/disable-cdf5` and `ENABLE_CDF5`, respectively. See [Github #484](https://github.com/Unidata/netcdf-c/issues/484) for more information.
12+
* [Bug Fix] Corrected an issue when subsetting a netcdf3 file via `nccopy -v/-V`. See [Github #425](https://github.com/Unidata/netcdf-c/issues/425) and [Github #463](https://github.com/Unidata/netcdf-c/issues/463) for more information.
13+
* [Bug Fix] Corrected `--has-dap` and `--has-dap4` output for cmake-based builds. See [GitHub #473](https://github.com/Unidata/netcdf-c/pull/473) for more information.
1014
* [Bug Fix] Corrected an issue where `NC_64BIT_DATA` files were being read incorrectly by ncdump, despite the data having been written correctly. See [GitHub #457](https://github.com/Unidata/netcdf-c/issues/457) for more information.
1115
* [Bug Fix] Corrected a potential stack buffer overflow. See [GitHub #450](https://github.com/Unidata/netcdf-c/pull/450) for more information.
1216

config.h.cmake.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ are set when opening a binary file on Windows. */
107107
/* set this only when building a DLL under MinGW */
108108
#cmakedefine DLL_NETCDF 1
109109

110+
/* if true, enable CDF5 Support */
111+
#cmakedefine ENABLE_CDF5 1
112+
#cmakedefine USE_CDF5 1
113+
110114
/* if true, build DAP2 and DAP4 Client */
111115
#cmakedefine ENABLE_DAP 1
112116

@@ -147,6 +151,9 @@ are set when opening a binary file on Windows. */
147151
/* Is CURLINFO_RESPONSE_CODE defined */
148152
#cmakedefine HAVE_CURLINFO_RESPONSE_CODE 1
149153

154+
/* Is CURLINFO_HTTP_CODE defined */
155+
#cmakedefine HAVE_CURLINFO_HTTP_CODE 1
156+
150157
/* Is CURLOPT_CHUNK_BGN_FUNCTION defined */
151158
#cmakedefine HAVE_CURLOPT_CHUNK_BGN_FUNCTION 1
152159

configure.ac

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,22 @@ AC_MSG_RESULT([$enable_dap_long_tests])
441441

442442
AM_CONDITIONAL(INTERNAL_OCLIB,[test "x" = "x"])
443443

444+
# Check whether we want to enable CDF5 support.
445+
AC_MSG_CHECKING([whether CDF5 support should be enabled (default off)])
446+
AC_ARG_ENABLE([cdf5],
447+
[AS_HELP_STRING([--enable-cdf5],
448+
[build with CDF5 support.])])
449+
test "x$enable_cdf5" = xyes || enable_cdf5=no
450+
AC_MSG_RESULT($enable_cdf5)
451+
452+
if test "x$enable_cdf5" = xyes; then
453+
AC_DEFINE([USE_CDF5], [1], [if true, enable CDF5 Support])
454+
AC_DEFINE([ENABLE_CDF5], [1], [if true, enable CDF5 Support])
455+
fi
456+
457+
AM_CONDITIONAL(USE_CDF5, [test x$enable_cdf5 = xyes ])
458+
AM_CONDITIONAL(ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
459+
444460
# Does the user want to do some extra tests?
445461
AC_MSG_CHECKING([whether netCDF extra tests should be run (developers only)])
446462
AC_ARG_ENABLE([extra-tests],
@@ -1000,11 +1016,15 @@ if test "x$enable_netcdf_4" = xyes; then
10001016
fi
10011017

10021018
# The user may have built HDF5 with the SZLIB library.
1019+
enable_szlib=no
10031020
if test "x$ac_cv_func_H5Z_SZIP" = xyes; then
1004-
AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], [])
1021+
enable_szlib=yes
1022+
AC_SEARCH_LIBS([ SZ_Compress], [szip sz], [], [])
10051023
AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables])
10061024
fi
10071025

1026+
1027+
10081028
if test "x$ac_cv_func_H5free_memory" = xyes; then
10091029
AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
10101030
fi
@@ -1249,7 +1269,7 @@ AM_CONDITIONAL(USE_DAP, [test "x$enable_dap" = xyes]) # Alias
12491269
# Provide protocol specific flags
12501270
AM_CONDITIONAL(ENABLE_DAP, [test "x$enable_dap" = xyes])
12511271
AM_CONDITIONAL(ENABLE_DAP4, [test "x$enable_dap4" = xyes])
1252-
1272+
AM_CONDITIONAL(ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
12531273
AM_CONDITIONAL(ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
12541274
AM_CONDITIONAL(ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
12551275
AM_CONDITIONAL(ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
@@ -1362,11 +1382,12 @@ AC_SUBST(HAS_DAP,[$enable_dap])
13621382
AC_SUBST(HAS_DAP4,[$enable_dap4])
13631383
AC_SUBST(HAS_NC2,[$nc_build_v2])
13641384
AC_SUBST(HAS_NC4,[$enable_netcdf_4])
1385+
AC_SUBST(HAS_CDF5,[$enable_cdf5])
13651386
AC_SUBST(HAS_HDF4,[$enable_hdf4])
13661387
AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
13671388
AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
13681389
AC_SUBST(HAS_LOGGING, [$enable_logging])
1369-
AC_SUBST(HAS_SZLIB,[$ac_cv_func_H4Z_SZIP])
1390+
AC_SUBST(HAS_SZLIB,[$enable_szlib])
13701391
AC_SUBST(HAS_PARALLEL,[$enable_parallel])
13711392
AC_SUBST(HAS_PARALLEL4,[$enable_parallel4])
13721393
AC_SUBST(HAS_DISKLESS,[$enable_diskless])

docs/attribute_conventions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ It is strongly recommended that applicable conventions be followed unless there
2525
2626
<p>
2727

28-
> It is not necessary to define your own _FillValue attribute for a variable if the default fill value for the type of the variable is adequate. However, use of the default fill value for data type byte is not recommended. Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed.
28+
> If _FillValue is undefined, it is assumed that there are no unwritten data-values. Generic applications needing to write a value to represent undefined or missing values may use either `_FillValue` or `missing_value` for this purpose. It is legal (but not recommended) for the fill value to be within the valid range of the data.
2929
3030
<p>
3131

32-
> Generic applications often need to write a value to represent undefined or missing values. The fill value provides an appropriate value for this purpose because it is normally outside the valid range and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the fill value to be within the valid range.
32+
> Generic applications often need to write a value to represent undefined or missing values. The fill value provides an appropriate value for this purpose because it is normally outside the valid range and therefore treated as missing when read by generic applications. It is legal (but not recommended) for the fill value to be within the valid range.
33+
34+
> **Note that if you change the value of this attribute, the changed value applies only to subsequent writes; previously written data are not changed.**
35+
3336

3437
`missing_value`
3538

@@ -183,4 +186,3 @@ Using the following API calls will fail.
183186
> The type of this attribute is NC_INT.
184187
185188
> This attribute is computed by using the HDF5 API to walk the file to look for attributes specific to netcdf-4. False negatives are possible for a small subset of netcdf-4 files, especially those not containing dimensions. False positives are only possible by deliberate modifications to an existing HDF5 file thru the HDF5 API. For files with the _NCProperties attribute, this attribute is redundant. For files created prior to the introduction of the _NCProperties attribute, this may be a useful indicator of the provenance of the file.
186-

docs/types.dox

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ The atomic external types supported by the netCDF interface are:
2222
- ::NC_UINT64 64-bit unsigned integer *
2323
- ::NC_FLOAT 32-bit floating point
2424
- ::NC_DOUBLE 64-bit floating point
25-
- ::NC_STRING variable length character string *
25+
- ::NC_STRING variable length character string +
2626

27-
\remark{* These types are available only for CDF5 (NC_CDF5) and netCDF-4 format (NC_NETCDF4) files. All the unsigned ints (except \ref NC_CHAR), the 64-bit ints, and string type are for CDF5 or netCDF-4 files only.}
27+
\remark * These types are available only for CDF5 (NC_CDF5) and netCDF-4 format (NC_NETCDF4) files. All the unsigned ints (except \ref NC_CHAR) and the 64-bit ints are for CDF5 or netCDF-4 files only.
28+
\remark + These types are available only for netCDF-4 (NC_NETCDF4) files.
2829

2930
These types were chosen to provide a reasonably wide range of
3031
trade-offs between data precision and number of bits required for each

include/nctestserver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#define TIMEOUT 10 /*seconds*/
1010
#define BUFSIZE 8192 /*bytes*/
1111

12+
#ifndef HAVE_CURLINFO_RESPONSE_CODE
13+
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
14+
#endif
15+
1216
static int ping(const char* url);
1317

1418
static char**

libdap4/d4curlflags.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ struct CURLFLAG curlopts[] = {
1111
{"CURLOPT_PROXYUSERPWD",CURLOPT_PROXYUSERPWD,10006,CF_STRING},
1212
{"CURLOPT_SSLCERT",CURLOPT_SSLCERT,10025,CF_STRING},
1313
{"CURLOPT_SSLKEY",CURLOPT_SSLKEY,10087,CF_STRING},
14+
#ifdef HAVE_CURLOPT_KEYPASSWD
1415
{"CURLOPT_SSLKEYPASSWD",CURLOPT_SSLKEYPASSWD,CURLOPT_KEYPASSWD,CF_STRING},
16+
#endif
1517
{"CURLOPT_SSL_VERIFYHOST",CURLOPT_SSL_VERIFYHOST,81,CF_LONG},
1618
{"CURLOPT_SSL_VERIFYPEER",CURLOPT_SSL_VERIFYPEER,64,CF_LONG},
1719
{"CURLOPT_TIMEOUT",CURLOPT_TIMEOUT,13,CF_LONG},

libdap4/d4curlfunctions.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
#ifndef D4CURLFUNCTIONS_H
77
#define D4CURLFUNCTIONS_H
88

9+
/* Aliases to older names */
10+
#ifndef HAVE_CURLOPT_KEYPASSWD
11+
#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
12+
#endif
13+
#ifndef HAVE_CURLINFO_RESPONSE_CODE
14+
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
15+
#endif
16+
917
enum CURLFLAGTYPE {CF_UNKNOWN=0,CF_OTHER=1,CF_STRING=2,CF_LONG=3};
1018
struct CURLFLAG {
1119
const char* name;

libdap4/d4rc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ rcorder(NClist* rc)
103103
nclistpush(newrc,ti);
104104
}
105105
#ifdef D4DEBUG
106+
106107
storedump("reorder:",newrc);
107108
#endif
108109
return newrc;
110+
109111
}
110112

111113
/* Create a triple store from a file */
@@ -540,7 +542,9 @@ storedump(char* msg, NClist* triples)
540542
for(i=0;i<nclistlength(triples);i++) {
541543
NCD4triple* t = (NCD4triple*)nclistget(triples,i);
542544
fprintf(stderr,"\t%s\t%s\t%s\n",
545+
543546
((t->host == NULL || strlen(t->host)==0)?"--":t->host),t->key,t->value);
547+
544548
}
545549
fflush(stderr);
546550
}

0 commit comments

Comments
 (0)