Introduction
After build HDF5* library, you may meet errors during make check. This article will guide you on how to debug those make check errors, especially Fortran tests errors with Intel® debugger. For how to build HDF5* library with Intel® Compiler, you may refer to article: Building HDF5* with Intel® compilers.
Version Information
HDF5 1.8.11, 1.8.12 or above
Intel® C++ Compiler 14.0
Intel® Fortran Compiler 14.0
Configuration and Setup
You must build the debug version library and fortran test executables for debugging. Set environment variables CFLAGS, CXXFLAGS and FCFLAGS to change the default compiler options. For example:
export CFLAGS='-g'
export CXXFLAGS=' -g'
export FCFLAGS='-g'
In most cases, we only need '-g' option here. We don't need to enable optimization for debugging, unless it is necessary to reproduce the error.
Rerun the configuration:
./configure --prefix=/usr/local/hdf5-1.8.12 --enable-fortran --enable-cxx
Build and Locate the error executable
Build library and check tests by running:
make
make check
From the make check output, find the crashed test name and executable location. For example, you will see following message before Fortran tests report from the output:
===Serial tests in test begin Sat Dec 28 11:10:38 CST 2013===
make[5]: Entering directory `.../hdf5-1.8.12/fortran/test'============================
Fortran API: Testing fortranlib_test
Finished testing fortranlib_test
============================
Fortran API: fortranlib_test Test Log
That indicates the fortran test executable is named as "fortranlib_test" and located at '.../hdf5-1.8.12/fortran/test' .
Debugging
HDF5* build framework used libtool to create shared library and executables. If you run debugger directly to load the executables, you will see complains because it cannot find the shared library that the executable is linked against.
Start the debugger by libtool instead:
libtool --mode=execute idbc fortran/test/fortranlib_test
The application will be loaded correctly including all symbols for the shared libraries.