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
...@@ -4,7 +4,7 @@ include(AddAmdisExecutable) ...@@ -4,7 +4,7 @@ include(AddAmdisExecutable)
set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, ISTL") set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, ISTL")
set_property(CACHE BACKEND PROPERTY STRINGS "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 find_package(MTL REQUIRED
PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4) PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4)
...@@ -28,7 +28,7 @@ if (BACKEND STREQUAL "MTL") ...@@ -28,7 +28,7 @@ if (BACKEND STREQUAL "MTL")
COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS} COMPILE_DEFINITIONS ${MTL_COMPILE_DEFINITIONS}
INCLUDE_DIRS ${MTL_INCLUDE_DIRS}) INCLUDE_DIRS ${MTL_INCLUDE_DIRS})
endif (MTL_FOUND) endif (MTL_FOUND)
elseif (BACKEND STREQUAL "EIGEN") elseif (BACKEND STREQUAL "EIGEN" OR BACKEND STREQUAL "EIGEN3")
find_package(Eigen3 REQUIRED 3.3.5) find_package(Eigen3 REQUIRED 3.3.5)
set(HAVE_EIGEN EIGEN_FOUND) set(HAVE_EIGEN EIGEN_FOUND)
...@@ -39,6 +39,10 @@ elseif (BACKEND STREQUAL "EIGEN") ...@@ -39,6 +39,10 @@ elseif (BACKEND STREQUAL "EIGEN")
COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS} COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS}
INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS}) INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
endif (EIGEN3_FOUND) endif (EIGEN3_FOUND)
elseif (NOT dune-istl_FOUND) elseif (BACKEND STREQUAL "ISTL")
message(FATAL "Need dune-istl, MTL, or Eigen3 as linear algebra backend. Change flag BACKEND!") 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 () endif ()
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
#define AMDIS_VERSION_REVISION @AMDIS_VERSION_REVISION@ #define AMDIS_VERSION_REVISION @AMDIS_VERSION_REVISION@
/* Define to ENABLE_MTL if the MTL library is available */ /* 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 */ /* 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 */ /* some detected compiler features may be used in AMDiS */
#cmakedefine AMDIS_HAS_CXX_FOLD_EXPRESSIONS 1 #cmakedefine AMDIS_HAS_CXX_FOLD_EXPRESSIONS 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment