mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merge branch 'master' into badfilter.dmh
This commit is contained in:
commit
cc618af959
15
.github/workflows/run_tests.yml
vendored
15
.github/workflows/run_tests.yml
vendored
@ -124,6 +124,7 @@ jobs:
|
||||
- name: Configure
|
||||
shell: bash -l {0}
|
||||
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure ${ENABLE_HDF4} ${ENABLE_NC4} ${ENABLE_DAP} ${ENABLE_NCZARR}
|
||||
if: ${{ success() }}
|
||||
|
||||
- name: Look at config.log if error
|
||||
shell: bash -l {0}
|
||||
@ -149,9 +150,17 @@ jobs:
|
||||
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
|
||||
if: ${{ success() }}
|
||||
|
||||
#- name: Make Distcheck
|
||||
# shell: bash -l {0}
|
||||
# run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make distcheck -j
|
||||
# - name: Make Distcheck
|
||||
# shell: bash -l {0}
|
||||
# run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} DISTCHECK_CONFIGURE_FLAGS="${ENABLE_HDF4} ${ENABLE_NC4} ${ENABLE_DAP} ${ENABLE_NCZARR}" make distcheck
|
||||
# if: ${{ success() }}
|
||||
|
||||
#- name: Start SSH Debug
|
||||
# uses: luchihoratiu/debug-via-ssh@main
|
||||
# with:
|
||||
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
||||
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
||||
# if: ${{ failure() }}
|
||||
|
||||
nc-cmake:
|
||||
|
||||
|
@ -7,6 +7,9 @@ This file contains a high-level description of this package's evolution. Release
|
||||
## 4.8.1 - TBD
|
||||
|
||||
* [Enhancement] Improve the error reporting when attempting to use a filter for which no implementation can be found in HDF5_PLUGIN_PATH. See [Github #2000](https://github.com/Unidata/netcdf-c/pull/2000) for more information.
|
||||
* [Bug Fix] Fix `make distcheck` issue in `nczarr_test/` directory. See [Github #2007](https://github.com/Unidata/netcdf-c/issues/2007).
|
||||
* [Bug Fix] Fix bug in NCclosedir in dpathmgr.c. See [Github #2003](https://github.com/Unidata/netcdf-c/issues/2003).
|
||||
* [Bug Fix] Fix bug in ncdump that assumes that there is a relationship between the total number of dimensions and the max dimension id. See [Github #2004](https://github.com/Unidata/netcdf-c/issues/2004).
|
||||
* [Bug Fix] Fix bug in JSON processing of strings with embedded quotes. See [Github #1993](https://github.com/Unidata/netcdf-c/issues/1993).
|
||||
* [Enhancement] Add support for the new "dimension_separator" enhancement to Zarr v2. See [Github #1990](https://github.com/Unidata/netcdf-c/pull/1990) for more information.
|
||||
* [Bug Fix] Fix hack for handling failure of shell programs to properly handle escape characters. See [Github #1989](https://github.com/Unidata/netcdf-c/issues/1989).
|
||||
@ -18,7 +21,6 @@ This file contains a high-level description of this package's evolution. Release
|
||||
## 4.8.0 - March 30, 2021
|
||||
|
||||
* [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.
|
||||
>>>>>>> master
|
||||
* [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.
|
||||
* [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.
|
||||
* [Enhancement] Add support for storing NCZarr data in zip files. See [Github #1942](https://github.com/Unidata/netcdf-c/pull/1942) for more information.
|
||||
|
@ -1095,10 +1095,16 @@ AC_C_BIGENDIAN
|
||||
# Figure out platforms of special interest
|
||||
case "`uname`" in
|
||||
CYGWIN*) ISCYGWIN=yes;;
|
||||
Darwin*) ISOSX=yes;;
|
||||
WIN*) ISMSVC=yes;;
|
||||
esac
|
||||
AM_CONDITIONAL(ISCYGWIN, [test "x$ISCYGWIN" = xyes])
|
||||
AM_CONDITIONAL(ISMSVC, [test "x$ISMSVC" = xyes])
|
||||
AM_CONDITIONAL(ISOSX, [test "x$ISOSX" = xyes])
|
||||
|
||||
AC_SUBST([ISMSVC], [${ISMSVC}])
|
||||
AC_SUBST([ISCYGWIN], [${ISCYGWIN}])
|
||||
AC_SUBST([ISOSX], [${ISOSX}])
|
||||
|
||||
###
|
||||
# Crude hack to work around an issue
|
||||
@ -1722,8 +1728,6 @@ AC_DEFINE_UNQUOTED([NC_DISPATCH_VERSION], [${NC_DISPATCH_VERSION}], [Dispatch ta
|
||||
# End netcdf_meta.h definitions.
|
||||
#####
|
||||
|
||||
# This would be true for a visual studio build.
|
||||
AC_SUBST([ISMSVC], [${ISMSVC}])
|
||||
# This would be true for a cmake build.
|
||||
AC_SUBST([ISCMAKE], [])
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -14,6 +14,9 @@
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
@ -133,11 +136,11 @@ EXTERNL int NCclosedir(DIR* ent);
|
||||
#define NCaccess(path,mode) access(path,mode)
|
||||
#define NCmkdir(path,mode) mkdir(path,mode)
|
||||
#define NCgetcwd(buf,len) getcwd(buf,len)
|
||||
#define NCcwd(buf, len) getcwd(buf,len)
|
||||
#define NCrmdir(path) rmdir(path)
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#define NCstat(path,buf) stat(path,buf)
|
||||
#endif
|
||||
#define NCcwd(buf, len) getcwd(buf,len)
|
||||
#define NCrmdir(path) rmdir(path)
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#define NCopendir(path) opendir(path)
|
||||
#define NCclosedir(ent) closedir(ent)
|
||||
|
@ -356,10 +356,7 @@ int
|
||||
NCclosedir(DIR* ent)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
char* cvtname = NCpathcvt(path);
|
||||
if(cvtname == NULL) {errno = ENOENT; return -1;}
|
||||
stat = closedir(cvtname);
|
||||
free(cvtname);
|
||||
if(closedir(ent) < 0) stat = errno;
|
||||
return stat;
|
||||
}
|
||||
#endif
|
||||
@ -911,33 +908,3 @@ printutf8hex(const char* s, char* sx)
|
||||
}
|
||||
*q = '\0';
|
||||
}
|
||||
|
||||
/**************************************************/
|
||||
#if 0
|
||||
#ifdef HAVE_DIRENT_H
|
||||
EXTERNL
|
||||
DIR*
|
||||
NCopendir(const char* path)
|
||||
{
|
||||
DIR* ent = NULL;
|
||||
char* cvtpath = NCpathcvt(path);
|
||||
if(cvtpath == NULL) return -1;
|
||||
ent = opendir(cvtpath);
|
||||
free(cvtpath);
|
||||
return ent;
|
||||
}
|
||||
|
||||
EXTERNL
|
||||
int
|
||||
NCclosedir(DIR* ent)
|
||||
{
|
||||
int stat = 0;
|
||||
char* cvtpath = NCpathcvt(path);
|
||||
if(cvtpath == NULL) return -1;
|
||||
stat = closedir(cvtpath);
|
||||
free(cvtpath);
|
||||
return stat;
|
||||
}
|
||||
#endif
|
||||
#endif /*0*/
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#undef ZDEBUG1 /* detailed debug */
|
||||
|
||||
#undef ZCATCH /* Warning: significant performance impact */
|
||||
#define ZTRACING /* Warning: significant performance impact */
|
||||
#undef ZTRACING /* Warning: significant performance impact */
|
||||
|
||||
#include "ncexternl.h"
|
||||
#include "nclog.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
|
@ -377,13 +377,16 @@ nczm_localize(const char* path, char** localpathp, int localize)
|
||||
char* p;
|
||||
int forward = 1;
|
||||
int offset = 0;
|
||||
static const char* windrive = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
#ifdef _MSC_VER
|
||||
forward = (localize?0:1);
|
||||
#endif
|
||||
/* If path comes from a url, then it may start with: /x:/...
|
||||
where x is a drive letter. If so, then remove leading / */
|
||||
if(path[0] == '/' && NChasdriveletter(path+1))
|
||||
if(strlen(path) >= 4
|
||||
&& path[0] == '/' && strchr(windrive,path[1]) != NULL
|
||||
&& path[2] == ':' && path[3] == '/')
|
||||
offset = 1;
|
||||
if((localpath = strdup(path+offset))==NULL) return NC_ENOMEM;
|
||||
|
||||
|
@ -27,14 +27,8 @@ FP_NAME="$1"
|
||||
# Figure out the compiler (some values from ./configure)
|
||||
FP_ISCMAKE=@ISCMAKE@
|
||||
FP_ISMSVC=@ISMSVC@
|
||||
|
||||
# Are we operating under OS-X? (test using uname)
|
||||
FP_OS=`uname | cut -d '_' -f 1`
|
||||
if test "x$FP_OS" = xDarwin ; then FP_ISOSX=1; fi
|
||||
|
||||
# Are we operating under CYGWIN? (test using uname)
|
||||
FP_OS=`uname | cut -d '_' -f 1`
|
||||
if test "x$FP_OS" = xCYGWIN ; then FP_ISCYGWIN=1; fi
|
||||
FP_ISCYGWIN=@ISCYGWIN@
|
||||
FP_ISOSX=@ISOSX@
|
||||
|
||||
FP_PLUGINS="$TOPBUILDDIR/plugins"
|
||||
|
||||
|
@ -66,7 +66,7 @@ bom tst_dimsizes nctrunc tst_rcmerge
|
||||
# Tests for classic and 64-bit offset files.
|
||||
TESTS = tst_inttags.sh run_tests.sh tst_64bit.sh ref_ctest \
|
||||
ref_ctest64 tst_output.sh tst_lengths.sh tst_calendars.sh \
|
||||
run_utf8_tests.sh test_unicode_directory.sh tst_nccopy3.sh tst_nccopy3_subset.sh \
|
||||
run_utf8_tests.sh tst_nccopy3.sh tst_nccopy3_subset.sh \
|
||||
tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh \
|
||||
tst_dimsizes.sh run_ncgen_tests.sh tst_ncgen4_classic.sh test_radix.sh test_rcmerge.sh
|
||||
|
||||
@ -80,6 +80,10 @@ if USE_STRICT_NULL_BYTE_HEADER_PADDING
|
||||
XFAIL_TESTS += tst_null_byte_padding.sh
|
||||
endif
|
||||
|
||||
if ! ISCYGWIN
|
||||
TESTS += test_unicode_directory.sh
|
||||
endif
|
||||
|
||||
if LARGE_FILE_TESTS
|
||||
TESTS += tst_iter.sh
|
||||
endif
|
||||
|
@ -1803,6 +1803,7 @@ init_is_unlim(int ncid, int **is_unlim_p)
|
||||
{
|
||||
int num_grps; /* total number of groups */
|
||||
int num_dims = 0; /* total number of dimensions in all groups */
|
||||
int max_dimid = -1; /* maximum dimid across whole dataset */
|
||||
int num_undims = 0; /* total number of unlimited dimensions in all groups */
|
||||
int *grpids = NULL; /* temporary list of all grpids */
|
||||
int igrp;
|
||||
@ -1822,13 +1823,22 @@ init_is_unlim(int ncid, int **is_unlim_p)
|
||||
NC_CHECK( nc_inq_grps_full(ncid, &num_grps, grpids) );
|
||||
#define DONT_INCLUDE_PARENTS 0
|
||||
/* Get all dimensions in groups and info about which ones are unlimited */
|
||||
/* Warning: we cannot assume that the dimension ids are packed */
|
||||
/* Find maximum dimension id */
|
||||
max_dimid = -1;
|
||||
for(igrp = 0; igrp < num_grps; igrp++) {
|
||||
int ndims;
|
||||
int i,ndims;
|
||||
int* dimids = NULL;
|
||||
grpid = grpids[igrp];
|
||||
NC_CHECK( nc_inq_dimids(grpid, &ndims, NULL, DONT_INCLUDE_PARENTS) );
|
||||
num_dims += ndims;
|
||||
dimids = (int*)emalloc(ndims*sizeof(int));
|
||||
NC_CHECK( nc_inq_dimids(grpid, &ndims, dimids, DONT_INCLUDE_PARENTS) );
|
||||
for(i=0;i<ndims;i++) {if(dimids[i] > max_dimid) max_dimid = dimids[i];}
|
||||
free(dimids);
|
||||
}
|
||||
*is_unlim_p = emalloc((num_dims + 1) * sizeof(int));
|
||||
assert(max_dimid >= 0);
|
||||
*is_unlim_p = emalloc((max_dimid + 1 + 1) * sizeof(int));
|
||||
for(igrp = 0; igrp < num_grps; igrp++) {
|
||||
int ndims, idim, *dimids, nundims;
|
||||
grpid = grpids[igrp];
|
||||
@ -1837,13 +1847,17 @@ init_is_unlim(int ncid, int **is_unlim_p)
|
||||
NC_CHECK( nc_inq_dimids(grpid, &ndims, dimids, DONT_INCLUDE_PARENTS) );
|
||||
/* mark all dims in this group as fixed-size */
|
||||
for(idim = 0; idim < ndims; idim++) {
|
||||
(*is_unlim_p)[dimids[idim]] = 0;
|
||||
int* isunlim = *is_unlim_p;
|
||||
int did = dimids[idim];
|
||||
isunlim[did] = 0;
|
||||
}
|
||||
NC_CHECK( nc_inq_unlimdims(grpid, &nundims, dimids) );
|
||||
assert(nundims <= ndims);
|
||||
/* mark the subset of dims in this group that are unlimited */
|
||||
for(idim = 0; idim < nundims; idim++) {
|
||||
(*is_unlim_p)[dimids[idim]] = 1;
|
||||
int* isunlim = *is_unlim_p;
|
||||
int did = dimids[idim];
|
||||
isunlim[did] = 1;
|
||||
num_undims++;
|
||||
}
|
||||
if(dimids)
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -8,7 +8,7 @@ Research/Unidata. See \ref copyright file for more info. */
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -73,7 +73,7 @@ THIS SOFTWARE.
|
||||
#include <unistd.h> /* read() getopt() */
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "oc.h"
|
||||
#include "ocx.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@ LDADD = ${top_builddir}/liblib/libnetcdf.la
|
||||
check_PROGRAMS =
|
||||
TESTS =
|
||||
|
||||
check_PROGRAMS += ut_map ut_mapapi ut_json ut_projections ut_chunking
|
||||
check_PROGRAMS += ut_map ut_mapapi ut_json ut_projections ut_chunking
|
||||
|
||||
commonsrc = ut_util.c ut_test.c ut_includes.h ut_test.h ut_util.h test_nczarr_utils.h
|
||||
tstcommonsrc = tst_utils.c tst_utils.h
|
||||
@ -62,7 +62,7 @@ TESTS += run_misc.sh
|
||||
endif
|
||||
|
||||
if BUILD_BENCHMARKS
|
||||
if BUILD_UTILITIES
|
||||
if BUILD_UTILITIES
|
||||
|
||||
UTILSRC = bm_utils.c timer_utils.c tst_utils.c
|
||||
|
||||
@ -114,10 +114,8 @@ ref_skip.cdl ref_skip.txt ref_skipw.cdl \
|
||||
ref_rem.cdl ref_rem.dmp ref_ndims.cdl ref_ndims.dmp \
|
||||
ref_misc1.cdl ref_misc1.dmp ref_misc2.cdl \
|
||||
ref_avail1.cdl ref_avail1.dmp ref_avail1.txt \
|
||||
ref_xarray.cdl ref_purezarr.cdl ref_purezarr_base.cdl ref_nczarr2zarr.cdl
|
||||
|
||||
# Interoperability files
|
||||
EXTRA_DIST += ref_power_901_constants.zip ref_power_901_constants.cdl ref_quotes.zip ref_quotes.cdl
|
||||
ref_xarray.cdl ref_purezarr.cdl ref_purezarr_base.cdl ref_nczarr2zarr.cdl \
|
||||
ref_power_901_constants.zip ref_power_901_constants.cdl ref_quotes.zip ref_quotes.cdl
|
||||
|
||||
CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc
|
||||
|
||||
@ -126,3 +124,4 @@ clean-local:
|
||||
rm -fr tmp*.file results.file results.s3 results.zip
|
||||
rm -fr power_901_constants.file
|
||||
rm -fr rcmiscdir
|
||||
rm -rf ref_power_901_constants.file
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@ x * Copyright 2018, University Corporation for Atmospheric Research
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "XGetopt.h"
|
||||
#endif
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -10,6 +10,7 @@ TOPSRCDIR='@abs_top_srcdir@'
|
||||
TOPBUILDDIR='@abs_top_builddir@'
|
||||
FP_ISCMAKE=@ISCMAKE@
|
||||
FP_ISMSVC=@ISMSVC@
|
||||
FP_ISCYGWIN=@ISCYGWIN@
|
||||
|
||||
# Feature flags
|
||||
FEATURE_HDF5=@HAS_HDF5@
|
||||
|
Loading…
Reference in New Issue
Block a user