netcdf-c/plugins/H5Zblosc.h
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

63 lines
1.4 KiB
C
Executable File

/*
* Dynamically loaded filter plugin for HDF5 blosc filter.
*
* Author: Kiyoshi Masui <kiyo@physics.ubc.ca>
* Created: 2014
*
*
* Header file
* -----------
*
* This provides dynamically loaded HDF5 filter functionality (introduced
* in HDF5-1.8.11, May 2013) to the blosc HDF5 filter.
*
* Usage: compile as a shared library and install either to the default
* search location for HDF5 filter plugins (on Linux
* /usr/local/hdf5/lib/plugin) or to a location pointed to by the
* HDF5_PLUGIN_PATH environment variable.
*
*/
#ifndef H5ZBLOSC_H
#define H5ZBLOSC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "netcdf_filter_build.h"
#include "blosc.h"
#ifdef _MSC_VER
#ifdef DLL_EXPORT /* define when building the library */
#define DECLSPEC __declspec(dllexport)
#else
#define DECLSPEC __declspec(dllimport)
#endif
#else
#define DECLSPEC extern
#endif
/* Filter revision number, starting at 1 */
/* #define FILTER_BLOSC_VERSION 1 */
#define FILTER_BLOSC_VERSION 2 /* multiple compressors since Blosc 1.3 */
#define DEFAULT_LEVEL 9
#define DEFAULT_BLOCKSIZE 1
#define DEFAULT_TYPESIZE 1
#define DEFAULT_COMPCODE BLOSC_LZ4
/* HDF5 Plugin API */
DECLSPEC H5PL_type_t H5PLget_plugin_type(void);
DECLSPEC const void* H5PLget_plugin_info(void);
/* NCZarr API */
DECLSPEC const void* NCZ_get_plugin_info(void);
#ifdef __cplusplus
}
#endif
#endif /*H5ZBLOSC_H*/