Commit Graph

126 Commits

Author SHA1 Message Date
Ward Fisher
38d3831319
Merge branch 'main' into clang-tidy-fixes 2024-04-02 15:30:47 -06:00
Ward Fisher
e5b83cd70f
Merge pull request #2884 from ZedThree/silence-test-warnings
Fix warnings in tests and examples
2024-03-21 17:13:04 -06:00
Kyle Shores
0535edd9c1 Replace ENABLE_FILTER_TESTING with NETCDF_ENABLE_FILTER_TESTING 2024-03-18 15:51:55 -05:00
Kyle Shores
dc4830a632 replacing BUILD_UTILITIES 2024-03-18 15:29:24 -05:00
Peter Hill
662afedb90
Fix warnings in examples 2024-03-12 16:13:41 +00:00
Sean McBride
fb5c6b139c Auto fixed clang-tidy readability-uppercase-literal-suffix warnings 2024-03-01 20:46:58 -05:00
Sean McBride
0d82e3cd28 Auto fixed clang-tidy bugprone-suspicious-string-compare warnings 2024-03-01 20:46:58 -05:00
Ward Fisher
80e1ba2a57 Integrating new doxygen css stylesheet. 2024-02-16 15:47:15 -07:00
Peter Hill
763e54f8a1
Fix most float conversion warnings
Fixes ~200 out of ~240 `-Wfloat-conversion` warnings on gcc 13.2
2023-10-26 16:01:24 +01:00
Dennis Heimbigner
7b09290a3a Improve filter installation process to avoid use of an extra shell script
re: https://github.com/Unidata/netcdf-c/issues/2338
re: https://github.com/Unidata/netcdf-c/issues/2294

In issue https://github.com/Unidata/netcdf-c/issues/2338,
Ed Hartnett suggested a better way to install filters to a user
defined location -- for Automake, anyway.

This PR implements that suggestion. It turns out to be more
complicated than it appears, so there are fair number of changes;
mostly to shell scripts. Most of the change is in plugins/Makefile.am.

NOTE: this PR still does NOT address the use of HDF5_PLUGIN_PATH
as the default; this turns out to be complex when dealing with NCZarr.
So this will be addressed in a subsequent post 4.9.0 PR.

## Misc. Changes
1. Record the occurrences of incomplete codecs in libnczarr so that
   they can be included in _Codecs attribute correctly. This allows
   users to see what missing filters are referenced in the Zarr file.
   Primarily affects libnczarr/zfilter.[ch]. Also required creating a
   new no-effect filter: H5Zunknown.c.
2. Move the unknown filter test to a separate test file.
3. Incorporates PR https://github.com/Unidata/netcdf-c/pull/2343
2022-05-14 16:05:48 -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
Edward Hartnett
336b7d7222 turning off tests that depend on ncpathcvt when --disable-utilities is used 2022-04-09 13:28:01 -06:00
Edward Hartnett
9dc2947856 fixed makefile 2022-04-05 11:06:55 -06:00
Edward Hartnett
f515378f56 changed Makefile.am flags in examples/C 2022-04-05 06:04:50 -06:00
Jennifer Oxelson
5b7ddcca06 docs migration, part 2 2021-11-11 10:55:52 -07:00
Jennifer Oxelson
a11349482c Docs migration 2021-11-11 10:47:49 -07:00
Greg Sjaardema
cbcee382b0 Remove need for HDF5-1.6 API being defined 2021-04-28 13:59:24 -06:00
Dennis Heimbigner
aeb3ac2809 Mostly revert the filter code to reduce its complexity of use.
re: https://github.com/Unidata/netcdf-c/issues/1836

Revert the internal filter code to simplify it. From the user's
point of view, the only visible changes should be:

1. The functions that convert text to filter specs have had their signature reverted and have been moved to netcdf_aux.h
2. Some filter API functions now return NC_ENOFILTER when inquiry is made about some filter.

Internally,the dispatch table has been modified to get rid of the filter_actions
entry and associated complex structures. It has been replaced with
inq_var_filter_ids and inq_var_filter_info entries and the dispatch table
version has been bumped to 3. Corresponding NOOP and NOTNC4 functions
were added to libdispatch/dnotnc4.c. Also, the filter_action entries
in dispatch tables were replaced for all dispatch code bases (HDF5, DAP2,
etc). This should only impact UDF users.

In the process, it became clear that the form of the filters
field in NC_VAR_INFO_T was format dependent, so I converted it to
be of type void* and pushed its management into the various dispatch
code bases. Specifically libhdf5 and libnczarr now manage the filters
field in their own way.

The auxilliary functions for parsing textual filter specifications
were moved to netcdf_aux.h and were renamed to the following:
* ncaux_h5filterspec_parse
* ncaux_h5filterspec_parselist
* ncaux_h5filterspec_free
* ncaux_h5filter_fix8

Misc. Other Changes:

1. Document NUG/filters.md updated to reflect the changes above.
2. All the old data types (structs and enums)
   used by filter_actions actions were deleted.
   The exception is the NC_H5_Filterspec because it is needed
   by ncaux_h5filterspec_parselist.
3. Clientside filters were removed -- another enhancement
   for which no-one ever asked.
4. The ability to remove filters was itself removed.
5. Some functionality needed by nczarr was moved from libhdf5
   to libsrc4 e.g. nc4_find_default_chunksizes
6. All the filterx code was removed
7. ncfilter.h and nc4filter.c no longer used

Misc. Unrelated Changes:

1. The nczarr_test makefile clean was leaving some directories; so
   add clean-local to take care of them.
2020-09-27 12:43:46 -06:00
Dennis Heimbigner
59e04ae071 This PR adds EXPERIMENTAL support for accessing data in the
cloud using a variant of the Zarr protocol and storage
format. This enhancement is generically referred to as "NCZarr".

The data model supported by NCZarr is netcdf-4 minus the user-defined
types and the String type. In this sense it is similar to the CDF-5
data model.

More detailed information about enabling and using NCZarr is
described in the document NUG/nczarr.md and in a
[Unidata Developer's blog entry](https://www.unidata.ucar.edu/blogs/developer/en/entry/overview-of-zarr-support-in).

WARNING: this code has had limited testing, so do use this version
for production work. Also, performance improvements are ongoing.
Note especially the following platform matrix of successful tests:

Platform | Build System | S3 support
------------------------------------
Linux+gcc      | Automake     | yes
Linux+gcc      | CMake        | yes
Visual Studio  | CMake        | no

Additionally, and as a consequence of the addition of NCZarr,
major changes have been made to the Filter API. NOTE: NCZarr
does not yet support filters, but these changes are enablers for
that support in the future.  Note that it is possible
(probable?) that there will be some accidental reversions if the
changes here did not correctly mimic the existing filter testing.

In any case, previously filter ids and parameters were of type
unsigned int. In order to support the more general zarr filter
model, this was all converted to char*.  The old HDF5-specific,
unsigned int operations are still supported but they are
wrappers around the new, char* based nc_filterx_XXX functions.
This entailed at least the following changes:
1. Added the files libdispatch/dfilterx.c and include/ncfilter.h
2. Some filterx utilities have been moved to libdispatch/daux.c
3. A new entry, "filter_actions" was added to the NCDispatch table
   and the version bumped.
4. An overly complex set of structs was created to support funnelling
   all of the filterx operations thru a single dispatch
   "filter_actions" entry.
5. Move common code to from libhdf5 to libsrc4 so that it is accessible
   to nczarr.

Changes directly related to Zarr:
1. Modified CMakeList.txt and configure.ac to support both C and C++
   -- this is in support of S3 support via the awd-sdk libraries.
2. Define a size64_t type to support nczarr.
3. More reworking of libdispatch/dinfermodel.c to
   support zarr and to regularize the structure of the fragments
   section of a URL.

Changes not directly related to Zarr:
1. Make client-side filter registration be conditional, with default off.
2. Hack include/nc4internal.h to make some flags added by Ed be unique:
   e.g. NC_CREAT, NC_INDEF, etc.
3. cleanup include/nchttp.h and libdispatch/dhttp.c.
4. Misc. changes to support compiling under Visual Studio including:
   * Better testing under windows for dirent.h and opendir and closedir.
5. Misc. changes to the oc2 code to support various libcurl CURLOPT flags
   and to centralize error reporting.
6. By default, suppress the vlen tests that have unfixed memory leaks; add option to enable them.
7. Make part of the nc_test/test_byterange.sh test be contingent on remotetest.unidata.ucar.edu being accessible.

Changes Left TO-DO:
1. fix provenance code, it is too HDF5 specific.
2020-06-28 18:02:47 -06:00
Dennis Heimbigner
44d0dcaad2 Add support for multiple filters per variable.
re: https://github.com/Unidata/netcdf-c/issues/1584

Support has been added for multiple filters per variable.  This
affects a number of components in netcdf. The new APIs are
documented in NUG/filters.md.

The primary changes are:
* A set of new functions are provided (see __include/netcdf_filter.h__).
    - Obtain a list of the filters associated with a variable
    - Obtain the parameters for a specific filter.
* The existing __nc_inq_var_filter__ function now returns info
  about the first defined filter.
* The utilities (ncgen, ncdump, and nccopy) now support
  an extended format for specifying a sequence of filters.
  The general form is __<filter>|<filter>..._.
* The ncdump **_Filter** attribute now dumps a list of all the
  filters associated with a variable using the above new format.
* Filter specifications can now use a filter name instead of number
  for filters known to the netcdf library, which in turn is taken
  from the HDF5 filter registration page.
* New errors are defined: NC_EFILTER and NC_ENOFILTER. The latter
  is returned if an attempt is made to access an unknown filter.
* Internally, the dispatch table has been extended to add a function
  to handle all of the filter functions.
* New, filter-related, tests were added to nc_test4.
* A new plugin was added to the plugins directory to help with testing.

Notes:
1. The shuffle and fletcher32 filters are not part of the multifilter system.

Misc. changes:
1. A debug module was added to libhdf5 to help catch error locations.
2020-02-16 12:59:33 -07:00
Greg Sjaardema
56c0d5cf8a Spelling fixes 2019-09-18 08:03:01 -06:00
Ed Hartnett
085b59e0d2 comment 2019-07-04 13:47:14 -06:00
Ed Hartnett
0c069e8e4c fixed memory error in sfc_pres_temp_more.c 2019-07-04 13:46:33 -06:00
Ed Hartnett
082ec55f43 made examples quick_large_files and quick_small_files only run for large file builds 2019-07-02 09:14:50 -06:00
Ed Hartnett
137e507574 clean up 2019-07-02 09:04:30 -06:00
Ed Hartnett
4ba1caaa9d clean up 2019-07-02 09:02:57 -06:00
Ed Hartnett
3526d643de adding simple to the programs that are run 2019-07-02 09:00:36 -06:00
Ed Hartnett
5fe7afea42 adding simple.c to the programs that are built 2019-07-02 09:00:06 -06:00
Ed Hartnett
472fd0b348 cleanup of simple.c 2019-07-02 08:59:27 -06:00
Ed Hartnett
c8a2ad233f adding sfc_pres_temp_more to examples that are run 2019-07-02 08:58:28 -06:00
Ed Hartnett
732d461530 fixed sfc_pres_temp_more.c 2019-07-02 08:57:57 -06:00
Ed Hartnett
a4a8bdf7a1 fixed quick_small_files.c 2019-07-02 08:53:26 -06:00
Ed Hartnett
e3f6a705b4 cleanup of sfc_pres_temp_more.c 2019-07-02 08:34:25 -06:00
Ed Hartnett
99258bf156 fixed warnings in quick_small_files.c 2019-07-02 08:28:30 -06:00
Ed Hartnett
ca274823c6 now running quick_small_files.c 2019-07-02 08:27:02 -06:00
Ed Hartnett
1c1d40dfec fixed warning in quick_large_files.c 2019-07-02 08:25:44 -06:00
Ed Hartnett
26f97cff85 turing on programs in examples/C 2019-05-12 09:12:42 -06:00
Ward Fisher
85b94a4244
Merge pull request #1364 from NetCDF-World-Domination-Council/ejh_non_contoversial
non controversial parts of last PR
2019-03-26 11:14:33 -06:00
Ed Hartnett
42bcf4594b example documentation cleanup 2019-03-12 10:28:10 -06:00
Ed Hartnett
1ad17d71e0 example documentation cleanup 2019-03-12 10:26:38 -06:00
Ed Hartnett
6c89b7a4b9 example documentation cleanup 2019-03-12 10:22:44 -06:00
Ed Hartnett
cab5458c2e example documentation cleanup 2019-03-12 10:21:36 -06:00
Ed Hartnett
59ca5b8cec example documentation cleanup 2019-03-12 10:20:30 -06:00
Ed Hartnett
afff56a83b example documentation cleanup 2019-03-12 10:12:44 -06:00
Ed Hartnett
12635339c5 example documentation cleanup 2019-03-12 10:11:07 -06:00
Ed Hartnett
930f6e3e87 example documentation cleanup 2019-03-12 10:06:31 -06:00
Ed Hartnett
6efc184fb3 example documentation cleanup 2019-03-12 10:02:25 -06:00
Ed Hartnett
1c9a9e117b Makefile.am cleanup 2019-03-12 09:18:31 -06:00
Ed Hartnett
5214b51622 fixed examples/C/Makefile.am for parallel builds without parallel testing 2019-03-12 09:17:00 -06:00
Ed Hartnett
39c258449c now properly running pnetcdf example program in parallel 2019-03-12 09:00:31 -06:00