File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -807,6 +807,27 @@ if test "x$have_hdf5" = xyes ; then
807807 extra_libs="`grep 'Extra libraries' $hdf5_lib/libhdf5.settings |cut -f2 -d:`"
808808 AC_MSG_RESULT ( [ $extra_libs] )
809809 fi
810+
811+ # Building HDF5 1.14.6 using cmake produces an incorrect results in the field of
812+ # "Extra libraries". Test it first before including it to LIBS.
813+ if test "x$extra_libs" != x ; then
814+ saved_LIBS=$LIBS
815+ if test "x$LIBS" = x ; then
816+ LIBS="-lhdf5 $extra_libs"
817+ else
818+ LIBS="-lhdf5 $extra_libs $LIBS"
819+ fi
820+ AC_MSG_CHECKING ( [ extra libraries shown in libhdf5.settings if valid] )
821+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <hdf5.h>] ] ,
822+ [ [ H5Fopen("dummy", H5F_ACC_RDWR, H5P_DEFAULT);] ] ) ] ,
823+ [ valid_extra_libs=yes] , [ valid_extra_libs=no] )
824+ AC_MSG_RESULT ( [ $valid_extra_libs] )
825+ if test "x$valid_extra_libs" = xno ; then
826+ extra_libs=
827+ fi
828+ LIBS=$saved_LIBS
829+ fi
830+
810831 if test "x$LIBS" = x ; then
811832 LIBS="-lhdf5 $extra_libs"
812833 else
You can’t perform that action at this time.
0 commit comments