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

Switch IEEE flags for NAG Fortran #3644

Merged
merged 1 commit into from
Oct 9, 2023
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
9 changes: 4 additions & 5 deletions config/linux-gnulibc1
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ case $FC_BASENAME in
H5_CFLAGS="$H5_CFLAGS"

F9XSUFFIXFLAG=""
# We force compiler to use upper case for external names
# (just in case since this should be a default EIP)
H5_FCFLAGS="$H5_FCFLAGS"
FSEARCH_DIRS=""

Expand Down Expand Up @@ -162,9 +160,10 @@ case $FC_BASENAME in
nagfor)

F9XSUFFIXFLAG=""
# We force compiler to use upper case for external names
# (just in case since this should be a default EIP)
H5_FCFLAGS="$H5_FCFLAGS"
# NOTE: The default is -ieee=stop, which will cause problems
# when the H5T module performs floating-point type
# introspection
H5_FCFLAGS="$H5_FCFLAGS -ieee=full"
Copy link
Contributor

@brtnfld brtnfld Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to check if the flag is supported with AC_COMPILE_IFELSE and throw an error if it is not?

untested:

AC_MSG_CHECKING([whether compile flag "-ieee" is supported])

H5_FCFLAGS="$H5_FCFLAGS -ieee=full"
AC_LANG_PUSH([Fortran])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  [[END]])],
  [AC_MSG_RESULT([yes])],
  [AC_MSG_RESULT([no])
  AC_MSG_ERROR([nagfor requires compiler flag -ieee support])]
)

AC_LANG_POP([Fortran])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for 1.14.3 and up and only for NAG Fortran. Also, we don't put autoconf macros in the compiler-specifc flags files. Those are just shell scripts that set flag variables. We could make -ieee=full dependent on the nagfor version, but is that really necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, 6.1 supports -ieee=full and that's as far back as I can find documentation (circa 2017)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think -ieee is only for 7+ versions, I don't think the 6 series supports it, and the 6 series is not that old.

Right, this is meant for an m4 module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see it is supported in 6.1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably okay then since I'm not sure if the earlier versions of NAG supported F2003, their documentation of the release history is not great

FSEARCH_DIRS=""

# Production
Expand Down