Skip to content

Commit

Permalink
fix: autotools check for HDF5 floating point exceptions (NOAA-GFDL#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored Feb 22, 2024
1 parent 82fbf0e commit 5300c32
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 5300c32

Please sign in to comment.