Unable to compile hdf5 in parallel

Hi,

I am building hdf5 on an Ubuntu 16.04 Linux platform.

I was able to successfully build the serial version of hdf5. But I am having difficulties building it in parallel. I have a locally-built version of mpich.

This is my configure line:

./configure --prefix=/home/skumar/Software/src/hdf5/hdf5-1.10.2/pinstall --enable-fortran --enable-cxx --with-szlib=/home/skumar/systemsoftware/szlib --enable-build-mode=debug --with-zlib=/home/skumar/systemsoftware/zlib --with-default-plugindir=/home/skumar/Software/src/hdf5/hdf5-1.10.2/install/lib/plugin --enable-parallel CC=/home/skumar/Software/src/mpich/mpich-install/bin/mpicc --enable-unsupported

I have the following environment variables set:

skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $MPICH
/home/skumar/Software/src/mpich/mpich-install/bin
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $F77
/home/skumar/Software/src/mpich/mpich-install/bin/mpifort
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $F90
/home/skumar/Software/src/mpich/mpich-install/bin/mpifort
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $F9X
/home/skumar/Software/src/mpich/mpich-install/bin/mpifort
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $CC
/home/skumar/Software/src/mpich/mpich-install/bin/mpicc
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $FFLAGS
-I/home/skumar/Software/src/mpich/mpich-install/include
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $CFLAGS
-I/home/skumar/Software/src/mpich/mpich-install/include
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $LDFLAGS
-L/home/skumar/Software/src/mpich/mpich-install/lib
skumar@KumarLaptop:~/Software/src/hdf5/hdf5-1.10.2$ echo $CPPFLAGS
-I/home/skumar/Software/src/mpich/mpich-install/include

configure worked fine, but make gave this error:

make[2]: Entering directory ‘/home/skumar/Software/src/hdf5/hdf5-1.10.2/c++/test’
CXXLD testhdf5
/usr/bin/ld: …/…/test/.libs/libh5test.a(h5test.o): undefined reference to symbol ‘MPI_File_close’
/home/skumar/Software/src/mpich/mpich-install/lib/libmpi.so.12: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:821: recipe for target ‘testhdf5’ failed
make[2]: *** [testhdf5] Error 1
make[2]: Leaving directory ‘/home/skumar/Software/src/hdf5/hdf5-1.10.2/c++/test’
Makefile:803: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/home/skumar/Software/src/hdf5/hdf5-1.10.2/c++’
Makefile:652: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1

Any help is much appreciated. Thanks!

Kumar

Looks to me like you did not set your C++ compiler (CXX) to MPI.

I got the same error for hdf5-1.8.13. I tried to install it using source code. Can you tell me how to fix this error, or how to set CXX (C++) compiler to MPI. I am using MPICH 3.2 for the same.

It’s a linking error, probably due to the missing CXX environment variable pointing to the MPICH C++ wrapper. Add CXX=/home/skumar/Software/src/mpich/mpich-install/bin/mpicxx to your configure command.