-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
219 lines (191 loc) · 7.42 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
project(hermes-examples)
cmake_minimum_required(VERSION 2.8)
###########################################################################
#############//////---------------------------------\\\\\\#################
#############!!!!!! NEVER CHANGE THIS FILE DIRECTLY !!!!!!#################
################!!!!!! USE the "CMake.vars" file !!!!!!####################
#############\\\\\\---------------------------------//////#################
###########################################################################
# __ __ __ __ __ __ __ __ __ #
# / \ / \ / \ / \ / \ / \ / \ / \ / \ #
#| STOP || STOP || STOP || STOP || STOP || STOP || STOP || STOP || STOP | #
# \ __ / \ __ / \ __ / \ __ / \ __ / \ __ / \ __ / \ __ / \ __ / #
# || || || || || || || || || #
# || || || || || || || || || #
# || || || || || || || || || #
# || || || || || || || || || #
# / \ / \ / \ / \ / \ / \ / \ / \ / \ #
# ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ #
###########################################################################
#############//////---------------------------------\\\\\\#################
#############!!!!!! NEVER CHANGE THIS FILE DIRECTLY !!!!!!#################
################!!!!!! USE the "CMake.vars" file !!!!!!####################
#############\\\\\\---------------------------------//////#################
###########################################################################
SET(WITH_1d YES)
SET(WITH_2d-advanced YES)
SET(WITH_acoustics YES)
SET(WITH_advection-diffusion-reaction YES)
SET(WITH_heat-transfer YES)
SET(WITH_helmholtz YES)
SET(WITH_euler YES)
SET(WITH_elasticity-linear YES)
SET(WITH_maxwell YES)
SET(WITH_navier-stokes YES)
SET(WITH_nernst-planck YES)
SET(WITH_neutronics YES)
SET(WITH_richards YES)
SET(WITH_schroedinger YES)
SET(WITH_wave-equation YES)
SET(WITH_2d-benchmarks-general YES)
SET(WITH_2d-benchmarks-nist YES)
set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake)
include(CommonTargetProperties)
# For Win64
if(${CMAKE_CL_64})
set(WIN64 YES)
else(${CMAKE_CL_64})
set(WIN64 NO)
endif(${CMAKE_CL_64})
# This has to be the same as in the library's CMake.
# Default "yes"
set(H2D_WITH_GLUT YES)
set(WITH_TC_MALLOC NO)
set(WITH_PARALUTION YES)
set(WITH_UMFPACK YES)
set(WITH_OPENMP YES)
# Default "no"
set(WITH_EXODUSII NO)
set(WITH_MUMPS NO)
set(WITH_MATIO NO)
set(WITH_BSON NO)
set(WITH_SUPERLU NO)
# Where to look for the static libraries.
set(HERMES_DIRECTORY /usr/local/lib)
set(HERMES_INCLUDE_PATH /usr/local/include)
set(HERMES_SOURCE_DIRECTORY ~/hermes)
# Allow to override the default values in CMake.vars:
include(CMake.vars OPTIONAL)
include(".CMake.vars.default.Linux" OPTIONAL)
include(${HERMES_CMAKE_VARS_FILE_LOCATION} OPTIONAL)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Disable all warnings and turn on only important ones:
set(CMAKE_CXX_FLAGS "-w ${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "-Wuninitialized -Wvla -Wsign-compare ${CMAKE_CXX_FLAGS}")
set(RELEASE_FLAGS "-DNDEBUG -O3")
set(DEBUG_FLAGS "-g")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# This overrides CXX flags for MSVC
if(MSVC)
include(MSVC_FLAGS)
endif(MSVC)
include_directories("${PTHREAD_ROOT}/include")
if(${WITH_UMFPACK})
find_package(UMFPACK REQUIRED)
include_directories(${UMFPACK_INCLUDE_DIRS})
endif()
find_package(PTHREAD REQUIRED)
if(${WITH_TC_MALLOC})
find_package(TCMALLOC REQUIRED)
include_directories(${TCMALLOC_INCLUDE_DIR})
endif()
if(${WITH_PARALUTION})
find_package(PARALUTION REQUIRED)
include_directories(${PARALUTION_INCLUDE_DIR})
endif()
if(${WITH_MATIO})
find_package(MATIO REQUIRED)
include_directories(${MATIO_INCLUDE_DIR})
endif()
if(MSVC)
if(WITH_PETSC OR WITH_TRILINOS OR WITH_SUPERLU)
find_package(CLAPACK REQUIRED)
include_directories(${CLAPACK_INCLUDE_DIRS})
endif(WITH_PETSC OR WITH_TRILINOS OR WITH_SUPERLU)
if(WITH_MUMPS)
find_package(WINBLAS REQUIRED)
endif(WITH_MUMPS)
else(MSVC)
if(WITH_UMFPACK OR WITH_PETSC OR WITH_MUMPS OR WITH_TRILINOS OR WITH_SUPERLU)
if (NOT LAPACK_FOUND)
enable_language(Fortran)
find_package(LAPACK REQUIRED)
set(LAPACK_LIBRARIES ${LAPACK_LIBRARIES}
CACHE STRING "Path to LAPACK/BLAS libraries.")
set(LAPACK_FOUND YES
CACHE STRING "Have LAPACK/BLAS libraries been found?")
endif (NOT LAPACK_FOUND)
add_definitions(-DWITH_BLAS)
endif(WITH_UMFPACK OR WITH_PETSC OR WITH_MUMPS OR WITH_TRILINOS OR WITH_SUPERLU)
endif(MSVC)
if(WITH_MUMPS)
find_package(MUMPS REQUIRED)
if(WITH_MPI)
find_package(SCALAPACK REQUIRED) # parallel version of MUMPS needs ScaLapack+BLACS
endif(WITH_MPI)
include_directories(${MUMPS_INCLUDE_DIR})
set(MUMPS_LIBRARIES ${MUMPS_CPLX_LIBRARIES})
LIST(APPEND MUMPS_LIBRARIES ${MUMPS_REAL_LIBRARIES})
endif(WITH_MUMPS)
if(WITH_TRILINOS)
find_package(TRILINOS REQUIRED)
include_directories(${TRILINOS_INCLUDE_DIR})
endif(WITH_TRILINOS)
if(${WITH_BSON})
find_package(BSON REQUIRED)
include_directories(${BSON_INCLUDE_DIR})
endif()
if(WITH_SUPERLU)
find_package(SUPERLU REQUIRED)
include_directories(${SUPERLU_INCLUDE_DIR})
if(SUPERLU_MT)
add_definitions(-DSLU_MT)
endif(SUPERLU_MT)
endif(WITH_SUPERLU)
set(HERMES2D_INCLUDE_PATH ${HERMES_INCLUDE_PATH}/hermes2d)
set(HERMES_COMMON_INCLUDE_PATH ${HERMES_INCLUDE_PATH}/hermes_common)
find_package(HERMES_COMMON REQUIRED)
include_directories(${HERMES_COMMON_INCLUDE_PATH})
include_directories(${HERMES2D_INCLUDE_PATH})
include_directories(${DEP_INCLUDE_PATHS})
IF(WITH_1d)
add_subdirectory(1d)
ENDIF(WITH_1d)
IF(WITH_2d-advanced)
add_subdirectory(2d-advanced)
ENDIF(WITH_2d-advanced)
IF(WITH_2d-benchmarks-general)
add_subdirectory(2d-benchmarks-general)
ENDIF(WITH_2d-benchmarks-general)
IF(WITH_2d-benchmarks-nist)
add_subdirectory(2d-benchmarks-nist)
ENDIF(WITH_2d-benchmarks-nist)
#------------------------------------------------------------------------------
# Report.
#~~~~~~~~
message("\nHermes-examples Configuration results")
message("---------------------")
if(WIN32)
message("Build for Win64: ${WIN64}")
endif(WIN32)
message("\n-------Features-------")
message("Build with OpenMP: ${WITH_OPENMP}")
message("Build with TCMalloc: ${WITH_TC_MALLOC}")
message("Build with BSON: ${WITH_BSON}")
message("Build with MATIO: ${WITH_MATIO}")
if(${WITH_MATIO})
message(" MATIO with HDF5: ${MATIO_WITH_HDF5}")
endif()
if(${WITH_MPI})
message("Build with MPI: ${WITH_MPI}")
endif()
message("Build with EXODUSII: ${WITH_EXODUSII}")
message("\n-------Solvers-------")
message("Build with UMFPACK: ${WITH_UMFPACK}")
message("Build with PARALUTION: ${WITH_PARALUTION}")
message("Build with PETSC: !TO_DO!")
message("Build with MUMPS: ${WITH_MUMPS}")
message("Build with SUPERLU${MT}: ${WITH_SUPERLU}")
message("Build with TRILINOS: ${WITH_TRILINOS}")
message("---------------------")
message("\n")