Skip to content
Snippets Groups Projects
Commit 9635a36e authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[!372] Fix make build_tests without optional dependencies

Merge branch 'fix/non-mpi-build' into 'master'

ref:core/dune-istl\> When MPI is not available or explicitly disabled with the
CMake build option -DCMAKE_IDSABLE_FIND_PACKAGE_MPI=TRUE, some tests were
unable to build. I've either fixed or disabled those tests (for those tests
that were testing MPI-only features).

I've also fixed overlappingschawarztest, which did not build when SuperLU was
not found.

The commit concerning MPI should probably be backported to the releases/2.7
branch, as it is affected by the same build failures. The fix for
overlappingschwarztest only appeared after commit
05f80ffa which fixed a bug which previously
disabled the test. Since this commit is not on the releases/2.7 branch, there
is probably no need to backport my fix for overlappingschwarztest.

See merge request [core/dune-istl!372]

  [core/dune-istl!372]: gitlab.dune-project.org/core/dune-istl/merge_requests/372
parents d645bec5 e5ead46f
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,8 @@ function(add_factory_test BLOCK)
STRING(REGEX REPLACE "[^a-zA-Z0-9]" "" BLOCK_CLEAN ${BLOCK})
set(DEFINE_DEACTIVATE_AMG_DIRECTSOLVER "#define DISABLE_AMG_DIRECTSOLVER 1")
configure_file(solverfactorytest.cc.in solverfactorytest_${BLOCK_CLEAN}.cc)
dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc)
dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc
CMAKE_GUARD HAVE_MPI)
string(REGEX MATCH "LoopSIMD" _matched "${BLOCK}")
if(NOT _matched)
set(DEFINE_DEACTIVATE_AMG_DIRECTSOLVER "")
......@@ -87,6 +88,7 @@ function(add_factory_test BLOCK)
MPI_RANKS 1 2 4
TIMEOUT 600
CMAKE_GUARD
HAVE_MPI
SuiteSparse_CHOLMOD_FOUND
SuiteSparse_LDL_FOUND
SuiteSparse_SPQR_FOUND
......
......@@ -52,7 +52,7 @@ int testMatrixMarket(int N)
storeMatrixMarket(mat, std::string("testmat"), comm);
storeMatrixMarket(bv, std::string("testvec"), comm, false);
#else
typedef Dune::MatrixAdapter<BCRSMat,BVector,BVector> Operator;
typedef Dune::MatrixAdapter<Matrix,Vector,Vector> Operator;
Operator op(mat);
op.apply(bv, cv);
......
......@@ -257,7 +257,6 @@ Dune::TestSuite test(int argc, char** argv)
int main(int argc, char** argv){
Dune::TestSuite suite;
suite.require(HAVE_SUPERLU || HAVE_SUITESPARSE_UMFPACK) << "You need SuperLU or SuiteSparse's UMFPack to run this test.";
suite.subTest(test<Dune::FieldMatrix<double, 1, 1>, Dune::FieldVector<double, 1>>(argc, argv));
suite.subTest(test<double, double>(argc, argv));
return suite.exit();
......
......@@ -115,6 +115,7 @@ int main(int argc, char** argv)
scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
}
#if HAVE_MPI
// Test the ParallelScalarProduct class
{
using Vector = BlockVector<FieldVector<double,BlockSize> >;
......@@ -139,6 +140,7 @@ int main(int argc, char** argv)
ScalarProduct scalarProduct(communicator,SolverCategory::nonoverlapping);
scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
}
#endif
return t.exit();
}
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