-
Notifications
You must be signed in to change notification settings - Fork 82
/
CMakeLists.txt
125 lines (98 loc) · 4.51 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
cmake_minimum_required(VERSION 3.1)
project(SAMRAI C CXX Fortran)
set(SAMRAI_VERSION_MAJOR 4)
set(SAMRAI_VERSION_MINOR 3)
set(SAMRAI_VERSION_PATCHLEVEL 0)
set(SAMRAI_VERSION
"${SAMRAI_VERSION_MAJOR}.${SAMRAI_VERSION_MINOR}.${SAMRAI_VERSION_PATCHLEVEL}")
#------------------------------------------------------------------------------
# Initialize BLT build system
#------------------------------------------------------------------------------
if (DEFINED BLT_SOURCE_DIR)
# Support a shared BLT outside of the repository if given a BLT_SOURCE_DIR
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR "Cannot find SetupBLT.cmake in [${BLT_SOURCE_DIR}]")
endif()
else()
# Use internal 'blt' submodule path if BLT_SOURCE_DIR not provided
set(BLT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/blt" CACHE PATH "")
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR "The BLT submodule is not present. \
If in the git repository, please run the following commands:\n \
git submodule init\n \
git submodule update")
endif()
endif()
# BLT Options need to be set in the CACHE
set(ENABLE_FORTRAN On CACHE Bool "Enable Fortran")
set(ENABLE_OPENMP Off CACHE Bool "Enable OpenMP")
set(ENABLE_CUDA Off CACHE Bool "Enable CUDA")
set(ENABLE_HIP Off CACHE Bool "Enable HIP")
set(ENABLE_MPI On CACHE Bool "Enable MPI.")
set(ENABLE_TESTS On CACHE Bool "Enable Tests.")
set(ENABLE_DOCS Off CACHE Bool "Enable Docs.")
set(BLT_CXX_STD "c++14" CACHE STRING "Version of C++ standard")
set(gtest_disable_pthreads ON CACHE BOOL "")
message(STATUS "Enable Test Flag Top: ${ENABLE_TESTS} " )
# Third party libraries
option(ENABLE_UMPIRE "Enable UMPIRE memory management" Off)
option(ENABLE_RAJA "Enable RAJA" Off)
option(ENABLE_CONDUIT "Enable CONDUIT" Off)
option(ENABLE_CALIPER "Enable CALIPER" Off)
option(ENABLE_HDF5 "Enable HDF5." On)
option(ENABLE_HYPRE "Enable HYPRE" Off)
option(ENABLE_PETSC "Enable PETSc" Off)
option(ENABLE_SILO "Enable Silo" Off)
option(ENABLE_SUNDIALS "Enable SUNDIALS" Off)
# SAMRAI options
option(ENABLE_SAMRAI_TESTS "Enable SAMRAI Test Programs" On)
option(ENABLE_PERF_TESTS "Enable Performance Tests." Off)
set(MIN_TEST_PROCS 1 CACHE INT "Minimum number of procs for tests.")
set(NUM_PERF_PROCS 8 CACHE INT "Number of processors for performance tests.")
option(ENABLE_CHECK_ASSERTIONS "Enable assertion checking." On)
option(ENABLE_BOX_COUNTING "Turns on box telemetry." Off)
option(ENABLE_DEPRECATED "Build with deprecated features." On)
option(ENABLE_TIMERS "Enable SAMRAI timers." On)
option(ENABLE_TOOLS "Turns on building of executable tools." Off)
option(DEBUG_INITIALIZE_UNDEFINED "Initialize new memory to undefined values" Off)
set(MAXDIM 3 CACHE INT "Maximum allowed dimension")
option(ENABLE_NVTX_REGIONS "Enable NVTX regions with push/pop for NVVP." Off)
set(CUDA_ARCH "sm_70" CACHE STRING "Compute architecture to pass to CUDA builds")
set(CMAKE_CUDA_FLAGS "" CACHE STRING "")
set(CMAKE_INSTALL_LIBDIR lib)
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH Off CACHE Bool "Rpath uses Link path")
set(SAMRAI_RAJA_WORKGROUP_THREADS 512 CACHE INT "Number of workgroup threads")
set(ENABLE_SAMRAI_DEVICE_ALLOC CACHE BOOL "Use Device allocator on allocations for GPU")
include(GNUInstallDirs)
include(${BLT_SOURCE_DIR}/SetupBLT.cmake)
include_directories(${CMAKE_BINARY_DIR}/include)
include(cmake/CMakeBasics.cmake)
set(SAMRAI_LIBRARIES SAMRAI_algs SAMRAI_appu SAMRAI_geom SAMRAI_hier
SAMRAI_math SAMRAI_mesh SAMRAI_pdat SAMRAI_solv SAMRAI_tbox
SAMRAI_xfer)
add_subdirectory(source)
if (ENABLE_TOOLS)
add_subdirectory(tools)
endif()
if (ENABLE_DOCS)
add_subdirectory(docs)
endif()
export(TARGETS ${SAMRAI_LIBRARIES}
FILE ${CMAKE_CURRENT_BINARY_DIR}/SAMRAITargets.cmake)
set(SAMRAI_MODULE "share/SAMRAI/cmake")
file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/include")
set(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${REL_INCLUDE_DIR}")
configure_file(SAMRAIConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/SAMRAIConfig.cmake" @ONLY)
configure_file(SAMRAIConfigVersion.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/SAMRAIConfigVersion.cmake" @ONLY)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/SAMRAIConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/SAMRAIConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_PREFIX}/${SAMRAI_MODULE}
)
install(EXPORT SAMRAITargets DESTINATION
${CMAKE_INSTALL_PREFIX}/${SAMRAI_MODULE})
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/include/SAMRAI
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)