-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
97 lines (73 loc) · 4.15 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
# ===========================================================================
# ██╗ ██╗███████╗███╗ ██╗ ██████╗ ███████╗██╗ ██╗████████╗
# ██║ ██║██╔════╝████╗ ██║██╔═══██╗ ██╔════╝╚██╗██╔╝╚══██╔══╝
# ██║ █╗ ██║█████╗ ██╔██╗ ██║██║ ██║ █████╗ ╚███╔╝ ██║
# ██║███╗██║██╔══╝ ██║╚██╗██║██║ ██║ ██╔══╝ ██╔██╗ ██║
# ╚███╔███╔╝███████╗██║ ╚████║╚██████╔╝ ███████╗██╔╝ ██╗ ██║
# ╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝
# ===========================================================================
# License
# This file is part of WENO Ext.
#
# WENO Ext is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WENO Ext is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with WENO Ext. If not, see <http://www.gnu.org/licenses/>.
#
#
# Author
# Jan Wilhelm Gärtner <jan.gaertner@outlook.de> Copyright (C) 2020
#
# ===========================================================================
# CMake File for WENOEXT Project
# CMake is used instead of OpenFOAM standard wmake as it allows
# for some more flexibility between the different OpenFOAM distributions
# without writing extensive bash scripts to do this
# Further, it integrates directly with Catch2 and the Blaze library if
# needed
# ===========================================================================
cmake_minimum_required (VERSION 3.10)
# Project name
project (WENOEXT-PerformanceTest)
# Enforce C++ 14 standard
# C++ 14 is required for blaze
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set minimum gnu compiler version
set(GNU_MIN_VERSION 7.5.0)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (NOT CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL ${GNU_MIN_VERSION})
message(WARNING "GNU compiler version ${CMAKE_CXX_COMPILER_VERSION} is below ${GNU_MIN_VERSION}")
endif()
endif()
# Check that OpenFoam environment variables are available
if (NOT DEFINED ENV{FOAM_USER_LIBBIN} OR NOT DEFINED ENV{FOAM_SRC})
message(FATAL_ERROR "OpenFOAM environemt variables not available")
endif()
set(WENOEXT_PATH "../WENOEXT/build/installed")
message("Current WENOEXT path: ${WENOEXT_PATH}")
# Add the WENOEXT library
include(${WENOEXT_PATH}/lib/cmake/WENOEXT/WENOEXT.cmake)
# Set c++ flags
add_compile_options(
-march=native
-Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-deprecated
-ftemplate-depth-100
-O3
)
set(CMAKE_SHARED_LINKER_FLAGS "-fPIC -Xlinker --add-needed -Xlinker --no-as-needed")
add_definitions(-Dlinux64 -DWM_ARCH_OPTION=$ENV{WM_ARCH_OPTION} -DWM_DP -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} -DNoRepository)
#===============================================================================
# Add subdirectories
#===============================================================================
add_subdirectory(geometryWENO/src)
add_subdirectory(WENOCoeff/src)
add_subdirectory(WENOBase/src)