HDFGroup / HDFGroup/hdf5

Applications using dynamic plugins must link to shared HDF5 library

Open
#1,009 5 comments 0 reactions 1 assignee Assigned to @jhendersonHDF View on GitHub
Component - Documentation
Dominant language
C
Stars
988
Forks
355
Avg merge
4d 2h
Merged PRs (30d)
12

Description

## Summary

Applications using dynamic plugins must link to shared HDF5 library. API calls from the plugin fail if the application loading the plugin links to the static library

## Steps to reproduce

See the attached minimal sample:

[plugin_test.tar.gz](https://github.com/HDFGroup/hdf5/files/7169365/plugin_test.tar.gz)

```
mkdir build
cd build
cmake .. -DH5_PLUGIN_BUILD_SHARED=OFF
cmake --build .
export HDF5_PLUGIN_PATH=$(pwd)/plugins
./h5_plugin_test
```

## Expected results

Test executable should exit cleanly with the following output:

```
filter is available for encoding and decoding.
....Create dataset ................
Chunk dimensions are 4X8....Writing compressed data ................
```

## Actual results

```
filter is available for encoding and decoding.
....Create dataset ................
HDF5-DIAG: Error detected in HDF5 (1.12.1) thread 0:
#000: ../src/H5S.c line 970 in H5Sget_simple_extent_dims(): not a dataspace
major: Invalid arguments to routine
minor: Inappropriate type
Error getting dimensions
...
#015: ../src/H5Z.c line 773 in H5Z__prelude_callback(): error during user callback
major: Data filters
minor: Error from filter 'set local' callback
failed to create dataset.
```

## Workaround

Configure as above but link the shared HDF5 libraries with
```
cmake .. -DH5_PLUGIN_BUILD_SHARED=ON
```

## Notes

If this is expected behaviour I could not locate it in the documentation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.