forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable MOM6 standalone exe and ACCESS3MOM6 library
- Loading branch information
1 parent
bea9146
commit d2112f8
Showing
2 changed files
with
137 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Common compiler flags and definitions | ||
|
||
# Fortran compiler flags | ||
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none") | ||
if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10) | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") | ||
endif() | ||
set(CMAKE_Fortran_FLAGS "-fdefault-real-8 -fdefault-double-8") | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O") | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-g -Wall -Og -ffpe-trap=zero,overflow -fcheck=bounds") | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source") | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal") | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created") | ||
set(CMAKE_Fortran_FLAGS "-r8") | ||
else() | ||
message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options") | ||
endif() | ||
|
||
# C compiler flags | ||
if(CMAKE_C_COMPILER_ID MATCHES "GNU") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") | ||
set(CMAKE_C_FLAGS_RELEASE "-O") | ||
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Og -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds") | ||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -traceback -qno-opt-dynamic-align -fp-model precise -std=gnu99") | ||
set(CMAKE_C_FLAGS_RELEASE "-O2 -debug minimal") | ||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g") | ||
else() | ||
message(WARNING "C compiler with ID ${CMAKE_C_COMPILER_ID} will be used with CMake default options") | ||
endif() |