diff --git a/CMakeLists.txt b/CMakeLists.txt index fb8fbfe4e..99ce9bccb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,12 +132,6 @@ opm_out_dirs () # tests files in tests/, examples in examples/ opm_sources (${project}) -if (NOT SuiteSparse_FOUND) - list(REMOVE_ITEM examples_SOURCES - ${PROJECT_SOURCE_DIR}/examples/sim_simple.cpp - ) -endif (NOT SuiteSparse_FOUND) - # Create configuration header which describes available features # necessary to compile this library. Singular version is the names that # is required by this project alone, plural version transitively diff --git a/examples/sim_simple.cpp b/examples/sim_simple.cpp index b353ba216..2bbd30c25 100644 --- a/examples/sim_simple.cpp +++ b/examples/sim_simple.cpp @@ -27,7 +27,12 @@ #include #include #include + +#if HAVE_SUITESPARSE_UMFPACK_H +#include +#else #include +#endif #include #include @@ -202,7 +207,13 @@ int main() // Where R(p0) and J(p0) are contained in residual.value() and // residual.derived()[0]. - Eigen::BiCGSTAB solver; +#if HAVE_SUITESPARSE_UMFPACK_H + typedef Eigen::UmfPackLU LinSolver; +#else + typedef Eigen::BiCGSTAB LinSolver; +#endif // HAVE_SUITESPARSE_UMFPACK_H + + LinSolver solver; M pmatr = residual.derivative()[0]; pmatr.coeffRef(0,0) *= 2.0; pmatr.makeCompressed();