Applications that were created with earlier HDF5 releases may not compile with 1.12 by default.
The API Compatibility Macros in HDF5 allow users to work around this issue. Users can specify a compatibility macro mapping for the version of HDF5 that an application was built with. For example, a 1.10 application can be built with 1.12 using either an application or library mapping as follows:
- To compile an application built with a version of HDF5 that includes deprecated symbols (the default), make sure to pass
-DH5_USE_110_API to the compiler. For example (C), you can specify
h5cc -DH5_USE_110_API (autotools) and
cmake -DCMAKE_C_FLAGS="-DH5_USE_110_API" (CMake).
- To build an HDF5 library with the 1.10 APIs you must set
v110 when configuring. For example, with autotools specify
--with-default-api-version=v110 and with CMake set
-DDEFAULT_API_VERSION:STRING=v110 in the
HDF5options.cmake file when using the CMake source release (
However, users will not be able to take advantage of some of the new features in 1.12 if using these compatibility mappings.
See the Migrating from HDF5 1.10 to HDF5 1.12 page and video for more information.