|
| 1 | +NetCDF-4 Filter QuickStart |
| 2 | +============================== |
| 3 | + |
| 4 | +\tableofcontents |
| 5 | + |
| 6 | +<!-- double header is needed to workaround doxygen bug --> |
| 7 | + |
| 8 | +NetCDF-4 Filter QuickStart {#nc_filters_quickstart} |
| 9 | +============================== |
| 10 | + |
| 11 | +> For full **Filters** documentation, see \ref filters. |
| 12 | +
|
| 13 | +**The `libnetcdf.so` library cannot talk to plugin libraries directly. Instead, it requires an "interface" library, which acts as a go-between. The interface libraries are built by the netCDF libraries, when the underlying plugin libraries are detected during configure/build.** |
| 14 | + |
| 15 | +Building and Installing the Interface Libraries {#nc_filters_qs_building} |
| 16 | +---------------------------------- |
| 17 | + |
| 18 | +When configuring netcdf via either the `configure` script or via `cmake`, you'll need to specify the location to install the interface libraries, as follows: |
| 19 | + |
| 20 | +* configure: `--with-plugin-dir=<absolutely directory>` |
| 21 | +* cmake: `-DPLUGIN_INSTALL_DIR=<absolutely directory>` |
| 22 | + |
| 23 | +After compiling and installing `libnetcdf`, the interface libraries for those filters detected will be installed in the user-specified `<absolute directory>`. |
| 24 | + |
| 25 | + |
| 26 | +Using the Interface Libraries at Run-time {#nc_filters_qs_runtime} |
| 27 | +--------------------------------- |
| 28 | + |
| 29 | +For historical reasons, `libnetcdf` uses the environmental variable `HDF5_PLUGIN_PATH` to local the interface libraries at run-time. |
| 30 | + |
| 31 | + |
| 32 | +Example Workflow (blosc) {#nc_filters_qs_workflow_example} |
| 33 | +-------------------------------------------------- |
| 34 | + |
| 35 | +From scratch, the steps to get this to work are as follows, and assumes `libhdf5` was installed. |
| 36 | + |
| 37 | +1. Install the filter library, and the associate development headers. |
| 38 | +2. Configure netCDF with `--enable-plugins` and `--with-plugin-dir=$HOME/netcdf-plugins` |
| 39 | +3. Ensure `blosc` is specified in the generated `libnetcdf.settings` file. |
| 40 | +4. Run make, make install. |
| 41 | + |
| 42 | +Once built and installed, set the environmental variable `HDF5_PLUGIN_PATH=$HOME/netcdf-plugins`. |
| 43 | + |
| 44 | +The reason this works is because: |
| 45 | + |
| 46 | +1. NetCDF builds the interface library. |
| 47 | +2. `ncdump` knows where to find the interface library because `HDF5_PLUGIN_PATH` is set. |
| 48 | + |
0 commit comments