Rewrite users of deprecated HDF5 C++ API

Issue #669 closed
Erik Schnetter created an issue

The C++ API for HDF5 is decprecated. We should examine which code uses it, and rewrite it to use the C API instead. This would allow us to use more system-provided HDF5 installations.

Keyword:

Comments (11)

  1. Frank Löffler
    • removed comment

    Let's first see which code actually uses it. The prominent example used to be the Visit plugin for Carpet HDF5, but that got rewritten to use the C interface. Is there anything else using the C++ interface? If not we could drop it IMHO.

  2. Frank Löffler
    • changed status to open
    • removed comment

    Nothing within the toolkit uses it. It builds without. And the Carpet plugin is better build against the headers within visit anyway because of version problems you typically get otherwise. I suggest to drop this ticket and consider the C++ interface to be not provided by the HDF5 thorn (which in fact it isn't necessarily). Thus, I propose to change the default for HDF5_ENABLE_CXX to 'no'.

  3. Roland Haas
    • removed comment

    I support the notion of disabling the C++ API in ExternalThorns/HDF5 by default.

  4. Ian Hinder
    • changed status to open
    • removed comment

    I agree. Let's disable the use of the C++ API by default.

    Looking at HDF5/configure.sh, it looks like we should just change

    if [ "${HDF5_ENABLE_CXX:=yes}" = 'yes' ]; then to

    if [ "${HDF5_ENABLE_CXX:=no}" = 'yes' ]; then

    However, the script looks like it might not be quite right, as later on this variable is used without a default being set. Additionally, the script does not treat "yes/no" in a caseless way like the other configuration scripts do.

    The options supported by a configuration script are listed in configuration.ccl, but their default values are not - this is left up to the configuration script, so every configuration script has to contain programmatic code to manage defaults. I have amended #1042 to address this.

    Changing status of this ticket from Review to "reopened" as there is no patch as yet.

  5. Roland Haas
    • removed comment

    ':=' actually assigns default values (see the bash man page). So as long as the line Ian quoted is the first one where the variable appears everything after that has well defined default values. Bash's syntax is definitely rather strange. A less below-the-radar way of setting defaults would be something like:

    : ${HDF5_ENABLE_CXX:=yes} (note the ':' at the beginning of the line).

  6. Erik Schnetter reporter
    • removed comment

    Here is an even less below-the-radar way:

    1. Assign default value if unset : ${HDF5_ENABLE_CXX:=yes} Note the English text following the "#" character.
  7. Roland Haas

    There is no longer any code in the ET that uses the C++ interface. We no longer (since 4aa5efb8c536c262124cf9d57e59b529d2f28d5f "use bash utility scripts for configuring. Might need tweaking, but works for Debian and a couple of clusters" by Frank Loeffler from 2015-06-09) enable the C++ interface by default. The bash code is still using the somewhat underhanded

    if [ "${HDF5_ENABLE_CXX:=no}" = 'yes' ]; then
    

    syntax though.

    I will close this ticket as resolved.

  8. Log in to comment