Skip to content

Make partmesh independent of ProcessLib

Christoph Lehmann requested to merge chleh/ogs:split-process-lib into master

This MR makes partmesh independent of ProcessLib.

Why?

Currently, the OGS Python wheels are built without Python BC and ST support, which is quite ironic. This MR is a small step towards enabling Python BCs and STs in the wheel builds (IMO).

What's the problem? If OGS_USE_PYTHON is enabled, ProcessLib depends on Python. Hence, in this case any executable linking ProcessLib will have to provide all necessary Python library symbols (that's the picture that I have of it), i.e., to link against Python. That's not possible/recommended with the manylinux Python wheel builds AFAIK.

So with OGS_USE_PYTHON & wheel build we'll have the situation that we cannot build partmesh, because it depends on ProcessLib, hence on Python. The aim of this MR is to solve that issue.

Solution

This MR takes the laziest solution by moving IntegrationPointWriter from ProcessLib to MeshLib. That's technically possible, but I don't know if MeshLib is the right place.

Other solutions

A better solution would probably be to disentangle ProcessLib. Currently the ProcessLib/ directory contains a number libraries:

  • ProcessLib (BCs, STs, Output, Utils, ...)
  • Processes (all processes, consists of sub-libraries)
  • ProcessLibBoundaryConditionAndSourceTermPython
  • ProcessLibBoundaryConditionAndSourceTermPythonModule

The ProcessLib library depends on Python via ProcessLibBoundaryConditionAndSourceTermPython. It would be nice to split the ProcessLib library in a part that depends on Python and in a part that does not, but that seems pretty hard due to

  • dependency cycle: Process -> ProcessVariable -> BoundaryCondition (pulls in Python dependency) -> Process (for process dependent BCs)
  • some files in ProcessLib/Output include Process.h and ProcessVariable.h (and thereby the dependency cycle)
  • ProcessLib/Utils/ProcessUtils.cpp includes ProcessVariable.h (and thereby the dependency cycle)
Edited by Christoph Lehmann

Merge request reports