Merge branch 'master' into dispatchfix

This commit is contained in:
Ward Fisher 2016-04-26 11:11:22 -06:00
commit 2510d7248a
20 changed files with 154 additions and 67 deletions

View File

@ -5,19 +5,19 @@ services:
env: env:
matrix: matrix:
- DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-gcc-x64-signed - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-gcc-x64-signed
- DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-clang-x64-signed - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-clang-x64-signed
- DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-gcc-x86-signed - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-gcc-x86-signed
- DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-clang-x86-signed - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-fsigned-char' CURHOST=docker-clang-x86-signed
- DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-gcc-x64-unsigned - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-gcc-x64-unsigned
- DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-clang-x64-unsigned - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-clang-x64-unsigned
- DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-gcc-x86-unsigned - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=gcc COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-gcc-x86-unsigned
- DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-clang-x86-unsigned - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE DISTCHECK=TRUE USE_CC=clang COPTS='-DCMAKE_C_FLAGS=-funsigned-char' CURHOST=docker-clang-x86-unsigned
before_install: before_install:
- docker pull $DOCKIMG > /dev/null - docker pull $DOCKIMG > /dev/null
script: script:
- docker run --rm -it -h "$CURHOST" -e USEDASH=FALSE -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -e COPTS=$COPTS -e CTEST_OUTPUT_ON_FAILURE=1 -v $(pwd):/netcdf-c $DOCKIMG - docker run --rm -it -h "$CURHOST" -e USEDASH=FALSE -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -e DISTCHECK=$DISTCHECK -e COPTS=$COPTS -e CTEST_OUTPUT_ON_FAILURE=1 -v $(pwd):/netcdf-c $DOCKIMG

View File

@ -31,8 +31,8 @@ SET(NC_VERSION_NOTE "-development")
SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE}) SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})
SET(VERSION ${netCDF_VERSION}) SET(VERSION ${netCDF_VERSION})
SET(NC_VERSION ${netCDF_VERSION}) SET(NC_VERSION ${netCDF_VERSION})
SET(netCDF_LIB_VERSION 11.0.0) SET(netCDF_LIB_VERSION 12.0.0)
SET(netCDF_SO_VERSION 11) SET(netCDF_SO_VERSION 12)
SET(PACKAGE_VERSION ${VERSION}) SET(PACKAGE_VERSION ${VERSION})
# Get system configuration, Use it to determine osname, os release, cpu. These # Get system configuration, Use it to determine osname, os release, cpu. These
@ -631,7 +631,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
ENDIF(NOT MSVC) ENDIF(NOT MSVC)
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY} H5free_memory "" HDF5_HAS_H5FREE) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY} H5free_memory "" HDF5_HAS_H5FREE)
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY} H5Pset_libver_bounds "" HDF5_HAS_LIBVER_BOUNDS)
IF(HDF5_PARALLEL) IF(HDF5_PARALLEL)
SET(HDF5_CC h5pcc) SET(HDF5_CC h5pcc)
@ -692,17 +692,6 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
SET(USE_ZLIB ON) SET(USE_ZLIB ON)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
##
# Check to see if libhdf5 contains
# 'H5free_memory'.
##
# CHECK_C_SOURCE_COMPILES("
# #include <hdf5.h>
# int main() {H5free_memory(NULL);}" HDF5_HAS_H5FREE)
# CHECK_SYMBOL_EXISTS(H5free_memory "H5public.h" HDF5_HAS_H5FREE)
# CHECK_LIBRARY_EXISTS(hdf5 H5free_memory "-L${HDF5_hdf5_LIBRARY}" HDF5_HAS_H5FREE)
# MESSAGE(STATUS "HDF5_HAS_H5FREE: ${HDF5_HAS_H5FREE}")
ENDIF(USE_HDF5 OR ENABLE_NETCDF_4) ENDIF(USE_HDF5 OR ENABLE_NETCDF_4)
@ -1188,6 +1177,7 @@ CHECK_FUNCTION_EXISTS(strtoull HAVE_STROULL)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR) CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
CHECK_FUNCTION_EXISTS(rand HAVE_RAND) CHECK_FUNCTION_EXISTS(rand HAVE_RAND)
CHECK_FUNCTION_EXISTS(random HAVE_RANDOM)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC) CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS(MPI_Comm_f2C HAVE_MPI_COMM_F2C) CHECK_FUNCTION_EXISTS(MPI_Comm_f2C HAVE_MPI_COMM_F2C)

View File

@ -7,6 +7,9 @@ This file contains a high-level description of this package's evolution. Release
## 4.4.1 - TBD ## 4.4.1 - TBD
### 4.4.1-RC1 - April 15, 2016
* [Bug Fix][Enhancement] Fixed an issue with netCDF4 files generated using version `1.10.0` of the HDF5 library. The 1.10 release potentially changed the underlying file format, introducing a backwards compatibility issue with the files generated. HDF5 provided an API for retaining the 1.8.x file format, which is now on by default. See [GitHub Issue #250](https://github.com/Unidata/netcdf-c/issues/250) for more information.
* [Bug Fix] Corrected an issue with autotools-based builds performed out-of-source-tree. See [GitHub Issue #242](https://github.com/Unidata/netcdf-c/issues/242) for more information. * [Bug Fix] Corrected an issue with autotools-based builds performed out-of-source-tree. See [GitHub Issue #242](https://github.com/Unidata/netcdf-c/issues/242) for more information.
* [Enhancement] Modified `nc_inq_type()` so that it would work more broadly without requiring a valid ncid. See [GitHub Issue #240](https://github.com/Unidata/netcdf-c/issues/240) for more information. * [Enhancement] Modified `nc_inq_type()` so that it would work more broadly without requiring a valid ncid. See [GitHub Issue #240](https://github.com/Unidata/netcdf-c/issues/240) for more information.
* [Enhancement] Accepted a patch code which added a hashmap lookup for rapid var and dim retrieval in nc3 files, contributed by Greg Sjaardema. See [GitHub Pull Request #238](https://github.com/Unidata/netcdf-c/pull/238) for more information. * [Enhancement] Accepted a patch code which added a hashmap lookup for rapid var and dim retrieval in nc3 files, contributed by Greg Sjaardema. See [GitHub Pull Request #238](https://github.com/Unidata/netcdf-c/pull/238) for more information.

View File

@ -34,12 +34,12 @@ are set when opening a binary file on Windows. */
#ifndef strcasecmp #ifndef strcasecmp
#define strcasecmp _stricmp #define strcasecmp _stricmp
#endif #endif
#ifndef snprintf #ifndef snprintf
#if _MSC_VER<1900 #if _MSC_VER<1900
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
#endif #endif
#endif #endif
@ -96,6 +96,7 @@ are set when opening a binary file on Windows. */
#cmakedefine USE_PARALLEL_POSIX 1 #cmakedefine USE_PARALLEL_POSIX 1
#cmakedefine USE_PARALLEL_MPIO 1 #cmakedefine USE_PARALLEL_MPIO 1
#cmakedefine HDF5_HAS_H5FREE 1 #cmakedefine HDF5_HAS_H5FREE 1
#cmakedefine HDF5_HAS_LIBVER_BOUNDS 1
#cmakedefine HDF5_PARALLEL 1 #cmakedefine HDF5_PARALLEL 1
#cmakedefine USE_PARALLEL 1 #cmakedefine USE_PARALLEL 1
#cmakedefine USE_PARALLEL4 1 #cmakedefine USE_PARALLEL4 1
@ -271,6 +272,7 @@ are set when opening a binary file on Windows. */
#cmakedefine HAVE_STRSTR #cmakedefine HAVE_STRSTR
#cmakedefine HAVE_MKSTEMP #cmakedefine HAVE_MKSTEMP
#cmakedefine HAVE_RAND #cmakedefine HAVE_RAND
#cmakedefine HAVE_RANDOM
#cmakedefine HAVE_GETTIMEOFDAY #cmakedefine HAVE_GETTIMEOFDAY
#cmakedefine HAVE_MPI_COMM_F2C #cmakedefine HAVE_MPI_COMM_F2C
#cmakedefine HAVE_MEMMOVE #cmakedefine HAVE_MEMMOVE

View File

@ -48,6 +48,18 @@ AC_CANONICAL_TARGET
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
##
# Some files need to exist in build directories
# that do not correspond to their source directory, or
# the test program makes an assumption about where files
# live. AC_CONFIG_LINKS provides a mechanism to link/copy files
# if an out-of-source build is happening.
##
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat1.nc:nc_test4/ref_hdf5_compat1.nc])
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat2.nc:nc_test4/ref_hdf5_compat2.nc])
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat3.nc:nc_test4/ref_hdf5_compat3.nc])
# This call is required by automake. # This call is required by automake.
AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects]) AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects])
@ -750,7 +762,7 @@ AC_HEADER_STDBOOL
# Check for these functions... # Check for these functions...
AC_CHECK_FUNCS([strlcat strerror snprintf strchr strrchr strcat strcpy \ AC_CHECK_FUNCS([strlcat strerror snprintf strchr strrchr strcat strcpy \
strdup strcasecmp strtod strtoll strtoull strstr \ strdup strcasecmp strtod strtoll strtoull strstr \
mkstemp rand memcmp \ mkstemp rand random memcmp \
getrlimit gettimeofday fsync MPI_Comm_f2c]) getrlimit gettimeofday fsync MPI_Comm_f2c])
# Does the user want to use NC_DISKLESS? # Does the user want to use NC_DISKLESS?
@ -939,6 +951,10 @@ if test "x$enable_netcdf_4" = xyes; then
AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.]) AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
fi fi
if test "x$ac_cv_func_H5Pset_libver_bounds" = xyes; then
AC_DEFINE([HDF5_HAS_LIBVER_BOUNDS], [1], [if true, netcdf4 file properties will be set using H5Pset_libver_bounds])
fi
# If the user wants hdf4 built in, check it out. # If the user wants hdf4 built in, check it out.
if test "x$enable_hdf4" = xyes; then if test "x$enable_hdf4" = xyes; then
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes]) AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])

View File

@ -1704,19 +1704,9 @@ for more information.
Quantum GIS (QGIS) {#QGIS} Quantum GIS (QGIS) {#QGIS}
----------------------------------------- -----------------------------------------
[Quantum GIS](http://www.qgis.org/) (QGIS) is an Open Source Geographic [Quantum GIS](http://www.qgis.org/) (QGIS) is an Open Source Geographic Information System (GIS) licensed under the GNU General Public License. QGIS is an official project of the Open Source Geospatial Foundation (OSGeo). It runs on Linux, Unix, Mac OSX, and Windows and supports numerous vector, raster, and database formats and functionalities. QGIS supports a desktop, browser, server, and client for viewing, editing, analysis, serving, and accessing data. Its server complies with the OGC WMS 1.3 standard. In addition to PostGIS and SpatiaLite formats, it can access data in vector formats supported by the OGR library as well as most raster formats supported by the GDAL library, including netCDF. For a more detailed list of features of the QGIS desktop, browser, server, and client, see the [QGIS features page](http://www.qgis.org/en/about-qgis/features.html).
Information System (GIS) licensed under the GNU General Public License.
QGIS is an official project of the Open Source Geospatial Foundation QGIS also supports displaying netCDF using the [Crayfish plugin in QGIS](http://www.lutraconsulting.co.uk/blog/2016/04/14/crayfish-2-2/). The project repository may be found [here](https://github.com/lutraconsulting/qgis-crayfish-plugin).
(OSGeo). It runs on Linux, Unix, Mac OSX, and Windows and supports
numerous vector, raster, and database formats and functionalities. QGIS
supports a desktop, browser, server, and client for viewing, editing,
analysis, serving, and accessing data. Its server complies with the OGC
WMS 1.3 standard. In addition to PostGIS and SpatiaLite formats, it can
access data in vector formats supported by the OGR library as well as
most raster formats supported by the GDAL library, including netCDF. For
a more detailed list of features of the QGIS desktop, browser, server,
and client, see the [QGIS features
page](http://www.qgis.org/en/about-qgis/features.html).
Ruby interface {#Ruby} Ruby interface {#Ruby}
------------------------------------- -------------------------------------

View File

@ -650,20 +650,24 @@ ncuridecodeparams(NCURI* ncuri)
int int
ncurilookup(NCURI* uri, const char* key, const char** resultp) ncurilookup(NCURI* uri, const char* key, const char** resultp)
{ {
int i; int i;
char* value = NULL; char* value = NULL;
if(uri == NULL || key == NULL || uri->params == NULL) return 0; if(uri == NULL || key == NULL || uri->params == NULL) return 0;
if(uri->paramlist == NULL) { if(uri->paramlist == NULL) {
i = ncuridecodeparams(uri); i = ncuridecodeparams(uri);
if(!i) return 0; if(!i) return 0;
} }
/* Coverity[FORWARD_NULL] */ /* Coverity[FORWARD_NULL] */
i = ncfind(uri->paramlist,key); i = ncfind(uri->paramlist,key);
if(i < 0) if(i < 0)
return 0; return 0;
if(uri->paramlist) {
value = uri->paramlist[(2*i)+1]; value = uri->paramlist[(2*i)+1];
if(resultp) *resultp = value; if(resultp) *resultp = value;
return 1; }
return 1;
} }
int int

View File

@ -19,7 +19,7 @@ lib_LTLIBRARIES = libnetcdf.la
# for information regarding incrementing `-version-info`. # for information regarding incrementing `-version-info`.
## ##
libnetcdf_la_LDFLAGS = -version-info 11:0:0 ${NOUNDEFINED} libnetcdf_la_LDFLAGS = -version-info 12:0:0 ${NOUNDEFINED}
libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS} libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS}
libnetcdf_la_LIBADD = libnetcdf_la_LIBADD =

View File

@ -47,7 +47,7 @@ EXTRA_DIST = attr.m4 ncx.m4 putget.m4 $(man_MANS) CMakeLists.txt XGetopt.c
# This tells make how to turn .m4 files into .c files. # This tells make how to turn .m4 files into .c files.
.m4.c: .m4.c:
m4 $(AM_M4FLAGS) $(M4FLAGS) -s $< >$@ m4 $(AM_M4FLAGS) $(M4FLAGS) -s $< >${srcdir}/$@
# The C API man page. # The C API man page.
man_MANS = netcdf.3 man_MANS = netcdf.3

View File

@ -11,6 +11,8 @@
#define ACTIVE 1 #define ACTIVE 1
#define MAX(a,b) ((a) > (b) ? (a) : (b))
extern uint32_t hash_fast(const void *key, size_t length); extern uint32_t hash_fast(const void *key, size_t length);
/* NOTE: 'data' is the dimid or varid which is non-negative. /* NOTE: 'data' is the dimid or varid which is non-negative.
@ -35,7 +37,11 @@ static int isPrime(unsigned long val)
for (i = 9; i--;) for (i = 9; i--;)
{ {
#ifdef HAVE_RANDOM
unsigned long a = ((unsigned long)random() % (val-4)) + 2; unsigned long a = ((unsigned long)random() % (val-4)) + 2;
#else
unsigned long a = ((unsigned long)rand() % (val - 4)) + 2;
#endif
unsigned long p = 1; unsigned long p = 1;
unsigned long exp = val-1; unsigned long exp = val-1;
while (exp) while (exp)
@ -140,7 +146,7 @@ void NC_hashmapAddDim(const NC_dimarray* ncap, long data, const char *name)
{ {
unsigned long key = hash_fast(name, strlen(name)); unsigned long key = hash_fast(name, strlen(name));
NC_hashmap* hash = ncap->hashmap; NC_hashmap* hash = ncap->hashmap;
if (hash->size*3/4 <= hash->count) { if (hash->size*3/4 <= hash->count) {
rehashDim(ncap); rehashDim(ncap);
} }
@ -149,7 +155,7 @@ void NC_hashmapAddDim(const NC_dimarray* ncap, long data, const char *name)
{ {
unsigned long i; unsigned long i;
unsigned long index = key % hash->size; unsigned long index = key % hash->size;
unsigned long step = (key % (hash->size-2)) + 1; unsigned long step = (key % MAX(1,(hash->size-2))) + 1;
for (i = 0; i < hash->size; i++) for (i = 0; i < hash->size; i++)
{ {
@ -187,7 +193,7 @@ void NC_hashmapAddVar(const NC_vararray* ncap, long data, const char *name)
{ {
unsigned long key = hash_fast(name, strlen(name)); unsigned long key = hash_fast(name, strlen(name));
NC_hashmap* hash = ncap->hashmap; NC_hashmap* hash = ncap->hashmap;
if (hash->size*3/4 <= hash->count) { if (hash->size*3/4 <= hash->count) {
rehashVar(ncap); rehashVar(ncap);
} }
@ -196,7 +202,7 @@ void NC_hashmapAddVar(const NC_vararray* ncap, long data, const char *name)
{ {
unsigned long i; unsigned long i;
unsigned long index = key % hash->size; unsigned long index = key % hash->size;
unsigned long step = (key % (hash->size-2)) + 1; unsigned long step = (key % MAX(1,(hash->size-2))) + 1;
for (i = 0; i < hash->size; i++) for (i = 0; i < hash->size; i++)
{ {

View File

@ -19,7 +19,7 @@ COPYRIGHT file for copying and redistribution conditions.
/* must be after nc4internal.h */ /* must be after nc4internal.h */
#include <H5DSpublic.h> #include <H5DSpublic.h>
#include <H5Fpublic.h>
#ifdef USE_HDF4 #ifdef USE_HDF4
#include <mfhdf.h> #include <mfhdf.h>
#endif #endif
@ -386,8 +386,10 @@ nc4_create_file(const char *path, int cmode, MPI_Comm comm, MPI_Info info,
__func__, nc4_chunk_cache_size, nc4_chunk_cache_nelems, nc4_chunk_cache_preemption)); __func__, nc4_chunk_cache_size, nc4_chunk_cache_nelems, nc4_chunk_cache_preemption));
#endif /* USE_PARALLEL4 */ #endif /* USE_PARALLEL4 */
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) #ifdef HDF5_HAS_LIBVER_BOUNDS
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
BAIL(NC_EHDFERR); BAIL(NC_EHDFERR);
#endif
/* Create the property list. */ /* Create the property list. */
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)
@ -668,7 +670,7 @@ read_coord_dimids(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
hssize_t npoints; hssize_t npoints;
int ret = 0; int ret = 0;
int d; int d;
/* There is a hidden attribute telling us the ids of the /* There is a hidden attribute telling us the ids of the
* dimensions that apply to this multi-dimensional coordinate * dimensions that apply to this multi-dimensional coordinate
* variable. Read it. */ * variable. Read it. */
@ -2215,6 +2217,7 @@ nc4_open_file(const char *path, int mode, void* parameters, NC *nc)
* fail if there are any open objects in the file. */ * fail if there are any open objects in the file. */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
BAIL(NC_EHDFERR); BAIL(NC_EHDFERR);
#ifdef EXTRA_TESTS #ifdef EXTRA_TESTS
num_plists++; num_plists++;
#endif #endif
@ -2226,6 +2229,7 @@ nc4_open_file(const char *path, int mode, void* parameters, NC *nc)
BAIL(NC_EHDFERR); BAIL(NC_EHDFERR);
#endif #endif
#ifdef USE_PARALLEL4 #ifdef USE_PARALLEL4
/* If this is a parallel file create, set up the file creation /* If this is a parallel file create, set up the file creation
property list. */ property list. */
@ -3286,7 +3290,7 @@ NC4_set_content(int ncid, size_t size, void* memory)
BAIL(NC_EHDFERR); BAIL(NC_EHDFERR);
#else #else
retval = NC_EDISKLESS; retval = NC_EDISKLESS;
#endif #endif
done: done:
return retval; return retval;

View File

@ -93,14 +93,14 @@ EXTRA_DIST = test_get.m4 test_put.m4 run_valgrind_tests.sh \
run_diskless.sh run_diskless2.sh run_mmap.sh run_pnetcdf_test.sh run_diskless.sh run_diskless2.sh run_mmap.sh run_pnetcdf_test.sh
# ref_tst_diskless2.cdl is for diff comparison and to produce tst_diskless2.c # ref_tst_diskless2.cdl is for diff comparison and to produce tst_diskless2.c
EXTRA_DIST += ref_tst_diskless2.cdl CMakeLists.txt tst_types.c EXTRA_DIST += ref_tst_diskless2.cdl CMakeLists.txt
# Only clean these on mainatiner-clean, because they require m4 to # Only clean these on mainatiner-clean, because they require m4 to
# regenerate. # regenerate.
#MAINTAINERCLEANFILES = test_get.c test_put.c #MAINTAINERCLEANFILES = test_get.c test_put.c
all: all:
cp $(top_builddir)/libsrc/ncx.c . cp $(top_srcdir)/libsrc/ncx.c .
CLEANFILES += ncx.c CLEANFILES += ncx.c

View File

@ -9,7 +9,7 @@ SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars
t_type cdm_sea_soundings tst_vl tst_atts1 tst_atts2 t_type cdm_sea_soundings tst_vl tst_atts1 tst_atts2
tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs
tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite
tst_put_vars_two_unlim_dim) tst_put_vars_two_unlim_dim tst_hdf5_file_compat)
# Note, renamegroup needs to be compiled before run_grp_rename # Note, renamegroup needs to be compiled before run_grp_rename
build_bin_test(renamegroup) build_bin_test(renamegroup)

View File

@ -21,7 +21,8 @@ tst_chunks tst_chunks2 tst_utf8 tst_fills tst_fills2 tst_fillbug \
tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts \ tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts \
t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2 \ t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2 \
tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs \ tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs \
tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite \
tst_hdf5_file_compat
check_PROGRAMS = $(NC4_TESTS) renamegroup tst_empty_vlen_unlim check_PROGRAMS = $(NC4_TESTS) renamegroup tst_empty_vlen_unlim
@ -123,7 +124,8 @@ ref_tst_interops4.nc run_get_knmi_files.sh CMakeLists.txt \
run_grp_rename.sh tst_formatx_hdf4.sh \ run_grp_rename.sh tst_formatx_hdf4.sh \
run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4 \ run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4 \
tst_h5_endians.c tst_h4_lendian.c tst_atts_string_rewrite.c \ tst_h5_endians.c tst_h4_lendian.c tst_atts_string_rewrite.c \
tst_put_vars_two_unlim_dim.c tst_empty_vlen_unlim.c run_empty_vlen_test.sh tst_put_vars_two_unlim_dim.c tst_empty_vlen_unlim.c run_empty_vlen_test.sh \
ref_hdf5_compat1.nc ref_hdf5_compat2.nc ref_hdf5_compat3.nc
CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \ CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \
bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt \ bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt \

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -80,7 +80,7 @@ int main() {
} }
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n"); printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,&startp2,&countp2,data2)) ERR; if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
/***********/ /***********/
/* Actually unnecessary to recreate the issue. */ /* Actually unnecessary to recreate the issue. */
@ -172,7 +172,7 @@ int main() {
} }
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n"); printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,&startp2,&countp2,data2)) ERR; if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
/***********/ /***********/
/* Actually unnecessary to recreate the issue. */ /* Actually unnecessary to recreate the issue. */

View File

@ -0,0 +1,63 @@
/* This is part of the netCDF package.
Copyright 2016 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Tests library ability to open files generated by a netcdf
instance linked against libhdf5 1.10.0. This is an issue at this point
because, without specifying libver bounds, netcdf linked against
libhdf5 1.8 cannot read those generated by libhdf5 1.10.0.
This test will undoubtedly not age well, but right now it is
fairly critical, and will help test if we've corrected the
issue.
Details: https://github.com/Unidata/netcdf-c/issues/250
Files testing against (copied from nc_test4):
* ref_hdf5_compat1.nc <- tst_vars.nc
* ref_hdf5_compat2.nc <- tst_vars4.nc
* ref_hdf5_compat3.nc <- tst_compounds.nc
*/
#include <nc_tests.h>
#include "netcdf.h"
#define FILE_NAME1 "ref_hdf5_compat1.nc"
#define FILE_NAME2 "ref_hdf5_compat2.nc"
#define FILE_NAME3 "ref_hdf5_compat3.nc"
int main(int argc, char **argv) {
int res = 0;
int ncid = 0;
printf("\n*** Testing libhdf5 file compatibility (open files generated by hdf5 1.10).\n");
{
printf("Testing %s\n",FILE_NAME1);
if (nc_open(FILE_NAME1, NC_NOWRITE, &ncid)) ERR;
if (nc_close(ncid)) ERR;
}
{
printf("Testing %s\n",FILE_NAME2);
if (nc_open(FILE_NAME1, NC_NOWRITE, &ncid)) ERR;
if (nc_close(ncid)) ERR;
}
{
printf("Testing %s\n",FILE_NAME3);
if (nc_open(FILE_NAME1, NC_NOWRITE, &ncid)) ERR;
if (nc_close(ncid)) ERR;
}
SUMMARIZE_ERR;
FINAL_RESULTS;
}

7
update_hdf5_compat_files.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# Temporary utility script.
cp ./tst_vars.nc ../../nc_test4/ref_hdf5_compat1.nc
cp ./tst_vars4.nc ../../nc_test4/ref_hdf5_compat2.nc
cp ./tst_compounds.nc ../../nc_test4/ref_hdf5_compat3.nc