Skip to content

function to tell HDF5 library version #3

@scivision

Description

@scivision

when you have time, would you mind to add a function like

#include <octave/oct.h>
#include <hdf5.h>

DEFUN_DLD (hdf5_version, args, nargout,
           "Return HDF5 library version as [major, minor, release]")
{
  unsigned maj = 0, min = 0, rel = 0;
  herr_t status = H5get_libversion(&maj, &min, &rel);

  if (status < 0)
    error("H5get_libversion() failed");

  octave_value_list retval;
  retval(0) = octave_value(maj);
  retval(1) = octave_value(min);
  retval(2) = octave_value(rel);

  return retval;
}

This can be tested standalone from GNU octave by saving as hdf5_version.cpp and then

mkoctfile('hdf5_version.cpp', __octave_config_info__("HDF5_CPPFLAGS"), __octave_config_info__("HDF5_LDFLAGS"), __octave_config_info__("HDF5_LIBS"))

Although doing this using HighFive might be just a bit different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions