- removed comment
Rewrite users of deprecated HDF5 C++ API
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)
-
-
- 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.
-
reporter - removed comment
That would be a good question for a mailing list.
-
- 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'.
-
- removed comment
I support the notion of disabling the C++ API in ExternalThorns/HDF5 by default.
-
- 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.
-
- 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).
-
reporter - removed comment
Here is an even less below-the-radar way:
- Assign default value if unset : ${HDF5_ENABLE_CXX:=yes} Note the English text following the "#" character.
-
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.
-
- edited description
- changed status to resolved
All code has been rewritten.
-
- changed status to closed
- Log in to comment
One way to achieve this would be to use a basic C++ wrapper around the C API. For this, something along the lines of [http://sourceforge.net/p/h5mma/code/ci/d6a71c5c9b099d1eafd765927a368a23bdfacd6f/tree/h5wrapper.cc h5wrapper.cc] and [http://sourceforge.net/p/h5mma/code/ci/d6a71c5c9b099d1eafd765927a368a23bdfacd6f/tree/h5wrapper.h h5wrapper.h] might be useful.