Skip to content

Commit 5c804d2

Browse files
authored
BuildPDAF: Add -fcommon to Fortran/C optimization flags (#79)
Goal: remove multiple-definition errors for GCC compilers.
1 parent e89205f commit 5c804d2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmake/BuildPDAF.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
145145
list(APPEND PDAF_FOPT "-ffree-form")
146146
# list(APPEND PDAF_FOPT "-fopenmp")
147147
list(APPEND PDAF_FOPT "-fallow-argument-mismatch")
148+
list(APPEND PDAF_FOPT "-fcommon")
148149

149150
else()
150151
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
@@ -192,6 +193,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
192193
list(APPEND PDAF_COPT "-fno-automatic")
193194
list(APPEND PDAF_COPT "-finit-local-zero")
194195
list(APPEND PDAF_COPT "-mcmodel=large")
196+
list(APPEND PDAF_COPT "-fcommon")
195197

196198
else()
197199
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")

0 commit comments

Comments
 (0)