Commit Graph

127 Commits

Author SHA1 Message Date
Dennis Heimbigner
d34a222141 Turn off debug 2022-04-30 21:43:08 -06:00
Dennis Heimbigner
f897b458ea Fix szip handling 2022-04-30 19:06:01 -06:00
Dennis Heimbigner
a8aa6e3db3 Remove debug 2022-04-29 14:38:18 -06:00
Dennis Heimbigner
126b3f9423 Support installation of filters into user-specified location
re: https://github.com/Unidata/netcdf-c/issues/2294

Ed Hartnett suggested that the netcdf library installation process
be extended to install the standard filters into a user specified
location. The user can then set HDF5_PLUGIN_PATH to that location.

This PR provides that capability using:
````
configure option: --with-plugin-dir=<absolute directory path>
cmake option: -DPLUGIN_INSTALL_DIR=<absolute directory path>
````

Currently, the following plugins are always installed, if
available: bzip2, zstd, blosc.
If NCZarr is enabled, then additional plugins are installed:
fletcher32, shuffle, deflate, szip.

Additionally, the necessary codec support is installed
for each of the above filters that is installed.

## Changes:
1. Cleanup handling of built-in bzip2.
2. Add documentation to docs/filters.md
3. Re-factor the NCZarr codec libraries
4. Add a test, although it can only be exercised after
   the library is installed, so it cannot be used during
   normal testing.
5. Cleanup use of HDF5_PLUGIN_PATH in the filter test cases.
2022-04-29 14:31:55 -06:00
Ward Fisher
516c73b5d9 Made the parallel build action label mention pnetcdf. 2022-04-21 14:34:18 -06:00
Ward Fisher
ad9650604f Remove on-push trigger for OSX-based workflows. 2022-04-21 14:23:53 -06:00
Edward Hartnett
0cfc4370da untabified 2022-04-09 11:41:40 -06:00
Edward Hartnett
a7e1734568 adding pnetcdf 2022-04-09 11:32:43 -06:00
Ward Fisher
e6853c24f0
Merge pull request #2273 from edwardhartnett/ejh_par
turning on parallel I/O tests in CI
2022-04-06 14:44:02 -06:00
Ward Fisher
3446aa0c13 Merge branch 'winutf8.dmh' of https://github.com/DennisHeimbigner/netcdf-c into gh2222.wif 2022-04-05 10:46:22 -06:00
Edward Hartnett
5f9a676363 turning on parallel tests 2022-04-05 09:38:02 -06:00
Edward Hartnett
bce16a73e1 turning off parallel tests? 2022-04-05 09:14:26 -06:00
Edward Hartnett
99ce0e8cbc turning on parallel I/O tests in CI 2022-04-05 05:20:17 -06:00
Ward Fisher
40412e6db5 Correct compiler issue with parallel one-off test. 2022-03-28 13:55:02 -06:00
Ward Fisher
2f3b7fc922 Correct dependency chain for Github Actions. 2022-03-28 13:45:10 -06:00
Ward Fisher
7d76990596 Added first pass at a parallel github actions one-off 2022-03-28 13:43:07 -06:00
Ward Fisher
418c7c86c5 Reconfiguring the Ubuntu Github Actions test. 2022-03-28 13:32:04 -06:00
Dennis Heimbigner
bbdfec2dcf retry 2022-03-14 14:14:08 -06:00
Dennis Heimbigner
3ffe7be446 Enhance/Fix filter support
re: Discussion https://github.com/Unidata/netcdf-c/discussions/2214

The primary change is to support so-called "standard filters".
A standard filter is one that is defined by the following
netcdf-c API:
````
int nc_def_var_XXX(int ncid, int varid, size_t nparams, unsigned* params);
int nc_inq_var_XXXX(int ncid, int varid, int* usefilterp, unsigned* params);
````
So for example, zstandard would be a standard filter by defining
the functions *nc_def_var_zstandard* and *nc_inq_var_zstandard*.

In order to define these functions, we need a new dispatch function:
````
int nc_inq_filter_avail(int ncid, unsigned filterid);
````
This function, combined with the existing filter API can be used
to implement arbitrary standard filters using a simple code pattern.
Note that I would have preferred that this function return a list
of all available filters, but HDF5 does not support that functionality.

So this PR implements the dispatch function and implements
the following standard functions:
    + bzip2
    + zstandard
    + blosc
Specific test cases are also provided for HDF5 and NCZarr.
Over time, other specific standard filters will be defined.

## Primary Changes
* Add nc_inq_filter_avail() to netcdf-c API.
* Add standard filter implementations to test use of *nc_inq_filter_avail*.
* Bump the dispatch table version number and add to all the relevant
   dispatch tables (libsrc, libsrcp, etc).
* Create a program to invoke nc_inq_filter_avail so that it is accessible
  to shell scripts.
* Cleanup szip support to properly support szip
  when HDF5 is disabled. This involves detecting
  libsz separately from testing if HDF5 supports szip.
* Integrate shuffle and fletcher32 into the existing
  filter API. This means that, for example, nc_def_var_fletcher32
  is now a wrapper around nc_def_var_filter.
* Extend the Codec defaulting to allow multiple default shared libraries.

## Misc. Changes
* Modify configure.ac/CMakeLists.txt to look for the relevant
  libraries implementing standard filters.
* Modify libnetcdf.settings to list available standard filters
  (including deflate and szip).
* Add CMake test modules to locate libbz2 and libzstd.
* Cleanup the HDF5 memory manager function use in the plugins.
* remove unused file include//ncfilter.h
* remove tests for the HDF5 memory operations e.g. H5allocate_memory.
* Add flag to ncdump to force use of _Filter instead of _Deflate
  or _Shuffle or _Fletcher32. Used for testing.
2022-03-14 12:39:37 -06:00
Dennis Heimbigner
9b7202bf06 Explicitly disallow variable length type compression
re: https://github.com/Unidata/netcdf-c/issues/2189

Compression of a variable whose type is variable length
fails for all current filters. This is because at some point,
the compression buffer will contain pointers to data instead
of the actual data. Compression of pointers of course is meaningless.

The PR changes the behavior of nc_def_var_filter so that it will
fail with error NC_EFILTER if an attempt is made to add a filter
to a variable whose type is variable-length.

A variable is variable-length if it is of type string or VLEN
or transitively (via a compound type) contains a string or VLEN.

Also added a test case for this.

## Misc Changes
1. Turn off a number of debugging statements
2022-02-19 16:47:31 -07:00
Dennis Heimbigner
36102e3c32 Improve UTF8 Support On Windows
re: Issue https://github.com/Unidata/netcdf-c/issues/2190

The primary purpose of this PR is to improve the utf8 support
for windows. This is persuant to a change in Windows that
supports utf8 natively (almost). The almost means that it is
still utf16 internally and the set of characters representable
by utf8 is larger than those representable by utf16.

This leaves open the question in the Issue about handling
the Windows 1252 character set.

This required the following changes:

1. Test the Windows build and major version in order to see if
   native utf8 is supported.
2. If native utf8 is supported, Modify dpathmgr.c to call the 8-bit
   version of the windows fopen() and open() functions.
3. In support of this, programs that use XGetOpt (Windows versions)
   need to get the command line as utf8 and then parse to
   arc+argv as utf8. This requires using a homegrown command line parser
   named XCommandLineToArgvA.
4. Add a utility program called "acpget" that prints out the
   current Windows code page and locale.

Additionally, some technical debt was cleaned up as follows:

1. Unify all the places which attempt to read all or a part
   of a file into the dutil.c#NC_readfile code.
2. Similary unify all the code that creates temp files into
   dutil.c#NC_mktmp code.
3. Convert almost all remaining calls to fopen() and open()
   to NCfopen() and NCopen3(). This is to ensure that path management
   is used consistently. This touches a number of files.
4. extern->EXTERNL as needed to get it to work under Windows.
2022-02-08 20:53:30 -07:00
Dave Allured
0b15d5a0ab
CI: Update HDF5 testing 1.8.21 --> 1.8.22
Update matrix for latest HDF5 1.8.22.
Released 2021 February 5.
https://portal.hdfgroup.org/display/support/HDF5%201.8.22
2022-01-31 15:14:29 -07:00
Dennis Heimbigner
610d8ebf51 Fix conflicts with main 2022-01-28 13:12:03 -07:00
Ward Fisher
b1b59e1760 Correct trigger event for mingw tests to pull_request from push' 2022-01-24 16:31:34 -07:00
Ward Fisher
a8c5307ed3 Removing cmake-based tests for now. 2022-01-24 16:23:42 -07:00
Ward Fisher
16115303a5 Missing pipe character. 2022-01-24 16:15:57 -07:00
Ward Fisher
05e207f5ca Syntax error. 2022-01-24 16:12:11 -07:00
Ward Fisher
acbbde16a1 Syntax error. 2022-01-24 16:10:51 -07:00
Ward Fisher
db98c57af6 HDF5 configuration diagnostic output 2022-01-24 16:09:39 -07:00
Ward Fisher
472e4c8b36 Oh right, Unix Makefiles 2022-01-24 16:02:45 -07:00
Ward Fisher
3058b760ad Force CMake to use gcc 2022-01-24 15:59:10 -07:00
Ward Fisher
7e1c770dff Adding hdf5 info for cmake-based tests. 2022-01-24 15:55:13 -07:00
Ward Fisher
f12eb2d0f9 Moving on to cmake-based github actions. 2022-01-24 15:47:27 -07:00
Dennis Heimbigner
446348ed18 Add complete bitgroom support to NCZarr
re: PR https://github.com/Unidata/netcdf-c/pull/2088
re: PR https://github.com/Unidata/netcdf-c/pull/2130
replaces: https://github.com/Unidata/netcdf-c/pull/2140

Changes:
* Add NCZarr-specific quantize functions to the dispatch table.
* Copy (modified) quantize code from libhdf5 to NCZarr
* Add quantize invocation to zvar.c
* Add support for _QuantizeBitgroomNumberOfSignificantDigits
and _QuantizeGranularBitgroomNumberOfSignificantDigits to ncgen.
* Modify nc_test4/tst_quantize.c to allow it to be used both for hdf5
  and for nczarr.
* Make dap4 properly handle quantize functions in dispatch table.
* Add quantize attribute support to ncgen.

Other changes:
* Caught and fixed some S3 problems
* Fixed some nczarr fillvalue problems.
* Fixed some nczarr cache problems.
* Cleanup some flaws in libdispatch/dinfermodel.c
* Allow byterange requests to S3 be readable by dinfermodel.c/check_file_type
* Remove the libnczarr ztracedispatch code (big change).
2022-01-24 15:22:24 -07:00
Ward Fisher
27db0f2354 More tweaks. 2022-01-24 15:21:29 -07:00
Ward Fisher
3c017da5e3 Collapse build and run test steps into a single step, no need to build all the tests before seeing if any fail. 2022-01-24 15:11:58 -07:00
Ward Fisher
3898d4f80a Remove stray text. 2022-01-24 13:18:05 -07:00
Ward Fisher
84070ad177 Next iteration of compilation test. 2022-01-24 13:08:55 -07:00
Ward Fisher
08598a761f Additional compilation work. 2022-01-24 12:20:04 -07:00
Ward Fisher
e8e3141cb1 Really simplify things. 2022-01-24 11:45:46 -07:00
Ward Fisher
0333da7be5 Clean up some Unix-related cruft. 2022-01-24 11:38:21 -07:00
Ward Fisher
ddd675a6d7 Temporarily disable cache 2022-01-24 11:30:14 -07:00
Ward Fisher
d0ad57fb3e Further developments unfolding. 2022-01-24 11:24:45 -07:00
Ward Fisher
d76fbe3fc2 Remove stray text. 2022-01-24 11:06:21 -07:00
Ward Fisher
3a12cee940 Working on MinGW/MSYS2 support. Attempting workflow with system-installed libhdf5 2022-01-24 11:05:33 -07:00
Ward Fisher
a6e7ad17a2 Added cmake to the mingw-based test. 2022-01-24 10:54:00 -07:00
Ward Fisher
4ad9f00493 Add skeleton mingw/msys2 Github CI tests. 2022-01-24 10:51:19 -07:00
Ward Fisher
5f3de855e5
Merge pull request #2194 from WardF/update-hdf5-github-actions.wif
Collapse and update the HDF5 versions being tested on Github Actions.
2022-01-21 10:34:06 -07:00
Ward Fisher
6d5305afd6 Collapse and update the HDF5 versions being tested on Github Actions. 2022-01-21 09:10:45 -07:00
Ward Fisher
2570ac1849 Avoid name collision in macOS tests. 2022-01-21 09:01:40 -07:00