Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotools check for HDF5 floating point exceptions #1455

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ GX_FC_CHECK_MOD([netcdf], [], [], [AC_MSG_ERROR([Can't find the netCDF Fortran m
GX_FORTRAN_SEARCH_LIBS([nf90_create], [netcdff], [use netcdf], [iret = nf90_create('foo.nc', 1, ncid)], [],
[AC_MSG_ERROR([Can't find the netCDF Fortran library. Set LDFLAGS/LIBS])])

# Check if we get a floating point exception with netcdf
# this will only get triggered if you have FPE traps enabled via FCFLAGS
AC_MSG_CHECKING([if HDF5 version causes floating point exceptions with set flags])
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
use netcdf
integer i, j
j = nf90_open("test.nc", NC_WRITE, i)
]])], [hdf5_fpe_bug=no], [hdf5_fpe_bug=yes])
AC_MSG_RESULT([$hdf5_fpe_bug])
if test $hdf5_fpe_bug = yes; then
AC_MSG_ERROR([The HDF5 version used to build netcdf is incompatible with the set FCFLAGS. dnl
NetCDF must be built with a HDF5 version other than 1.14.3 to support floating point exception traps.])
fi


# Check if Fortran compiler has the Class, Character array assign bug
GX_FC_CLASS_CHAR_ARRAY_BUG_CHECK()

Expand Down
Loading