Skip to content

Commit ec7a41e

Browse files
authored
Merge pull request #939 from chernals/issue-938
Add support for GFortran 10.x in Cmake.
2 parents 882e16a + be6b498 commit ec7a41e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cmake/compilers/setupGNU.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
99
# General:
1010
set(CMAKE_Fortran_FLAGS " -fno-range-check -fno-f2c -cpp ") # remove -g -O2 from main list
1111
execute_process(COMMAND ${CMAKE_Fortran_COMPILER} --version OUTPUT_VARIABLE CMAKE_Fortran_COMPILER_VERSION)
12-
string(REGEX MATCH "[3-9].[0-9].[0-9]" CMAKE_Fortran_COMPILER_VERSION ${CMAKE_Fortran_COMPILER_VERSION})
12+
string(REGEX MATCH "1?[0-9].[0-9].[0-9]" CMAKE_Fortran_COMPILER_VERSION ${CMAKE_Fortran_COMPILER_VERSION})
1313
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER 4.3.9)
1414
add_definitions(-D_GFORTRAN)
1515
endif()
16+
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10.0.0)
17+
set(CMAKE_Fortran_FLAGS "-fallow-invalid-boz ${CMAKE_Fortran_FLAGS}")
18+
endif()
1619
# Release flags:
1720
# ON APPLE machines and on 32bit Linux systems, -O2 seems to be the highest optimization level possible
1821
# for file l_complex_taylor.f90
1922
if(APPLE OR IS32BIT)
2023
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS 4.6)
21-
set(CMAKE_Fortran_FLAGS_RELEASE "-O1")
24+
set(CMAKE_Fortran_FLAGS_RELEASE "-O1 ${CMAKE_Fortran_FLAGS_RELEASE}")
2225
endif()
2326
else()
24-
set(CMAKE_Fortran_FLAGS_RELEASE "-O4")
27+
set(CMAKE_Fortran_FLAGS_RELEASE "-O4 ${CMAKE_Fortran_FLAGS_RELEASE}")
2528
endif()
2629
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-loops ${CMAKE_Fortran_FLAGS_RELEASE}")
2730

0 commit comments

Comments
 (0)