AmdisMacros.cmake 1.24 KB
Newer Older
1
2
include(AmdisCXXFeatures)
include(AddAmdisExecutable)
3

4
5
6
7
8
9
# some optimization of the compile times
find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
  set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif ()

Praetorius, Simon's avatar
Praetorius, Simon committed
10
11
if (NOT BACKEND)
  set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, PETSC, ISTL")
12
  set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "PETSC" "ISTL")
Praetorius, Simon's avatar
Praetorius, Simon committed
13
endif (NOT BACKEND)
Praetorius, Simon's avatar
Praetorius, Simon committed
14

15
16
17
18
19
20
21
if (BACKEND STREQUAL "ISTL")
  set(AMDIS_BACKEND 1)
  if (NOT dune-istl_FOUND)
    message(FATAL_ERROR "Need dune-istl for backend ISTL. Either install the dune-istl module, or change the BACKEND!")
  endif ()

elseif (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
22
  find_package(MTL REQUIRED)
Praetorius, Simon's avatar
Praetorius, Simon committed
23
  set(AMDIS_HAS_MTL TRUE)
24
  set(AMDIS_BACKEND 2)
25
26

  find_package(HYPRE)
Praetorius, Simon's avatar
Praetorius, Simon committed
27
28
  set(AMDIS_HAS_HYPRE ${HYPRE_FOUND})

29
elseif (BACKEND STREQUAL "EIGEN" OR BACKEND STREQUAL "EIGEN3")
30
  find_package(Eigen3 REQUIRED 3.3.5)
Praetorius, Simon's avatar
Praetorius, Simon committed
31
  set(AMDIS_HAS_EIGEN TRUE)
32
  set(AMDIS_BACKEND 3)
Praetorius, Simon's avatar
Praetorius, Simon committed
33
34
  message(STATUS "  Found Eigen3, version: ${Eigen3_VERSION}")

Praetorius, Simon's avatar
Praetorius, Simon committed
35
36
elseif (BACKEND STREQUAL "PETSC")
  find_package(PETSc REQUIRED)
Praetorius, Simon's avatar
Praetorius, Simon committed
37
  set(AMDIS_HAS_PETSC TRUE)
38
  set(AMDIS_BACKEND 4)
Praetorius, Simon's avatar
Praetorius, Simon committed
39

40
else ()
41
  message(FATAL_ERROR "BACKEND must be one of MTL, EIGEN, PETSC, ISTL, ISTL_BLOCKED")
42
endif ()