-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
142 lines (119 loc) · 5.44 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
cmake_minimum_required(VERSION 2.8)
project(HAMeRS C CXX Fortran)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
find_package(MPI)
if (MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
endif()
option(HAMERS_USE_BOOST "HAMERS_USE_BOOST" ON)
if("${HAMERS_USE_BOOST}")
# Find the boost package
find_package(Boost 1.45 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
endif()
# Find the hdf5 package
find_package(HDF5 1.8.4 REQUIRED)
include_directories(${HDF5_INCLUDE_DIR})
link_directories(${HDF5_LIBRARY_DIRS})
# Find the zlib package
if (WITH_ZLIB)
set(ZLIB_LIBRARIES $ENV{ZLIB_ROOT})
set(ZLIB_LIBRARY_DIRS "${ZLIB_ROOT}/lib")
set(ZLIB_INCLUDE_DIRS "${ZLIB_ROOT}/include")
include_directories(${ZLIB_INCLUDE_DIRS})
link_directories(${ZLIB_LIBRARY_DIRS})
endif()
# Find the SAMRAI package
find_package(SAMRAI REQUIRED)
include_directories(${SAMRAI_INCLUDE_DIR})
link_directories(${SAMRAI_LIBRARY_DIRS})
message(STATUS "SAMRAI_INCLUDE_DIR: " ${SAMRAI_INCLUDE_DIR})
# Set the preprocessor variables
option(HAMERS_ENABLE_SIMD "HAMERS_ENABLE_SIMD" ON)
option(HAMERS_DEBUG_CHECK_ASSERTIONS "HAMERS_DEBUG_CHECK_ASSERTIONS" ON)
option(HAMERS_DEBUG_CHECK_DEV_ASSERTIONS "HAMERS_DEBUG_CHECK_DEV_ASSERTIONS" ON)
configure_file(${HAMeRS_SOURCE_DIR}/include/HAMeRS_config.hpp.in ${HAMeRS_SOURCE_DIR}/include/HAMeRS_config.hpp)
# Set the compilers
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_Fortran_COMPILER $ENV{F77})
message(STATUS "CMAKE_C_COMPILER_ID: " ${CMAKE_C_COMPILER_ID})
message(STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID})
message(STATUS "CMAKE_Fortran_COMPILER_ID: " ${CMAKE_Fortran_COMPILER_ID})
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
# Intel compiler suite
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if (CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall -Wno-deprecated -qopenmp -xhost -qopt-report")
elseif (CMAKE_BUILD_TYPE MATCHES "KNL")
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall -Wno-deprecated -qopenmp -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 -qopt-report")
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "-std=c++11 -g -O0 -Wall -Wno-deprecated")
elseif (CMAKE_BUILD_TYPE MATCHES "AMD")
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall -Wno-deprecated -qopenmp -march=core-avx2 -qopt-report")
endif()
# Standard GNU compilers
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall -Wno-deprecated -fopenmp")
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "-std=c++11 -g -O0 -Wall -Wno-deprecated")
endif()
# Clang compilers
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -Wall -Wno-deprecated -fopenmp")
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "-std=c++11 -g -O0 -Wall -Wno-deprecated")
endif()
endif()
# Directories to look for include files
include_directories(${HAMeRS_SOURCE_DIR}/include)
# Directories to look for libraries
link_directories(${HAMeRS_BINARY_DIR}/algs/patch_strategy
${HAMeRS_BINARY_DIR}/algs/integrator
${HAMeRS_BINARY_DIR}/apps/Euler
${HAMeRS_BINARY_DIR}/apps/Navier-Stokes
${HAMeRS_BINARY_DIR}/flow/flow_models
${HAMeRS_BINARY_DIR}/flow/convective_flux_reconstructors
${HAMeRS_BINARY_DIR}/flow/diffusive_flux_reconstructors
${HAMeRS_BINARY_DIR}/flow/nonconservative_diffusive_flux_divergence_operators
${HAMeRS_BINARY_DIR}/flow/refinement_taggers
${HAMeRS_BINARY_DIR}/extn/patch_hierarchies
${HAMeRS_BINARY_DIR}/extn/visit_data_writer
${HAMeRS_BINARY_DIR}/util
${HAMeRS_BINARY_DIR}/util/basic_boundary_conditions
${HAMeRS_BINARY_DIR}/util/derivatives
${HAMeRS_BINARY_DIR}/util/differences
${HAMeRS_BINARY_DIR}/util/gradient_sensors
${HAMeRS_BINARY_DIR}/util/mixing_rules
${HAMeRS_BINARY_DIR}/util/mixing_rules/equations_of_state
${HAMeRS_BINARY_DIR}/util/wavelet_transform
${HAMeRS_BINARY_DIR}/util/MPI_helpers)
add_subdirectory(src/algs/patch_strategy)
add_subdirectory(src/algs/integrator)
add_subdirectory(src/apps/Euler)
add_subdirectory(src/apps/Navier-Stokes)
add_subdirectory(src/exec)
add_subdirectory(src/flow/flow_models)
add_subdirectory(src/flow/convective_flux_reconstructors)
add_subdirectory(src/flow/diffusive_flux_reconstructors)
add_subdirectory(src/flow/nonconservative_diffusive_flux_divergence_operators)
add_subdirectory(src/flow/refinement_taggers)
add_subdirectory(src/extn/patch_hierarchies)
add_subdirectory(src/extn/visit_data_writer)
add_subdirectory(src/test)
add_subdirectory(src/util)
add_subdirectory(src/util/basic_boundary_conditions)
add_subdirectory(src/util/derivatives)
add_subdirectory(src/util/differences)
add_subdirectory(src/util/filters)
add_subdirectory(src/util/gradient_sensors)
add_subdirectory(src/util/mixing_rules)
add_subdirectory(src/util/mixing_rules/equations_of_state)
add_subdirectory(src/util/wavelet_transform)
add_subdirectory(src/util/MPI_helpers)