OGS
ApplicationsLib Namespace Reference

Detailed Description

Classes

struct  LinearSolverLibrarySetup
 
class  TestDefinition
 

Functions

pybind11::scoped_interpreter setupEmbeddedPython ()
 

Function Documentation

◆ setupEmbeddedPython()

OGS_EXPORT_SYMBOL pybind11::scoped_interpreter ApplicationsLib::setupEmbeddedPython ( )

Sets up an embedded Python interpreter and makes sure that the OpenGeoSys Python module is not removed by the linker.

Definition at line 43 of file ogs_embedded_python.cpp.

44 {
45 #ifndef OGS_BUILD_SHARED_LIBS
46  // pybind11_init_impl_OpenGeoSys is the function initializing the embedded
47  // OpenGeoSys Python module. The name is generated by pybind11. If it is not
48  // obvious that this symbol is actually used, the linker might remove it
49  // under certain circumstances.
50  mark_used(&pybind11_init_impl_OpenGeoSys);
51 #endif
52 
53  // Allows ogs to be interrupted by SIGINT, which otherwise is handled by
54  // python. See
55  // https://docs.python.org/3/c-api/exceptions.html#c.PyErr_CheckSignals and
56  // https://pybind11.readthedocs.io/en/stable/faq.html#how-can-i-properly-handle-ctrl-c-in-long-running-functions
57  constexpr bool init_signal_handlers = false;
58  return pybind11::scoped_interpreter{init_signal_handlers};
59 }
void mark_used(T p)

References mark_used().

Referenced by main().