[Opm] Adjust CMake build defaults to reflect those of DUNE 2.8 more closely
Markus Blatt
markus.blatt at opm-op.com
Thu Mar 3 10:14:44 UTC 2022
Hi,
this is is about the github issue https://github.com/OPM/opm-common/issues/2897
which says
"This has cost me and some others (see https://github.com/OPM/opm-grid/issues/561 )
quite some time for newer DUNE versions (Version 2.8 or newer).
We have USE_MPI, USE_SUPERLU, USE_QUADMATH, that default to OFF. Being off will result
in OPM not searching for these packages. As a result none of the important targets are
available in OPM. The problem is that DUNE will as default always search for them and
use them. That means libraries might link to them and will use imported targets in the
package configuration files. This will result in cmake errors if the user has not manually
chosen DUNE's default.
To fix this we should at least use DUNE's defaults or just get rid off these settings. This is not a problem, because:
- USE_MPI is off for historic reasons when some in the project thought that parallel computing was not useful.
Luckily this changed. Let's change the default, too.
- SuperLU is also off for historic reasons to prefer UMFPack which gave better performance. This is not needed
anymore as DUNE will prefer UMFPack if available in AMG
- QuadMath is not used by us and we just stayed consistent and used off as default.
Note that the latter two are only an issue if someone has dune-fem on their system."
Im my opinion this change will not have any impact on flow other than that everybody will
now build the parallel flow version and will not experience any kind of build issue with
DUNE >=2.8. The rest stays the same.
To me this clearly means less maintenance and better usability.
Errors like this one are hard to judge for the average user (default USE_MPI=OFF):
"
-- This build defaults to installing in /home/mblatt/opt/opm
CMake Error at /home/mblatt/src/dune/opm-master/opm-common/cmake/Modules/OpmSatellites.cmake:63 (add_executable):
Target "test_cartgrid" links to target "MPI::MPI_C" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
/home/mblatt/src/dune/opm-master/opm-common/cmake/Modules/OpmLibMain.cmake:248 (opm_compile_satellites)
CMakeLists.txt:119 (include)
"
this already appears in opm-common. I was not aware that we would already fail here. Makes this even more pressing.
Thoughts?
Markus
--
Markus Blatt
CEO @ OPM-OP AS, Heyerdahlsvei 12b, 0777 Oslo, Norway
https://opm-op.com | +4916097590858
More information about the Opm
mailing list