diff --git a/CMakeLists.txt b/CMakeLists.txt index 87ef46e..30fae96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,14 +41,22 @@ message("---- CMAKE_Fortran_COMPILER: " ${CMAKE_Fortran_COMPILER}) if(CMAKE_Fortran_COMPILER_ID MATCHES GNU) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=f2008 -Wall -fdefault-real-8 -ffpe-trap=invalid,zero,overflow") set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -pg -fbounds-check -fbacktrace") - set(CMAKE_Fortran_FLAGS_RELEASE "-O3") + if (DETERMINISTIC) + set(CMAKE_Fortran_FLAGS_RELEASE "-O0") + else() + set(CMAKE_Fortran_FLAGS_RELEASE "-O3") + endif() endif() # compiler flags for ifort if(CMAKE_Fortran_COMPILER_ID MATCHES Intel) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -fpe0 -fp-model precise -fp-model source -align all -traceback") - set(CMAKE_Fortran_FLAGS_DEBUG "-g3 -O0 -check all") - set(CMAKE_Fortran_FLAGS_RELEASE "-g3 -O2 -axCORE-AVX2 -debug all -check none -qopt-report=5 -qopt-report-annotate") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -fpe0 -fp-model precise -fp-model source -align all") + set(CMAKE_Fortran_FLAGS_DEBUG "-g3 -O0 -check all -traceback") + if (DETERMINISTIC) + set(CMAKE_Fortran_FLAGS_RELEASE "-g0 -O0 -axCORE-AVX2 -debug none -check none -qopt-report=5 -qopt-report-annotate") + else() + set(CMAKE_Fortran_FLAGS_RELEASE "-g3 -O2 -axCORE-AVX2 -debug all -check none -qopt-report=5 -qopt-report-annotate -traceback") + endif() endif() find_package(PkgConfig REQUIRED)