Skip to content
Snippets Groups Projects
Commit 557efb43 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/cmake_backend_check' into 'master'

check whether BACKEND is either MTL, EIGEN, or ISTL

See merge request !13
parents 4dee72cf c40196fe
No related branches found
No related tags found
1 merge request!13check whether BACKEND is either MTL, EIGEN, or ISTL
......@@ -4,7 +4,7 @@ include(AddAmdisExecutable)
set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, ISTL")
set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "ISTL")
if (BACKEND STREQUAL "MTL")
if (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
find_package(MTL REQUIRED
PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
......@@ -28,7 +28,7 @@ if (BACKEND STREQUAL "MTL")
COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS}
INCLUDE_DIRS ${MTL_INCLUDE_DIRS})
endif (MTL_FOUND)
elseif (BACKEND STREQUAL "EIGEN")
elseif (BACKEND STREQUAL "EIGEN" OR BACKEND STREQUAL "EIGEN3")
find_package(Eigen3 REQUIRED 3.3.5)
set(HAVE_EIGEN EIGEN_FOUND)
......@@ -39,6 +39,10 @@ elseif (BACKEND STREQUAL "EIGEN")
COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS}
INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
endif (EIGEN3_FOUND)
elseif (NOT dune-istl_FOUND)
message(FATAL "Need dune-istl, MTL, or Eigen3 as linear algebra backend. Change flag BACKEND!")
elseif (BACKEND STREQUAL "ISTL")
if (NOT dune-istl_FOUND)
message(FATAL_ERROR "Need dune-istl, MTL, or Eigen3 as linear algebra backend. Change flag BACKEND!")
endif ()
else ()
message(FATAL_ERROR "BACKEND must be one of MTL, EIGEN, ISTL")
endif ()
......@@ -41,10 +41,10 @@
#define AMDIS_VERSION_REVISION @AMDIS_VERSION_REVISION@
/* Define to ENABLE_MTL if the MTL library is available */
#cmakedefine HAVE_MTL ENABLE_MTL
#cmakedefine HAVE_MTL 1
/* Define to ENABLE_EIGEN if the Eigen3 library is available */
#cmakedefine HAVE_EIGEN ENABLE_EIGEN
#cmakedefine HAVE_EIGEN 1
/* some detected compiler features may be used in AMDiS */
#cmakedefine AMDIS_HAS_CXX_FOLD_EXPRESSIONS 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment