Skip to content

Commit 684c266

Browse files
committed
Applying modification suggested by Chris Bradley - ScaLAPACK mailing List Nov 29th 2015
Reducing RELEASE optimization level to O2 when Fortran Flags are set to Ofast
1 parent c06948e commit 684c266

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMAKE/CheckBLACSCompilerFlags.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ if( "${CMAKE_Fortran_FLAGS_RELEASE}" MATCHES "O[3-9]" )
8080
"${CMAKE_Fortran_FLAGS_RELEASE}" )
8181
set( CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE}"
8282
CACHE STRING "Flags used by the compiler during release builds" FORCE )
83+
elseif ( "${CMAKE_Fortran_FLAGS_RELEASE}" MATCHES "Ofast" )
84+
message( STATUS "Reducing RELEASE optimization level to O2" )
85+
string( REGEX REPLACE "Ofast" "O2" CMAKE_Fortran_FLAGS_RELEASE
86+
"${CMAKE_Fortran_FLAGS_RELEASE}" )
87+
set( CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE}"
88+
CACHE STRING "Flags used by the compiler during release builds" FORCE )
8389
endif()
8490

8591

0 commit comments

Comments
 (0)