Previously, touching CMakeLists.txt after a first compilation would
trigger compile errors as the two CMake runs were done with
inconsistent parameters (first one without USE_SUPERLU defined and
second one with -DUSE_SUPERLU=ON). Of course that meant that the
options would also differ from module to module, which seems like a
recipe for desaster.
This patch fixes this by moving the definition of the USE_SUPERLU
option to OpmInit.cmake which is included very early in the top most
CMakeLists.txt of each module.
ClosesOPM/opm-simulators#3908
Concerning MPI, both DUNE and OPM must be compiled with the
same default. For DUNE that is to used MPI if it is found.
With the previous default Cmake in opm-grid would fail for
DUNE 2.8
Even if SuperLU is found umfpack will be used as the coarse
solver for AMG. But if dune-fem is used that will need SuperL
if it is on the system otherwise linking will fail for DUNE 2.8
Quadmath is used by dune-fem if it is found and linking of flow
will fail in this case for DUNE 2.8 if we did not search for it.
OpmInit.cmake is one of the first includes and most importantly before
the opm-*-prereqs.cmake files are include. The macro is needed to make
the policies set in all CMakefiles. OpmSetPolicies should be called in
the toplevel CMakeLists.txt file.
This fixes a lot of warnings experienced in downstream modules that
got triggered by the opm-*-prereqs.cmake files. At some calls the
policies were at other not.
On the other hand new warnings about soon to be deprecated policies
CMP0026 and CMP0048 appear at least for cmake version 3.13.4.
But that should be fixed in another PR.
use pure config mode.
we no longer compile a test application for the libraries,
however checks have been tightened by making sure version of
all opm modules are the same.
this allows for putting prereqs directly in the module repositories
make this default to off.
additionally, check that the found superlu version
is compatible with the dune-istl version in use.
in particular superlu5 is not compatible with dune-istl 2.4