failing python tests with shared libs if python bindings are on.
For both Python 3.11 (Debian stable) and 3.12 (Ubuntu noble) I am now getting failing python tests because of an assertion. E.g. for python_basic:
343: python3: /home/mblatt/src/dune/opm-2.9/opm-models/opm/models/blackoil/blackoilprimaryvariables.hh:437: void Opm::BlackOilPrimaryVariables<TypeTag>::assignNaive(const FluidState&) [with FluidState = Opm::BlackOilFluidState<double, Opm::BlackOilFluidSystem<double, Opm::BlackOilDefaultIndexTraits>, true, false, true, false, false, false, false, 3>; TypeTag = Opm::Properties::TTag::FlowProblemTPFA]: Assertion `FluidSystem::phaseIsActive(waterPhaseIdx)' failed.
343: [frau-mahlzahn:74975] *** Process received signal ***
343: [frau-mahlzahn:74975] Signal: Aborted (6)
343: [frau-mahlzahn:74975] Signal code: (-6)
343: [frau-mahlzahn:74975] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7f22cde6c050]
build options:
set(BUILD_SHARED_LIBS ON CACHE BOOL "Use shared libs")
set(CMAKE_CXX_FLAGS "-DDEBUG -g -Og -Wall -Wextra -DDEBUG " CACHE STRING "CXX opts")
set(CMAKE_C_FLAGS "-DDEBUG -g -Og -Wall -Wextra -DDEBUG " CACHE STRING "CXX opts")
set(CMAKE_DISABLE_FIND_PACKAGE_dune-uggrid ON CACHE STRING "disable ug")
set(CMAKE_BUILD_TYPE "None" CACHE STRING "Build type")
set(USE_MPI ON CACHE STRING "Use mpi")
set(BUILD_TESTING ON CACHE BOOL "Build tests")
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY 1 CACHE BOOL "" FORCE)
set(BUILD_ECL_SUMMARY ON CACHE BOOL "Build summary.x")
set(BUILD_APPLICATIONS OFF CACHE BOOL "Build applications")
set(CMAKE_INSTALL_PREFIX "/home/mblatt/opt/opm/" CACHE PATH "installation directory")
set(CMAKE_DISABLE_FIND_PACKAGE_CUDA ON CACHE PATH "no cuda")
set(CMAKE_DISABLE_FIND_PACKAGE_dune-fem ON CACHE PATH "no dune-fem")
set(BUILD_FLOW_VARIANTS ON CACHE BOOL "cpr variants")
set(CMAKE_DISABLE_FIND_PACKAGE_dune-uggrid ON CACHE BOOL "disable UG")
set(CMAKE_DISABLE_FIND_PACKAGE_UG ON CACHE BOOL "disable UG")
set(OPM_ENABLE_PYTHON ON CACHE BOOL "Python")
set(OPM_ENABLE_EMBEDDED_PYTHON ON CACHE BOOL "Embedded Python")
set(OPM_INSTALL_PYTHON ON CACHE BOOL "Install Python")
If I set BUILD_SHARED_LIBS to OFF the problem is not there. This is why jenkins does not notice it. For whatever reason I also have deactivated the python tests for opm-simulators on Debian/Ubuntu, which is why I did not notice this earlier.
Somehow this smells like a static variable issue to me.
Here are the logs from the python tests: failing_python_tests.log
I see the same failures if OPM_ENABLE_EMBEDDED_PYTHON is off. So this is really an issue with the python bindings here.