forked from CASL/Futility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
170 lines (152 loc) · 4.91 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
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
# Futility Development Group !
# All rights reserved. !
# !
# Futility is a jointly-maintained, open-source project between the University !
# of Michigan and Oak Ridge National Laboratory. The copyright and license !
# can be found in LICENSE.txt in the head directory of this repository. !
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
IF (NOT TRIBITS_PROCESSING_PACKAGE)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Settings_Common.cmake)
# CMake requires that you declare the CMake project in the top-level file and
# not in an include file :-(
PROJECT(${PROJECT_NAME} NONE)
# CMake requires this be in the top file and not in an include file :-(
CMAKE_MINIMUM_REQUIRED(VERSION ${TRIBITS_CMAKE_MINIMUM_REQUIRED})
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Configure_Common.cmake)
ELSE()
SET(PNAME Futility)
TRIBITS_PACKAGE(${PNAME})
#
# Configure CMake/TriBITS options for package
#
# Add CMake option for enabling OpenMP
OPTION(${PNAME}_ENABLE_OpenMP
"Use compiler flags for OpenMP support."
${${PROJECT_NAME}_ENABLE_OpenMP}
)
# Define options for 64-bit reals and 64-bit integers
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_DBLREAL
DBL
"Option for using double precision floating point reals as default reals."
ON
)
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_DBLINT
DBLINT
"Option for using 64-bit integers as the default integer."
OFF
)
# Define Package dependent option for MPI TPL
IF(TPL_ENABLE_MPI)
SET(${PNAME}_ENABLE_MPI_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_MPI_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_MPI
HAVE_MPI
"Enable use of MPI libraries."
${${PNAME}_ENABLE_MPI_DEFAULT}
)
# Define Package dependent option for PETSC TPL
IF(TPL_ENABLE_PETSC)
SET(${PNAME}_ENABLE_PETSC_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_PETSC_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_PETSC
FUTILITY_HAVE_PETSC
"Enable use of PETSC libraries."
${${PNAME}_ENABLE_PETSC_DEFAULT}
)
# Define Package dependent option for SLEPC TPL
IF(TPL_ENABLE_SLEPC)
SET(${PNAME}_ENABLE_SLEPC_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_SLEPC_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_SLEPC
FUTILITY_HAVE_SLEPC
"Enable use of SLEPC libraries."
${${PNAME}_ENABLE_SLEPC_DEFAULT}
)
# Define Package dependent option for HDF5 TPL
IF(TPL_ENABLE_HDF5)
SET(${PNAME}_ENABLE_HDF5_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_HDF5_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_HDF5
HAVE_HDF5
"Enable use of HDF5 library."
${${PNAME}_ENABLE_HDF5_DEFAULT}
)
# Define Package dependent option for PARDISO TPL
IF(TPL_ENABLE_PARDISO)
SET(${PNAME}_ENABLE_PARDISO_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_PARDISO_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_PARDISO
HAVE_PARDISO
"Enable use of PETSC libraries."
${${PNAME}_ENABLE_PARDISO_DEFAULT}
)
# Package dependent option for BLAS TPL
IF(TPL_ENABLE_BLAS OR TPL_ENABLE_MKL)
SET(${PNAME}_ENABLE_BLAS_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_BLAS_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_BLAS
HAVE_BLAS
"Enable use of BLAS libraries."
${${PNAME}_ENABLE_BLAS_DEFAULT}
)
# Define Package dependent option for MKL TPL
IF(TPL_ENABLE_MKL)
SET(${PNAME}_ENABLE_MKL_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_MKL_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_MKL
HAVE_MKL
"Enable use of MKL libraries."
${${PNAME}_ENABLE_MKL_DEFAULT}
)
# Define Package dependent option for PAPI TPL
IF(TPL_ENABLE_PAPI)
SET(${PNAME}_ENABLE_PAPI_DEFAULT ON)
ELSE()
SET(${PNAME}_ENABLE_PAPI_DEFAULT OFF)
ENDIF()
TRIBITS_ADD_OPTION_AND_DEFINE(
${PNAME}_ENABLE_PAPI
HAVE_PAPI
"Enable use of PAPI libraries."
${${PNAME}_ENABLE_PAPI_DEFAULT}
)
# Set compiler options for this package using the Futility configuration.
# NOTE: It appears that this must come before the package name is defined.
# These options are only defined for this package.
INCLUDE(${PNAME}_Compiler_Config)
#
#Enable test categories
#
#
# Have TRIBITS process the package
#
ADD_SUBDIRECTORY(src)
TRIBITS_ADD_TEST_DIRECTORIES(unit_tests)
TRIBITS_ADD_EXAMPLE_DIRECTORIES(examples)
TRIBITS_PACKAGE_POSTPROCESS()
UNSET(PNAME)
ENDIF()