Commit 4107aef8 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

test all backends in gitlabci

parent bb5cd90d
Pipeline #5676 failed
......@@ -15,18 +15,46 @@ dune-2.7:
- duneci-standard-test
- dunecontrol --current make -j2 examples
dune-git:
image: registry.dune-project.org/docker/ci/dune:git-debian-10-gcc-8-17
dune-git-clang:
image: registry.dune-project.org/docker/ci/dune:git-ubuntu-18.04-clang-6-17
script:
- duneci-standard-test
- dunecontrol --current make -j2 examples
dune-git-istl-gcc:
image: registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables:
- DUNECI_CMAKE_FLAGS: "-DBACKEND=ISTL"
- DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
script:
- duneci-standard-test
- dunecontrol --current make -j2 examples
dune-git-petsc-gcc:
image: registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables:
- DUNECI_CMAKE_FLAGS: "-DBACKEND=PETSC"
- DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
script:
- duneci-standard-test
- dunecontrol --current make -j2 examples
dune-git-eigen-gcc:
image: registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables:
DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
- DUNECI_CMAKE_FLAGS: "-DBACKEND=EIGEN"
- DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
script:
- duneci-standard-test
- dunecontrol --current make -j2 examples
dune-git-full:
dune-git-mtl-gcc:
image: registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables:
DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
- DUNECI_CMAKE_FLAGS: "-DBACKEND=MTL -DMTL_INCLUDE_DIR=/duneci/libs/mtl4"
- DUNECI_CXXFLAGS: "-Wno-deprecated-declarations -Wno-cpp"
before_script:
- git clone https://gitlab.mn.tu-dresden.de/spraetor/mtl4.git /duneci/libs/mtl4
script:
- duneci-standard-test
- dunecontrol --current make -j2 examples
......@@ -26,7 +26,6 @@ dune_target_link_libraries(amdis fmt)
if (MTL_FOUND)
dune_target_link_libraries(amdis MTL::MTL)
target_compile_definitions(amdis PUBLIC ENABLE_MTL)
endif (MTL_FOUND)
if (HYPRE_FOUND)
......@@ -36,14 +35,13 @@ endif(HYPRE_FOUND)
if (EIGEN3_FOUND)
dune_target_link_libraries(amdis Eigen3::Eigen)
target_compile_definitions(amdis PUBLIC ENABLE_EIGEN)
endif (EIGEN3_FOUND)
if (PETSc_FOUND)
dune_target_link_libraries(amdis PETSc::PETSc)
target_compile_definitions(amdis PUBLIC ENABLE_PETSC)
endif (PETSc_FOUND)
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS)
target_compile_options(amdis PUBLIC "-Wall" "-Wpedantic"
......
#pragma once
#if AMDIS_HAS_MTL
#if AMDIS_BACKEND == AMDIS_BACKEND_MTL
#include <amdis/linearalgebra/mtl/Constraints.hpp>
#include <amdis/linearalgebra/mtl/ITL_Solver.hpp>
......@@ -9,7 +9,7 @@
#include <amdis/linearalgebra/mtl/MatrixBackend.hpp>
#include <amdis/linearalgebra/mtl/VectorBackend.hpp>
#elif AMDIS_HAS_EIGEN
#elif AMDIS_BACKEND == AMDIS_BACKEND_EIGEN
#include <amdis/linearalgebra/eigen/Constraints.hpp>
#include <amdis/linearalgebra/eigen/SolverCreator.hpp>
......@@ -17,7 +17,7 @@
#include <amdis/linearalgebra/eigen/MatrixBackend.hpp>
#include <amdis/linearalgebra/eigen/VectorBackend.hpp>
#elif AMDIS_HAS_PETSC
#elif AMDIS_BACKEND == AMDIS_BACKEND_PETSC
#include <amdis/linearalgebra/petsc/Constraints.hpp>
#include <amdis/linearalgebra/petsc/SolverCreator.hpp>
......@@ -25,7 +25,7 @@
#include <amdis/linearalgebra/petsc/MatrixBackend.hpp>
#include <amdis/linearalgebra/petsc/VectorBackend.hpp>
#else // ISTL
#elif AMDIS_BACKEND == AMDIS_BACKEND_ISTL
#include <amdis/linearalgebra/istl/Constraints.hpp>
#include <amdis/linearalgebra/istl/ISTLSolver.hpp>
......
......@@ -18,12 +18,19 @@ endif()
if (NOT BACKEND)
set(BACKEND "ISTL" CACHE STRING "LinearAlgebra backend. One of MTL, EIGEN, PETSC, ISTL")
set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "ISTL" "PETSC")
set_property(CACHE BACKEND PROPERTY STRINGS "MTL" "EIGEN" "PETSC" "ISTL")
endif (NOT BACKEND)
if (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
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")
find_package(MTL REQUIRED)
set(AMDIS_HAS_MTL TRUE)
set(AMDIS_BACKEND 2)
find_package(HYPRE)
set(AMDIS_HAS_HYPRE ${HYPRE_FOUND})
......@@ -31,16 +38,14 @@ if (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
elseif (BACKEND STREQUAL "EIGEN" OR BACKEND STREQUAL "EIGEN3")
find_package(Eigen3 REQUIRED 3.3.5)
set(AMDIS_HAS_EIGEN TRUE)
set(AMDIS_BACKEND 3)
message(STATUS " Found Eigen3, version: ${Eigen3_VERSION}")
elseif (BACKEND STREQUAL "PETSC")
find_package(PETSc REQUIRED)
set(AMDIS_HAS_PETSC TRUE)
set(AMDIS_BACKEND 4)
elseif (BACKEND STREQUAL "ISTL")
if (NOT dune-istl_FOUND)
message(FATAL_ERROR "Need dune-istl, MTL, PETSc, or Eigen3 as linear algebra backend. Change flag BACKEND!")
endif ()
else ()
message(FATAL_ERROR "BACKEND must be one of MTL, EIGEN, PETSC, ISTL")
message(FATAL_ERROR "BACKEND must be one of MTL, EIGEN, PETSC, ISTL, ISTL_BLOCKED")
endif ()
......@@ -52,6 +52,14 @@
/* Define to true if the PETSc library is available */
#cmakedefine AMDIS_HAS_PETSC 1
#define AMDIS_BACKEND_ISTL 1
#define AMDIS_BACKEND_MTL 2
#define AMDIS_BACKEND_EIGEN 3
#define AMDIS_BACKEND_PETSC 4
/* Define one of the IDs defined above representing the AMDiS backend*/
#define AMDIS_BACKEND @AMDIS_BACKEND@
/* some detected compiler features may be used in AMDiS */
#cmakedefine AMDIS_HAS_EXPANSION_STATEMENTS 1
......
Markdown is supported
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