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

Address nagfor exceptions stoppage. #3658

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions config/cmake/HDFFortranCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERS
endif ()
endif ()

if (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
message (STATUS "... Select IEEE floating-point mode full")
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ieee=full")
endif ()

if (NOT MSVC AND NOT MINGW)
# General flags
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
Expand Down
2 changes: 1 addition & 1 deletion config/linux-gnulibc1
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ case $FC_BASENAME in
# 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"
AM_FCFLAGS="$AM_FCFLAGS -ieee=full"
Copy link
Member

Choose a reason for hiding this comment

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

Oops!

FSEARCH_DIRS=""

# Production
Expand Down
15 changes: 12 additions & 3 deletions fortran/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ set (F2003_examples

foreach (example ${examples})
add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
target_compile_options(f90_ex_${example} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
target_compile_options(f90_ex_${example}
PRIVATE
"${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
Expand Down Expand Up @@ -76,7 +79,10 @@ endforeach ()

foreach (example ${F2003_examples})
add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
target_compile_options(f03_ex_${example} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
target_compile_options(f03_ex_${example}
PRIVATE
"${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
Expand Down Expand Up @@ -117,7 +123,10 @@ endforeach ()

if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
target_compile_options(f90_ex_ph5example PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
target_compile_options(f90_ex_ph5example
PRIVATE
"${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>)
# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
if(MSVC)
Expand Down
1 change: 1 addition & 0 deletions hl/fortran/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ foreach (example ${examples})
add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
target_compile_options(hl_f90_ex_${example}
PRIVATE
"${HDF5_CMAKE_Fortran_FLAGS}"
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
Expand Down
6 changes: 6 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,12 @@ Platforms Tested
Known Problems
==============

IEEE standard arithmetic enables software to raise exceptions such as overflow,
division by zero, and other illegal operations without interrupting or halting
the program flow. The HDF5 C library intentionally performs these exceptions.
Therefore, the "-ieee=full" nagfor switch is necessary when compiling a program
to avoid stopping on an exception.

CMake files do not behave correctly with paths containing spaces.
Do not use spaces in paths because the required escaping for handling spaces
results in very complex and fragile build files.
Expand Down