better debug for gfortran, removing options not needed
This commit is contained in:
parent
c25c17d0b6
commit
f36db86b3c
|
@ -42,7 +42,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
||||||
set(DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
|
set(DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG")
|
||||||
set(PARALLEL "OFF")
|
set(PARALLEL "OFF")
|
||||||
set(OPTI "OFF")
|
set(OPTI "DEBUG")
|
||||||
elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
|
||||||
set(PARALLEL "ON")
|
set(PARALLEL "ON")
|
||||||
set(OPTI "DEFENSIVE")
|
set(OPTI "DEFENSIVE")
|
||||||
|
|
|
@ -9,26 +9,24 @@ if (OPENMP)
|
||||||
set (OPENMP_FLAGS "-fopenmp")
|
set (OPENMP_FLAGS "-fopenmp")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OPTIMIZATION STREQUAL "OFF")
|
if (OPTIMIZATION STREQUAL "DEBUG")
|
||||||
|
set (OPTIMIZATION_FLAGS "-Og")
|
||||||
|
elseif (OPTIMIZATION STREQUAL "OFF")
|
||||||
set (OPTIMIZATION_FLAGS "-O0")
|
set (OPTIMIZATION_FLAGS "-O0")
|
||||||
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
||||||
set (OPTIMIZATION_FLAGS "-O2 -mtune=native -flto")
|
set (OPTIMIZATION_FLAGS "-O2 -mtune=native")
|
||||||
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
|
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
|
||||||
set (OPTIMIZATION_FLAGS "-O3 -march=native -funroll-loops -ftree-vectorize -flto")
|
set (OPTIMIZATION_FLAGS "-O3 -march=native -funroll-loops -ftree-vectorize -flto")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set (STANDARD_CHECK "-std=f2018 -pedantic-errors" )
|
set (STANDARD_CHECK "-std=f2018 -pedantic-errors" )
|
||||||
set (LINKER_FLAGS "${LINKER_FLAGS} -Wl")
|
|
||||||
# options parsed directly to the linker
|
|
||||||
set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" )
|
|
||||||
# ensure to link against dynamic libraries
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
# Fine tuning compilation options
|
# Fine tuning compilation options
|
||||||
set (COMPILE_FLAGS "${COMPILE_FLAGS} -cpp")
|
set (COMPILE_FLAGS "${COMPILE_FLAGS} -cpp")
|
||||||
# preprocessor
|
# preprocessor
|
||||||
|
|
||||||
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -fPIE")
|
set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIE")
|
||||||
# position independent code
|
# position independent code
|
||||||
|
|
||||||
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132")
|
set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132")
|
||||||
|
|
|
@ -9,12 +9,12 @@ if (OPENMP)
|
||||||
set (OPENMP_FLAGS "-qopenmp -parallel")
|
set (OPENMP_FLAGS "-qopenmp -parallel")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OPTIMIZATION STREQUAL "OFF")
|
if (OPTIMIZATION STREQUAL "OFF" OR OPTIMIZATION STREQUAL "DEBUG")
|
||||||
set (OPTIMIZATION_FLAGS "-O0 -no-ip")
|
set (OPTIMIZATION_FLAGS "-O0 -no-ip")
|
||||||
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
||||||
set (OPTIMIZATION_FLAGS "-O2")
|
set (OPTIMIZATION_FLAGS "-O2")
|
||||||
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
|
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
|
||||||
set (OPTIMIZATION_FLAGS "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost")
|
set (OPTIMIZATION_FLAGS "-ipo -O3 -fp-model fast=2 -xHost")
|
||||||
# -fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
# -fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -110,6 +110,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all=0")
|
||||||
# generate debug information for parameters
|
# generate debug information for parameters
|
||||||
# Disabled due to ICE when compiling phase_damage.f90 (not understandable, there is no parameter in there)
|
# Disabled due to ICE when compiling phase_damage.f90 (not understandable, there is no parameter in there)
|
||||||
|
|
||||||
|
set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug all")
|
||||||
|
# generate complete debugging information
|
||||||
|
|
||||||
# Additional options
|
# Additional options
|
||||||
# -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
|
# -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
|
||||||
# -check: Checks at runtime, where
|
# -check: Checks at runtime, where
|
||||||
|
|
|
@ -9,7 +9,7 @@ if (OPENMP)
|
||||||
set (OPENMP_FLAGS "-qopenmp")
|
set (OPENMP_FLAGS "-qopenmp")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OPTIMIZATION STREQUAL "OFF")
|
if (OPTIMIZATION STREQUAL "OFF" OR OPTIMIZATION STREQUAL "DEBUG")
|
||||||
set (OPTIMIZATION_FLAGS "-O0")
|
set (OPTIMIZATION_FLAGS "-O0")
|
||||||
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
||||||
set (OPTIMIZATION_FLAGS "-O2")
|
set (OPTIMIZATION_FLAGS "-O2")
|
||||||
|
@ -109,6 +109,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all=0")
|
||||||
set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug-parameters all")
|
set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug-parameters all")
|
||||||
# generate debug information for parameters
|
# generate debug information for parameters
|
||||||
|
|
||||||
|
set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug all")
|
||||||
|
# generate complete debugging information
|
||||||
|
|
||||||
# Additional options
|
# Additional options
|
||||||
# -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
|
# -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
|
||||||
# -check: Checks at runtime, where
|
# -check: Checks at runtime, where
|
||||||
|
|
Loading…
Reference in New Issue