forked from xsdk-project/xsdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
97 lines (76 loc) · 2.32 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
cmake_minimum_required(VERSION 3.12)
project(xsdk-examples
DESCRIPTION "xSDK Examples"
LANGUAGES CXX C)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(FindPackageHandleStandardArgs)
# build options
option(ENABLE_CUDA "Enable CUDA" OFF)
option(CMAKE_CUDA_ARCHITECTURES "CUDA architecture(s) to target" "70")
option(ENABLE_HYPRE "Enable hypre" ON)
set(HYPRE_DIR "${HYPRE_DIR}" CACHE PATH "Path to hypre installation directory")
option(ENABLE_MFEM "Enable MFEM" ON)
set(MFEM_DIR "${MFEM_DIR}" CACHE PATH "Path to MFEM installation directory")
option(ENABLE_MAGMA "Enable MAGMA" OFF)
set(MAGMA_DIR "${MAGMA_DIR}" CACHE PATH "Path to MAGMA installation directory")
option(ENABLE_PETSC "Enable PETSc" ON)
set(PETSC_DIR "${PETSC_DIR}" CACHE PATH "Path to PETSc installation directory")
option(ENABLE_SUNDIALS "Enable SUNDIALS" ON)
set(SUNDIALS_DIR "${SUNDIALS_DIR}" CACHE PATH "Path to SUNDIALS installation directory")
option(ENABLE_SUPERLU "Enable SuperLU" ON)
set(SUPERLUDIST_DIR "${SUPERLUDIST__DIR}" CACHE PATH "Path to SuperLU_DIST installation directory")
option(ENABLE_TRILINOS "Enable TRILINOS" ON)
set(TRILINOS_DIR "${Trilinos_DIR}" CACHE PATH "Path to Trilinos installation directory")
set(METIS_DIR "${METIS_DIR}" CACHE PATH "Path to Metis installation directory")
if(ENABLE_CUDA)
enable_language(CUDA)
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
endif()
# check for hypre
if(ENABLE_HYPRE)
find_package(HYPRE REQUIRED)
endif()
# check for MFEM
if(ENABLE_MFEM)
find_package(ZLIB REQUIRED)
find_package(MFEM REQUIRED)
find_package(Ginkgo REQUIRED)
endif()
# check for MAGMA
if(ENABLE_MAGMA)
find_package(MAGMA REQUIRED)
endif()
# check for PETSC
if(ENABLE_PETSC)
find_package(PETSC REQUIRED)
endif()
# check for SUNDIALS
if(ENABLE_SUNDIALS)
find_package(SUNDIALS REQUIRED)
endif()
# check for SuperLU DIST
if(ENABLE_SUPERLU)
find_package(SUPERLUDIST REQUIRED)
endif()
# check for math
find_library(MATH_LIBRARY NAMES m)
# check for metis
find_package(METIS)
# check for MPI
find_package(MPI REQUIRED)
# example subdirectories
if(ENABLE_HYPRE)
add_subdirectory(hypre)
endif()
if(ENABLE_MFEM)
add_subdirectory(mfem)
endif()
if(ENABLE_PETSC)
add_subdirectory(petsc)
endif()
if(ENABLE_SUNDIALS)
add_subdirectory(sundials)
endif()
if(ENABLE_TRILINOS)
add_subdirectory(trilinos)
endif()