-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
73 lines (50 loc) · 2.23 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
cmake_minimum_required(VERSION 3.10)
# set the project name
project(FARRSIGHT)
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "None")
endif()
option(ENABLE_GPU_BUILD "build OpenACC GPU version" OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(OpenMP REQUIRED)
# from Leighton
#Some PGI versions seem to require a link flag for OpenMP
set_property(TARGET OpenMP::OpenMP_C APPEND
PROPERTY
INTERFACE_LINK_LIBRARIES
$<$<CXX_COMPILER_ID:PGI>:-mp>)
#Creating an interface for OpenACC
add_library(OpenACC_CXX INTERFACE)
set_property(TARGET OpenACC_CXX PROPERTY
INTERFACE_COMPILE_OPTIONS
-acc
# -ta=tesla:ccall,cc60$<$<CONFIG:Debug>:,time>
-Minfo)
set_property(TARGET OpenACC_CXX PROPERTY
INTERFACE_LINK_LIBRARIES
-acc
# -ta=tesla:ccall,cc60
)
if(ENABLE_GPU_BUILD AND NOT (CMAKE_C_COMPILER_ID MATCHES PGI))
message(STATUS "GPU build requires PGI compilers! Turning GPU build off.")
set(ENABLE_GPU_BUILD OFF CACHE BOOL "build OpenACC GPU version" FORCE)
endif()
add_subdirectory(src)
include_directories(inc)
include_directories(inc_eigen/eigen-3.3.7)
link_directories(src)
# add the executable
add_executable(farrsight run_FARRSIGHT.cpp)
target_link_libraries(farrsight AMRObj
PanelObj
icsObj)
target_link_libraries(farrsight OpenMP::OpenMP_CXX)
install(TARGETS farrsight DESTINATION bin)
enable_testing()
add_test(NAME Runs COMMAND farrsight 1 0.0 1.0 -2.0 2.0)