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

4
5
set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, ISTL")
set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "ISTL")
Praetorius, Simon's avatar
Praetorius, Simon committed
6

7
8
9
if (BACKEND STREQUAL "MTL")
  find_package(MTL
    PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
10

11
12
13
14
15
16
  if (MTL_FOUND)
    set(CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
    set(MTL_COMPILE_DEFINITIONS "")
    foreach(feature ${CXX_ELEVEN_FEATURE_LIST})
      list(APPEND MTL_COMPILE_DEFINITIONS "MTL_WITH_${feature}")
    endforeach()
17

18
19
20
21
22
    find_package(SuiteSparse QUIET)
    if (SuiteSparse_FOUND)
      list(APPEND MTL_COMPILE_DEFINITIONS "MTL_HAS_UMFPACK")
    endif (SuiteSparse_FOUND)
  endif (MTL_FOUND)
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  set(HAVE_MTL MTL_FOUND)
  if (MTL_FOUND)
    list(APPEND MTL_COMPILE_DEFINITIONS "ENABLE_MTL=1")
    dune_register_package_flags(
      COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS}
      INCLUDE_DIRS ${MTL_INCLUDE_DIRS})
  endif (MTL_FOUND)
elseif (BACKEND STREQUAL "EIGEN")
  find_package(Eigen3)

  set(HAVE_EIGEN EIGEN_FOUND)
  if (EIGEN3_FOUND)
    message(STATUS "  Found Eigen3, version: ${EIGEN3_VERSION}")
    list(APPEND EIGEN3_DEFINITIONS "ENABLE_EIGEN=1")
    dune_register_package_flags(
      COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS}
      INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
  endif (EIGEN3_FOUND)
endif ()