forked from AlTarFramework/altar
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
95 lines (80 loc) · 2.33 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
# -*- cmake -*-
#
# michael a.g. aïvázis <[email protected]>
# (c) 2003-2021 all rights reserved
# cmake setup
# v3.18 is needed to pass Development.Module to FIndPython
cmake_minimum_required(VERSION 3.19...3.25)
# options
option(WITH_CUDA "enable support for CUDA" ON)
# adjust the include path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake)
# get support
include(altar_init)
# ask git for the altar version
altar_getVersion()
# set up the project
project(ALTAR VERSION ${REPO_MAJOR}.${REPO_MINOR}.${REPO_MICRO} LANGUAGES CXX)
# packages
# gsl
find_package(GSL)
# mpi
find_package(MPI)
# python
set(PYTHON_COMPONENTS Interpreter Development.Module)
if(GSL_FOUND)
list(APPEND PYTHON_COMPONENTS NumPy)
endif()
find_package(Python 3.7 REQUIRED COMPONENTS ${PYTHON_COMPONENTS} OPTIONAL_COMPONENTS Development.Embed)
# pyre and pyre cuda
find_package(PYRE)
# set up cmake
altar_cmakeInit()
# set up c++
altar_cxxInit()
# set up python
altar_pythonInit()
# set up cuda
if (WITH_CUDA AND PYRE_CUDA_FOUND)
# check whether cuda toolkit is available
include(CheckLanguage)
check_language(CUDA)
# available
if(CMAKE_CUDA_COMPILER)
# turn it on
enable_language(CUDA)
message(STATUS "CUDA Toolkit found and CUDA support is enabled")
# other cuda settings
# enforce linker for CUDA modules; not properly set for some systems
set(CMAKE_CUDA_HOST_LINK_LAUNCHER ${CMAKE_CXX_COMPILER})
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
# cuda toolkit not available
else()
# turn off WITH_CUDA option
message(STATUS "CUDA Toolkit or Pyre cuda extension not found; set WITH_CUDA to OFF")
set(WITH_CUDA OFF)
endif()
endif()
# initialize the variables that describe the staging directory layout
altar_stagingInit()
# initialize the variables that describe the install directory layout
altar_destinationInit()
# build the framework
add_subdirectory(altar)
if(WITH_CUDA)
add_subdirectory(cuda)
endif()
# build the models
add_subdirectory(models/emhp)
add_subdirectory(models/gaussian)
add_subdirectory(models/mogi)
add_subdirectory(models/cdm)
add_subdirectory(models/linear)
add_subdirectory(models/seismic)
add_subdirectory(models/cudalinear)
add_subdirectory(models/sir)
add_subdirectory(models/regression)
# end of file