-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.cmake
134 lines (109 loc) · 4.22 KB
/
config.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This file contains all the customizable build configuration options. You can override them via the
# appropriate -D command line options or by creating a custom file with your settings and preloading
# it via the -C option.
# General options
option(FORTUNO_BUILD_SHARED_LIBS "Fortuno: Build as shared library" ${PROJECT_IS_TOP_LEVEL})
option(FORTUNO_WITH_SERIAL "Fortuno: whether the library with serial interface should be built" ON)
option(FORTUNO_WITH_MPI "Fortuno: whether the library with MPI interface should be built" OFF)
option(FORTUNO_WITH_COARRAY "Fortuno: whether library with coarray interface should be built" OFF)
option(FORTUNO_WITH_TESTS "Fortuno: whether to build test suite" ${PROJECT_IS_TOP_LEVEL})
option(FORTUNO_WITH_EXAMPLES "Fortuno: whether to build example apps" ${PROJECT_IS_TOP_LEVEL})
option(FORTUNO_INSTALL "Fortuno: Install project" ${PROJECT_IS_TOP_LEVEL})
set(
FORTUNO_INSTALL_MODULEDIR "modules" CACHE STRING
"Fortuno: Sub-directory for installed Fortran module files (relative to CMAKE_INSTALL_LIBDIR)"
)
# Compiler dependent options
if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
# Default settings for the Intel LLVM (ifx) compiler
set(
FORTUNO_FFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during compilation"
)
set(
FORTUNO_LDFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during linking"
)
set(
FORTUNO_FFLAGS_COARRAY "-coarray"
CACHE STRING "Fortuno: Flags needed for coarray features when compling"
)
set(
FORTUNO_LDFLAGS_COARRAY "-coarray"
CACHE STRING "Fortuno: Flags needed for coarray features when linking"
)
option(FORTUNO_WITH_FPP "Fortuno: whether compiler supports fpp macros" ON)
set(
FORTUNO_FFLAGS_FPP ""
CACHE STRING "Fortuno: Flags needed to process source with fpp macros"
)
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
# Default settings for the NAG compiler
set(
FORTUNO_FFLAGS_THREADSAFE "-thread_safe"
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during compilation"
)
set(
FORTUNO_LDFLAGS_THREADSAFE "-thread_safe"
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during linking"
)
set(
FORTUNO_FFLAGS_COARRAY "-coarray"
CACHE STRING "Fortuno: Flags needed for coarray features when compling"
)
set(
FORTUNO_LDFLAGS_COARRAY "-coarray"
CACHE STRING "Fortuno: Flags needed for coarray features when linking"
)
option(FORTUNO_WITH_FPP "Fortuno: whether compiler supports fpp macros" ON)
set(
FORTUNO_FFLAGS_FPP ""
CACHE STRING "Fortuno: Flags needed to process source with fpp macros"
)
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# Default settings for the GNU compiler
set(
FORTUNO_FFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during compilation"
)
set(
FORTUNO_LDFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during linking"
)
set(
FORTUNO_FFLAGS_COARRAY "-fcoarray=single"
CACHE STRING "Fortuno: Flags needed for coarray features when compling"
)
set(
FORTUNO_LDFLAGS_COARRAY "-fcoarray=single"
CACHE STRING "Fortuno: Flags needed for coarray features when linking"
)
option(FORTUNO_WITH_FPP "Fortuno: whether compiler supports fpp macros" ON)
set(
FORTUNO_FFLAGS_FPP "-ffree-line-length-none"
CACHE STRING "Fortuno: Flags needed to process source with fpp macros"
)
else ()
# Dummy settings (you might have to override them)
set(
FORTUNO_FFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during compilation"
)
set(
FORTUNO_LDFLAGS_THREADSAFE ""
CACHE STRING "Fortuno: Flags needed to enforce thread-safe build during linking"
)
set(
FORTUNO_FFLAGS_COARRAY ""
CACHE STRING "Fortuno: Flags needed for coarray features when compling"
)
set(
FORTUNO_LDFLAGS_COARRAY ""
CACHE STRING "Fortuno: Flags needed for coarray features when linking"
)
option(FORTUNO_WITH_FPP "Fortuno: whether compiler supports fpp macros" OFF)
set(
FORTUNO_FFLAGS_FPP ""
CACHE STRING "Fortuno: Flags needed to process source with fpp macros"
)
endif ()