Skip to content

Commit

Permalink
Add some more info about mismatch flags
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Nov 30, 2021
1 parent b0b2067 commit 50de0a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ set(sources-fpp

fypp_preprocess("${sources-fpp}" sources-f90)

# NAG compiler won't compile these files without the '-mismatch' option
# Some MPI frameworks (e.g. MPICH) do not provide all possible argument
# combinations explicitely in their mpi module. Consequently, compilers
# checking for different signatures for calls of the same subroutine
# may refuse to compile the libray.

# Allow argument mismatch for the NAG compiler
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "NAG")
set_source_files_properties(SOURCE ${sources-f90} PROPERTY COMPILE_FLAGS -mismatch)
endif()
# GNU 11 compiler won't compile these files without the '-fallow-argument-mismatch' option

# Allow argument mismatch for recent GNU compilers
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER_EQUAL "11")
set_source_files_properties(SOURCE ${sources-f90} PROPERTY COMPILE_FLAGS -fallow-argument-mismatch)
Expand Down

0 comments on commit 50de0a6

Please sign in to comment.