forked from ufs-community/land-DA_workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompiler_flags_Cray_Fortran.cmake
executable file
·56 lines (43 loc) · 2.08 KB
/
compiler_flags_Cray_Fortran.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# (C) Copyright 2018 UCAR.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# Cray Fortran compiler requires this definition to be added
add_definitions( -DC_F_NO_DEALLOC )
####################################################################
# FLAGS COMMON TO ALL BUILD TYPES
####################################################################
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -emf -rmoid -lhugetlbfs")
if( HAVE_OMP )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -homp")
else( )
set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -hnoomp")
endif( )
####################################################################
# RELEASE FLAGS
####################################################################
set( CMAKE_Fortran_FLAGS_RELEASE "-O3 -hfp3 -hscalar3 -hvector3 -hPIC" )
####################################################################
# DEBUG FLAGS
####################################################################
set( CMAKE_Fortran_FLAGS_DEBUG "-O0 -Gfast -Ktrap=fp" )
####################################################################
# BIT REPRODUCIBLE FLAGS
####################################################################
set( CMAKE_Fortran_FLAGS_BIT "-O2 -hflex_mp=conservative -hadd_paren -hfp1" )
####################################################################
# LINK FLAGS
####################################################################
set( CMAKE_Fortran_LINK_FLAGS "-Wl,-Map,loadmap" )
####################################################################
# Meaning of flags
# ----------------
# -hfp3 : Special optimisation for floating points
# -Ktrap=fp : Abort on NaN
# -R b : Bounds checking
# -hflex_mp=conservative -hfp1 : Obtain bit-reproducible results
# -hflex_mp=intolerant -hfp2 : Obtain bit-reproducible results (also)
# -hadd_paren : encourage left to right fp evaluation
# -hscalarN , -hvectorN : optimisation for scalar and vectorisation
# -homp/-hnoomp : Enable/Disable OpenMP
# -rmoi : create compiler listing