How can I detect the SZIP encoder at runtime?
On Unix platforms, a quick way is to use strings
and grep
on the SZIP library, as follows:
strings libsz.a |grep ENCODE
This will return "SZIP ENCODER ENABLED" if the encoder is enabled in the SZIP library.
Another way is to write an application that checks whether the SZIP library included with HDF5 is encoder-enabled or not. Use the H5Zget_filter_info
function, as follows:
#include "hdf5.h" int main(void) { herr_t status; unsigned int filter_config_flags; status =H5Zget_filter_info(H5Z_FILTER_SZIP, &filter_config_flags); if ((filter_config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) printf("SZIP encoding is disabled.\n"); else printf ("SZIP encoding is enabled.\n"); }