This is an old revision of the document!
Building HDF4 and HDF5 on Windows
There are binaries available, and they're probably fine, but the headers are not, because HDF4 / HDF5 install different headers depending on which compiler they were built with (which in itself is a bug). Luckily, building them from source is fairly easy.
HDF4
First, get the latest source from http://www.hdfgroup.org/release4/obtain.html and extract it in a convenient place.
HDF5
First, get the latest source from http://www.hdfgroup.org/HDF5/release/obtain5.html and extract it in a convenient place.
In HDF5 1.8.3, there is a bug in perform/sio_engine.c
that needs to be fixed before compiling: on line 376, replace mkdir
with HDmkdir
.
Before we run configure
, there are three issues we need to address. The first is that due to the libtool brokenness mentioned here, you have to regenerate the script:
$ aclocal $ libtoolize --copy --force $ automake --add-missing --copy --foreign $ autoconf
If you did it right, the following command should not produce any output:
$ grep -rF dll.a .
The second issue is that C++ support is not enabled by default, and the third is that the test scripts use Winsock (ws2_32.lib
), but don't link against it.
$ env LIBS=-lws2_32 sh configure --prefix=/opt/hdf5 --enable-cxx
Revisit later in re thread safety
Finally, build and install:
$ make install