Build issues with parallel HDF5 1.10.2 and OpenMPI 3.1.0 on MacOS


#1

I had no problems building parallel hdf5 1.10.2 with openmpi 2.0.2 on MacOS 10.12.6, but when I switched to openmpi 3.1.0, I ran into several build issues.

First, the “checking if we are cross compiling” check in configure failed. I fixed that by setting LDFLAGS=$LDFLAGS -rpath $PREFIX/lib (I’m building a conda package, so $PREFIX is the prefix of the conda environment).

Next, two programs that generate source files, H5make_libsettings and H5detect, failed to run because they couldn’t find libmpi.40.dylib. I fixed this by adding the correct rpaths to the executables after make failed:

make || install_name_tool -add_rpath "$PREFIX/lib" src/H5make_libsettings \
        && make  || install_name_tool -add_rpath "$PREFIX/lib" src/H5detect && make

The final issue is where I’m stuck. All the tools (gif2h5, h52gif, h5diff, etc.) binaries seem to be linked with $PREFIX/lib/libh5tools.0.dylib, but running make install does not install libh5tools.dylib, so none of them work. I don’t see this issue on Ubuntu 16.04. In fact, the tools binaries do not link with libh5tools.so at all on Ubuntu, and I have no compilation problems with openmpi 3.1.0. Are the tools supposed to link with libh5tools.dylib on Mac? If so, why doesn’t that library get installed?

Build script (build.sh in conda recipe):

#!/bin/bash

export CC=${PREFIX}/bin/mpicc
export CXX=${PREFIX}/bin/mpic++

if [[ `uname -s` = Darwin ]]; then
    export saved_LDFLAGS=$LDFLAGS
    export LDFLAGS="$LDFLAGS -rpath $PREFIX/lib"
fi

./configure --prefix=${PREFIX} --enable-parallel --enable-shared --disable-static

if [[ `uname -s` = Darwin ]]; then
    export LDFLAGS=$saved_LDFLAGS
    make || install_name_tool -add_rpath "$PREFIX/lib" src/H5make_libsettings \
        && make  || install_name_tool -add_rpath "$PREFIX/lib" src/H5detect && make
else
    make
fi
make install

Thanks.