From b48675cbb49d1634445c35e01aef59eb84eb3bd7 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 24 Nov 2020 13:14:45 -0500 Subject: [PATCH] Change Intel Debug flags for FMS --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0b0f2aec2..f24206ba95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,14 @@ endif () set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}") +# This 'resets' the Intel DEBUG flags for FMS. The stock debug flags use +# 'all,noarg_temp_created' which seem to be too aggressive for FMS/MOM6. This +# moves them back to the 'bounds,uninit' GEOS used to build with. +if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" AND CMAKE_BUILD_TYPE MATCHES Debug) + string(REPLACE "all,noarg_temp_created" "bounds,uninit" _tmp "${GEOS_Fortran_FLAGS_DEBUG}") + set (CMAKE_Fortran_FLAGS_DEBUG "${_tmp}") +endif () + if (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") target_compile_options (${lib} PRIVATE $<$:-kind=byte>) endif ()