CMakeLists.txt 6.37 KB
Newer Older
Hamilton, Steven P's avatar
Hamilton, Steven P committed
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
##---------------------------------------------------------------------------##
## MC/CMakeLists.txt
## Thomas M. Evans
## Monday June 20 15:40:52 2011
##---------------------------------------------------------------------------##
## Copyright (C) 2014 Oak Ridge National Laboratory, UT-Battelle, LLC.
##---------------------------------------------------------------------------##
## TriBITS package file for MC package
##---------------------------------------------------------------------------##

INCLUDE(AppendSet)
INCLUDE(ProfugusAddCFlags)

# Add Utils cmake to path
APPEND_SET(CMAKE_MODULE_PATH ${Utils_SOURCE_DIR}/cmake)

##---------------------------------------------------------------------------##
## A) Define the package
##---------------------------------------------------------------------------##

TRIBITS_PACKAGE(MC)

##---------------------------------------------------------------------------##
## B) Set up package-specific options
##---------------------------------------------------------------------------##

# Setup M4 for FORTRAN processing
APPEND_SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Setup debug option
TRIBITS_ADD_DEBUG_OPTION()

# to allow includes like #include "comm/Comm.h"
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/..)

# to allow includes like #include "Utils/config.h"
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/..)

IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
  PROFUGUS_ADD_CXX_FLAGS(
    -Wno-sign-compare
    -Wno-unused-but-set-variable
    -Wno-unused-variable)
ENDIF()

#
# Resolve min/max conflict on Windows
#
IF( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   ADD_DEFINITIONS(-DNOMINMAX)
ENDIF( CMAKE_SYSTEM_NAME MATCHES "Windows" )

##---------------------------------------------------------------------------##
# C) Process the subpackages
##---------------------------------------------------------------------------##

TRIBITS_CONFIGURE_FILE(config.h)

##---------------------------------------------------------------------------##
## SOURCES AND HEADERS

SET(SOURCES "")
SET(HEADERS "")

# geometry sources

FILE(GLOB GEOMETRY_HEADERS geometry/*.hh)
SET(GEOMETRY_SOURCES
  geometry/Bounding_Box.cc
  geometry/Cartesian_Mesh.cc
  geometry/RTK_Geometry.pt.cc
  geometry/Mesh_Geometry.cc
  geometry/Mesh_State.cc
  geometry/RTK_Array.cc
  geometry/RTK_Array.pt.cc
  geometry/RTK_Cell.cc
  geometry/RTK_Functions.cc
  geometry/RTK_State.cc
  )
LIST(APPEND HEADERS ${GEOMETRY_HEADERS})
LIST(APPEND SOURCES ${GEOMETRY_SOURCES})

# sim_ce sources

FILE(GLOB SIM_CE_HEADERS sim_ce/*.hh)
SET(SIM_CE_SOURCES
  )
LIST(APPEND HEADERS ${SIM_CE_HEADERS})
LIST(APPEND SOURCES ${SIM_CE_SOURCES})

# mc sources

FILE(GLOB MC_HEADERS mc/*.hh)
SET(MC_SOURCES
  mc/Box_Shape.cc
  mc/Cell_Tally.pt.cc
  mc/Domain_Transporter.pt.cc
  mc/Fission_Rebalance.pt.cc
  mc/Fission_Source.pt.cc
  mc/Fixed_Source_Solver.pt.cc
  mc/Global_RNG.cc
  mc/Group_Bounds.cc
  mc/KCode_Solver.pt.cc
  mc/Keff_Tally.pt.cc
  mc/Particle.pt.cc
  mc/Particle_Metaclass.pt.cc
  mc/Physics.pt.cc
  mc/Sampler.cc
  mc/Solver.pt.cc
  mc/Source.pt.cc
  mc/Source_Diagnostic_Tally.pt.cc
  mc/Source_Transporter.pt.cc
  mc/Tallier.pt.cc
  mc/Tally.pt.cc
  mc/Uniform_Source.pt.cc
  mc/VR_Roulette.pt.cc
  )
LIST(APPEND HEADERS ${MC_HEADERS})
LIST(APPEND SOURCES ${MC_SOURCES})

# driver sources

FILE(GLOB DRIVER_HEADERS mc_driver/*.hh)
SET(DRIVER_SOURCES
  mc_driver/Manager.pt.cc
  mc_driver/Manager_Builder.cc
  mc_driver/Problem_Builder.pt.cc
  mc_driver/Geometry_Builder.pt.cc
  )
LIST(APPEND HEADERS ${DRIVER_HEADERS})
LIST(APPEND SOURCES ${DRIVER_SOURCES})

LIST(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/config.h)

##---------------------------------------------------------------------------##
## Check for CUDA

SET(USE_CUDA OFF)
IF(${PROJECT_NAME}_ENABLE_CUDA)
  MESSAGE(STATUS "Building ${PACKAGE_NAME} with CUDA support")
  SET(USE_CUDA ON)
ENDIF()

SET(CUDA_HEADERS "")
SET(CUDA_SOURCES "")
IF(USE_CUDA)
  FILE(GLOB CUDA_GEOMETRY_HEADERS cuda_geometry/*.hh)
  SET(CUDA_GEOMETRY_SOURCES
    cuda_geometry/Cartesian_Mesh.cu
    cuda_geometry/Mesh_Geometry.cu
    cuda_rtk/RTK_Cell.cu
    cuda_rtk/RTK_Array.cu
    cuda_rtk/RTK_Geometry.cu
    )
  LIST(APPEND CUDA_HEADERS ${CUDA_GEOMETRY_HEADERS})
  LIST(APPEND CUDA_SOURCES ${CUDA_GEOMETRY_SOURCES})

  FILE(GLOB CUDA_MC_HEADERS cuda_mc/*.hh)
  SET(CUDA_MC_SOURCES
    cuda_mc/Box_Shape.cu
    cuda_mc/Cell_Tally.pt.cu
    cuda_mc/Domain_Transporter.pt.cu
    cuda_mc/Fission_Rebalance.cc
    cuda_mc/Fission_Source.pt.cu
    cuda_mc/Fixed_Source_Solver.pt.cu
    cuda_mc/Keff_Tally.pt.cu
    cuda_mc/KCode_Solver.pt.cu
    cuda_mc/Manager_Builder_Cuda.cu
    cuda_mc/Manager_Cuda.pt.cu
    cuda_mc/Physics.pt.cu
    cuda_mc/RNG_Control.cu
    cuda_mc/Source.pt.cu
    cuda_mc/Source_Provider.pt.cu
    cuda_mc/Source_Transporter.pt.cu
    cuda_mc/Tallier.pt.cu
    cuda_mc/Uniform_Source.pt.cu
    cuda_mc/VR_Roulette.pt.cu
    )
  LIST(APPEND CUDA_HEADERS ${CUDA_MC_HEADERS})
  LIST(APPEND CUDA_SOURCES ${CUDA_MC_SOURCES})
ENDIF()

##---------------------------------------------------------------------------##
## LIBRARY AND INSTALL TARGETS

IF(USE_CUDA)
  PACKAGE_ADD_CUDA_LIBRARY(
    MC_cuda
    NOINSTALLHEADERS ${CUDA_HEADERS}
    SOURCES ${CUDA_SOURCES})
ENDIF()

TRIBITS_ADD_LIBRARY(
  MC
  NOINSTALLHEADERS ${HEADERS}
  SOURCES ${SOURCES})

199
200
201
202
203
204
205
206
207
# Disable building xmc executable

#TRIBITS_ADD_EXECUTABLE(
#  xmc
#  NOEXESUFFIX
#  NOEXEPREFIX
#  SOURCES mc_driver/mc.cc
#  INSTALLABLE
#  )
Hamilton, Steven P's avatar
Hamilton, Steven P committed
208

Hamilton, Steven P's avatar
Hamilton, Steven P committed
209
210
211
212
213
214
215
216
TRIBITS_ADD_EXECUTABLE(
  profugus
  NOEXESUFFIX
  NOEXEPREFIX
  SOURCES mc_driver/profugus.cc
  INSTALLABLE
  )

Hamilton, Steven P's avatar
Hamilton, Steven P committed
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
##---------------------------------------------------------------------------##
# Add tests to this package

TRIBITS_ADD_TEST_DIRECTORIES(
  geometry/test
  mc/test)

IF(USE_CUDA)
  TRIBITS_ADD_TEST_DIRECTORIES(
    cuda_geometry/test
    cuda_mc/test
    cuda_rtk/test)
ENDIF()

##---------------------------------------------------------------------------##
## FINISH SETUP

# Exclude files for source package.
TRIBITS_EXCLUDE_AUTOTOOLS_FILES()

##---------------------------------------------------------------------------##
## D) Do standard postprocessing
##---------------------------------------------------------------------------##

TRIBITS_PACKAGE_POSTPROCESS()

##---------------------------------------------------------------------------##
244
##                      end of MC/CMakeLists.txt
Hamilton, Steven P's avatar
Hamilton, Steven P committed
245
##---------------------------------------------------------------------------##