Commit Graph

87 Commits

Author SHA1 Message Date
Kyle Shores
a0931fe06a trying a different thing 2024-02-15 16:33:16 -06:00
Peter Hill
4aa6d38bc4
CMake: Consistent name for feature variable 2024-01-24 10:51:24 +00:00
Peter Hill
ff80ee4f9f
CMake: Set feature variable rather than erroring in FindPNETCDF
Enables potential reuse of module outside of netCDF
2024-01-24 10:51:23 +00:00
Peter Hill
e88dc9c8e6
CMake: Ensure pnetcdf links to MPI, libm 2024-01-24 10:51:23 +00:00
Peter Hill
4835e43f33
CMake: Consistent casing of PNETCDF target 2024-01-24 10:51:23 +00:00
Peter Hill
a689a536f8
CMake: Use message(DEBUG) in FindPNETCDF 2024-01-24 10:50:14 +00:00
Peter Hill
a33ba11450
Merge branch 'main' into find_pnetcdf
* main:
  Escape a character causing a doxygen error.
  Updated release notes.
  Added a comment block for future reference.
  more syntax fixes
  Update CMakeLists.txt
  CMake: Find HDF5 header we can safely include for other checks
  moving functions and macros to new file, lowercase things
  Update release notes.
  lowercase
  lower case
  lowercase
  moving functions and macros to a file
  CMake: Add support for UNITY_BUILD
  Change signature of `nczm_sortenvv` to take `size_t`
  Try to more consistently use `size_t` for argument of `nclistlength`
  Try to more consistently use `size_t` for `nclistget` index argument
  Include header for `size_t` in `nclist.h`
2024-01-24 10:04:53 +00:00
Kyle Shores
237efec07e Merge branch 'main' into packaging 2024-01-19 09:27:07 -06:00
Kyle Shores
887c479533 setting up packaging in its own directory, using netcdf as a target for compile options 2024-01-19 09:25:24 -06:00
Ward Fisher
a8f8f1f1ee
Merge branch 'main' into cmake-better-fix-hdf5-check 2024-01-18 15:50:28 -08:00
Kyle Shores
05ce85be78 more syntax fixes 2024-01-18 15:07:13 -06:00
Peter Hill
e6f68f7f53
CMake: Find HDF5 header we can safely include for other checks 2024-01-18 16:04:54 +00:00
Kyle Shores
9fb46ce480 moving functions and macros to new file, lowercase things 2024-01-18 09:15:20 -06:00
Peter Hill
e632818b40
CMake: Move FindPNETCDF to cmake/modules 2024-01-18 15:07:26 +00:00
Kyle Shores
cb28b1ba0c lowercase 2024-01-17 15:47:16 -06:00
Kyle Shores
e7c7221f28 moving functions and macros to a file 2024-01-17 15:17:50 -06:00
Peter Hill
fd6421d5c9
CMake: Don't use include_directories for pnetcdf 2024-01-17 17:17:59 +00:00
Peter Hill
e728555beb
CMake: Simplify setting some cache variables for pnetcdf 2024-01-17 17:15:00 +00:00
Peter Hill
425d38ac4f
CMake: Require pnetcdf if requested 2024-01-17 16:19:19 +00:00
Peter Hill
eccbd64d55
CMake: Move pnetcdf detection to FindPNETCDF cmake module
Also:
- add back call to `include_directories` for PnetCDF
- ensure `MPI` is found for PnetCDF with serial HDF5
2024-01-17 15:23:03 +00:00
Kyle Shores
e13c75b61c merge conflict 2024-01-16 13:44:06 -06:00
Kyle Shores
656fdbb374 moving the dependencies inclusion 2024-01-16 11:20:43 -06:00
Kyle Shores
330f911ecf removing debug messages 2024-01-10 16:12:04 -06:00
Kyle Shores
ca850af099 actually adding the dependencies file... 2024-01-10 16:11:00 -06:00
Kyle Shores
efc20c64d2 putting dependencies into separate file 2024-01-10 15:18:15 -06:00
Mathieu Westphal
b708cb90bc cmake: Improve FindSzip logic to provide a Szip_LIBRARY var 2023-12-20 07:58:22 +01:00
Eisuke Kawashima
d755c4ff32
chore: unset executable flag 2023-08-23 13:31:42 +09:00
Dennis Heimbigner
f897b458ea Fix szip handling 2022-04-30 19:06:01 -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
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
11fe00ea05 Add filter support to NCZarr
Filter support has three goals:

1. Use the existing HDF5 filter implementations,
2. Allow filter metadata to be stored in the NumCodecs metadata format used by Zarr,
3. Allow filters to be used even when HDF5 is disabled

Detailed usage directions are define in docs/filters.md.

For now, the existing filter API is left in place. So filters
are defined using ''nc_def_var_filter'' using the HDF5 style
where the id and parameters are unsigned integers.

This is a big change since filters affect many parts of the code.

In the following, the terms "compressor" and "filter" and "codec" are generally
used synonomously.

### Filter-Related Changes:
* In order to support dynamic loading of shared filter libraries, a new library was added in the libncpoco directory; it helps to isolate dynamic loading across multiple platforms.
* Provide a json parsing library for use by plugins; this is created by merging libdispatch/ncjson.c with include/ncjson.h.
* Add a new _Codecs attribute to allow clients to see what codecs are being used; let ncdump -s print it out.
* Provide special headers to help support compilation of HDF5 filters when HDF5 is not enabled: netcdf_filter_hdf5_build.h and netcdf_filter_build.h.
* Add a number of new test to test the new nczarr filters.
* Let ncgen parse _Codecs attribute, although it is ignored.

### Plugin directory changes:
* Add support for the Blosc compressor; this is essential because it is the most common compressor used in Zarr datasets. This also necessitated adding a CMake FindBlosc.cmake file
* Add NCZarr support for the big-four filters provided by HDF5: shuffle, fletcher32, deflate (zlib), and szip
* Add a Codec defaulter (see docs/filters.md) for the big four filters.
* Make plugins work with windows by properly adding __declspec declaration.

### Misc. Non-Filter Changes
* Replace most uses of USE_NETCDF4 (deprecated) with USE_HDF5.
* Improve support for caching
* More fixes for path conversion code
* Fix misc. memory leaks
* Add new utility -- ncdump/ncpathcvt -- that does more or less the same thing as cygpath.
* Add a number of new test to test the non-filter fixes.
* Update the parsers
* Convert most instances of '#ifdef _MSC_VER' to '#ifdef _WIN32'
2021-09-02 17:04:26 -06:00
Dennis Heimbigner
e7d5f24078 Add zip file support
The primary change is to support the use of a zip file as a
storage format. Simultaneously the .nz4 support is made obsolete

Use of zip requires the libzip support library, so a number of
changes to the build files (Makefile.am, CMakeLists.txt) are
necessary to locate and incorporate libzip.  The nczarr_tests
tests are also changed to add zip testing.

Other changes:
* Make sure distcheck leaves no files around.
* Add some functions to netcdf_aux to export some functions of libnetcdf.
* Add a new error NC_EFOUND as the complement of NC_EEMPTY.
* Add tracing support to nclog and use it in libnczarr.
* Modify the zmap interface to support the writeonce semantics of zip.
* Create a new s3util.c to support a variety of S3 auxilliary functions.
* EXTERNL'ize a number of functions so they can be used in s3util.
* Add support for the S3 ListObjects CommonPrefixes mechanism
  to improve search.
* Add experimental support for running nczarr X s3 tests against
  the actual Amazon S3 cloud.
2021-01-28 20:11:01 -07:00
Orion Poplawski
a9518d07b3 Fix some cmake syntax errors 2013-09-16 12:16:44 -06:00
Ward Fisher
57fa9b3d5f Merged latest changes from netcdf-cmake branch.
Includes a few windows fixes, plus the skeleton
for 'make dist' and 'make distcheck' support
in cmake-based builds.
2013-03-27 19:15:00 +00:00
Ward Fisher
c127c03923 2012-11-07 17:35:35 +00:00
Ward Fisher
a3341e1987 2012-11-07 17:30:12 +00:00
Ward Fisher
366011ce33 Added cmake macros created by team at University of Hawaii,
http://gmtrac.soest.hawaii.edu/projects/gmt/wiki/BuildingNetCDF
2012-07-10 17:42:12 +00:00