Here is the configure script:
#!/bin/bash
hdf5-1.8.21.sh
./configure --prefix="/raid4/rjb2/opt/packages/hdf5-1.8.21"
–with-szlib="/raid4/rjb2/opt/packages/szip-2.1.1"
CC="/opt/gcc/gcc-8.2.0/bin/gcc"
CFLAGS="-m64 -fPIC -pthread -mcmodel=large -Wall -Wno-unused-variable
-Wmissing-prototypes -Wmissing-declarations -m128bit-long-double -mlarge-data-threshold=90000000"
LDFLAGS="-m64 -pthread -fPIC -Wl,-Map,hdf5-1.8.21.map"
CXX="/opt/gcc/gcc-8.2.0/bin/g++"
CPP="/opt/gcc/gcc-8.2.0/bin/g++ -E"
F77="/opt/gcc/gcc-8.2.0/bin/gfortran"
LD="/usr/bin/ld.gold"
FFLAGS="-m64 -fPIC -pthread -ffixed-line-length-132 -mcmodel=large
-fdec-structure -fdec -mlarge-data-threshold=90000000"
followed by make
....
....
CCLD libhdf5.la
/usr/bin/ld: .libs/H5Bcache.o(.text+0x850): unresolvable R_X86_64_PLTOFF64 relocation against symbol `memcmp@@GLIBC_2.2.5'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [libhdf5.la] Error 1
make[2]: Leaving directory `/raid4/rjb2/opt/build/hdf5-1.8.21/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/raid4/rjb2/opt/build/hdf5-1.8.21/src'
make: *** [all-recursive] Error 1
rjb2@muggy2:/raid4/rjb2/opt/build/hdf5-1.8.21 [5261]
(the ld.gold was used simply from a suggestion on StackExchange)
hdf4-4.2.13 builds successfuly with a similar configure script
The problem has been solved with an upgrade to binutils 2.27-41.
We tried building hdf5 on the following platforms with a default installation:
CentOS Linux release 7.4.1708 (Core) - /usr/bin/ld - GNU ld version 2.25.1-32.base.el7_4.2 - good
CentOS Linux release 7.5.1804 (Core) - /usr/bin/ld - GNU ld version 2.27-27.base.el7 - fail
CentOS Linux release 7.6.1810 (Core) - /usr/bin/ld - GNU ld version 2.27-34.base.el7 - fail
Thomas loaded new bin utils on weather2 Centos 7.6
CentOS Linux release 7.6.1810 (Core) - /usr/bin/ld - GNU ld version 2.27-41.base.el7 - good
So all new machines at Centos 7.6 need to have binutils upgraded to 2.27-41