Skip to content

Fix Cling warnings when using GaudiPython::Helper struct

Alex Pearce requested to merge apearce/Gaudi:apearce-python-helpers into master

Loading the GaudiPython helper struct in the Python 3 build prints warnings to stderr

$ ./Gaudi/run python -c 'import cppyy; cppyy.gbl.GaudiPython.Helper' > /dev/null
IncrementalExecutor::executeFunction: symbol '_ZL28PyBuffer_FromReadWriteMemoryPvi' unresolved while linking function '_GLOBAL__sub_I_cling_module_358'!
You are probably missing the definition of PyBuffer_FromReadWriteMemory(void*, int)
Maybe you need to load the corresponding shared library?

This MR adds a test that just loads the helper; some non-empty stderr causes a failure. I guess no test was loading the struct before so the problem went unnoticed; I found it whilst working on the LHCb Python 3 migration.

It also adds a fix, which is to simply move the PyBuffer_FromReadWriteMemory static function in to the GaudiPython::Helper struct. I don't know if this is good or bad but it stops the warning.

If someone could add the lhcb-gaudi-head-py3 label that would be super 🌟

Edited by Alex Pearce

Merge request reports

Loading