-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
203 lines (165 loc) · 6.49 KB
/
CMakeLists.txt
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#
# A) Define the package
#
TRIBITS_PACKAGE(Moertel)
#
# B) Set up package-specific options
#
TRIBITS_ADD_EXPLICIT_INSTANTIATION_OPTION()
SET(HAVE_${PACKAGE_NAME_UC}_MPI ${TPL_ENABLE_MPI})
SET (NUM_OPTIONS_SET 0)
IF (${PROJECT_NAME}_ENABLE_Epetra)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_EPETRA ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_EpetraExt)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_EPETRAEXT ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_Kokkos)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_KOKKOS ON)
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_Tpetra)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_TPETRA ON)
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_Amesos)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_AMESOS ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_AztecOO)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_AZTECOO ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_Ifpack)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_IFPACK ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_ML)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_ML ON)
MATH (EXPR NUM_OPTIONS_SET "1 + ${NUM_OPTIONS_SET}")
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_Galeri)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_GALERI ON)
ENDIF ()
IF (${PROJECT_NAME}_ENABLE_SEACAS)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_SEACAS ON)
ENDIF ()
# We currently require that, if ANY of the following are set:
# ${PROJECT_NAME}_ENABLE_Epetra
# ${PROJECT_NAME}_ENABLE_EpetraExt
# ${PROJECT_NAME}_ENABLE_Amesos
# ${PROJECT_NAME}_ENABLE_AztecOO
# ${PROJECT_NAME}_ENABLE_Ifpack
# ${PROJECT_NAME}_ENABLE_ML
# that they ALL must be set
IF ( NOT ((NUM_OPTIONS_SET EQUAL 0) OR (NUM_OPTIONS_SET EQUAL 6)))
MESSAGE(FATAL_ERROR "Moertel requires that if you enable any dependencies on Epetra, EpetraExt, Amesos,"
" AztecOO, Ifpack, or ML; that you configure Trilinos with all of them enabled.")
ENDIF ()
#
# For some reason, cannot set the default to ${${PROJECT_NAME}_ENABLE_SEACAS}
# Deprecated
#TRIBITS_ADD_OPTION_AND_DEFINE(
# Moertel_ENABLE_Exodus
# HAVE_MOERTEL_EXODUS
# "Enable Exodus mesh support in Moertel"
## ${${PROJECT_NAME}_ENABLE_SEACAS}
# OFF
#)
# ETI Logic - this borrows from Tpetra and MueLu CMakeLists.txt files
IF (${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION AND NOT ${PACKAGE_NAME}_ENABLE_Tpetra)
GLOBAL_SET(${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION OFF)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_EXPLICIT_INSTANTIATION OFF)
MESSAGE(STATUS "Disabling Moertel explicit template instantation (ETI) because Tpetra is disabled.")
ENDIF()
# Explicit instantiation options:
# - MOERTEL_ENABLE_EXPLICIT_INSTANTIATION
# - Enabling/disabling of scalar/ordinal types is controlled by Tpetra
IF(${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION)
# <double, int, int>
IF(Tpetra_INST_DOUBLE AND Tpetra_INST_INT_INT)
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_INT ON)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_INT ON)
ELSE()
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_INT OFF)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_INT OFF)
ENDIF()
# <double, int, long>
IF(Tpetra_INST_DOUBLE AND Tpetra_INST_INT_LONG)
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_LONGINT ON)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_LONGINT ON)
ELSE()
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_LONGINT OFF)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_LONGINT OFF)
ENDIF()
# <double, int, long long int>
IF(Tpetra_INST_DOUBLE AND Tpetra_INST_INT_LONG_LONG)
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_LONGLONGINT ON)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_LONGLONGINT ON)
ELSE()
GLOBAL_SET(${PACKAGE_NAME}_INST_DOUBLE_INT_LONGLONGINT OFF)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_DOUBLE_INT_LONGLONGINT OFF)
ENDIF()
# <complex, int, int>
# IF(Tpetra_INST_COMPLEX_DOUBLE AND Tpetra_INST_INT_INT)
# GLOBAL_SET(${PACKAGE_NAME}_INST_COMPLEX_INT_INT ON)
# GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_COMPLEX_INT_INT ON)
# ELSE()
# GLOBAL_SET(${PACKAGE_NAME}_INST_COMPLEX_INT_INT OFF)
# GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_COMPLEX_INT_INT OFF)
# ENDIF()
# <float, int, int>
IF(Tpetra_INST_FLOAT AND Tpetra_INST_INT_INT)
GLOBAL_SET(${PACKAGE_NAME}_INST_FLOAT_INT_INT ON)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_FLOAT_INT_INT ON)
ELSE()
GLOBAL_SET(${PACKAGE_NAME}_INST_FLOAT_INT_INT OFF)
GLOBAL_SET(HAVE_${PACKAGE_NAME_UC}_INST_FLOAT_INT_INT OFF)
ENDIF()
MESSAGE(STATUS "${PACKAGE_NAME} ETI support enabled")
MESSAGE(STATUS "<float, int, int> : ${${PACKAGE_NAME}_INST_FLOAT_INT_INT}")
MESSAGE(STATUS "<double, int, int> : ${${PACKAGE_NAME}_INST_DOUBLE_INT_INT}")
MESSAGE(STATUS "<double, int, long> : ${${PACKAGE_NAME}_INST_DOUBLE_INT_LONGINT}")
MESSAGE(STATUS "<double, int, long long> : ${${PACKAGE_NAME}_INST_DOUBLE_INT_LONGLONGINT}")
# MESSAGE(STATUS "<complex, int, int> : ${${PACKAGE_NAME}_INST_COMPLEX_INT_INT}")
# If Tpetra is enabled, determine which Nodes are used
IF (${PACKAGE_NAME}_ENABLE_Tpetra)
GLOBAL_SET (HAVE_${PACKAGE_NAME_UC}_SERIAL ${Tpetra_INST_SERIAL})
GLOBAL_SET (HAVE_${PACKAGE_NAME_UC}_PTHREAD ${Tpetra_INST_PTHREAD})
GLOBAL_SET (HAVE_${PACKAGE_NAME_UC}_OPENMP ${Tpetra_INST_OPENMP})
GLOBAL_SET (HAVE_${PACKAGE_NAME_UC}_CUDA ${Tpetra_INST_CUDA})
ENDIF()
MESSAGE(STATUS "HAVE_${PACKAGE_NAME_UC}_SERIAL : ${HAVE_${PACKAGE_NAME_UC}_SERIAL}")
MESSAGE(STATUS "HAVE_${PACKAGE_NAME_UC}_PTHREAD : ${HAVE_${PACKAGE_NAME_UC}_PTHREAD}")
MESSAGE(STATUS "HAVE_${PACKAGE_NAME_UC}_OPENMP : ${HAVE_${PACKAGE_NAME_UC}_OPENMP}")
MESSAGE(STATUS "HAVE_${PACKAGE_NAME_UC}_CUDA : ${HAVE_${PACKAGE_NAME_UC}_CUDA}")
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
Moertel_ENABLE_Morkon
HAVE_MOERTEL_MORKON
"Enable new Kokkos MorKon subpackage support"
OFF
)
# Fixup deprecated values (need to delete when deprecated support is removed)
IF (HAVE_MOERTEL_SEACAS)
SET(MOERTEL_HAVE_EXODUS)
ENDIF ()
IF (HAVE_MOERTEL_MORKON)
SET(MOERTEL_HAVE_MORKON)
ENDIF ()
IF(HAVE_MOERTEL_SEACAS)
# Make sure SEACAS is available (we use the exodus support in SEACAS for this option)
TRIBITS_INCLUDE_DIRECTORIES(${SEACAS_INCLUDE_DIRS})
ENDIF()
#
# C) Add the libraries, tests, and examples
#
ADD_SUBDIRECTORY(src)
IF(Moertel_ENABLE_Morkon)
ADD_SUBDIRECTORY(morkon)
ENDIF()
TRIBITS_ADD_EXAMPLE_DIRECTORIES(example)
#
# D) Do standard postprocessing
#
TRIBITS_PACKAGE_POSTPROCESS()