Bug when build ROOT with python3.7


_ROOT Version: 6.15
_Platform: macos
_Compiler: mac default


bug.md buffers
/Users/chenxu/software/ROOT/git/bindings/pyroot/src/PyRootType.cxx:103:22: error:
¦ ¦ cannot initialize a variable of type ‘char *’ with an rvalue of type
¦ ¦ 'const char
¦ ¦ ¦ ¦ ¦ ¦ ¦char
cppname = PyROOT_PyUnicode_AsString(pycppname);
¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [bindings/pyroot/CMakeFiles/PyROOT.dir/src/PyRootType.cxx.o] Error 1

/Users/chenxu/software/ROOT/git/bindings/pyroot/src/TPyROOTApplication.cxx:101:16: error:
¦ ¦ cannot initialize a variable of type ‘char *’ with an rvalue of type
¦ ¦ 'const char
¦ ¦ ¦ ¦char
argi = PyROOT_PyUnicode_AsString( PyList_GET_ITEM( argl, i ) );
¦ ¦ ¦ ¦ ¦ ¦ ¦^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/chenxu/software/ROOT/git/bindings/pyroot/src/TPyROOTApplication.cxx:107:22: error:
¦ ¦ assigning to ‘char *’ from incompatible type ‘const char *’
¦ ¦ ¦ ¦argv[ i ] = argi;
¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦^~~~
1 error generated.

there may be some other bugs ,I’m still debugging

That particularly piece of code is so wrong on so many levels. In fact, it was the impetus for me to fork PyROOT, b/c that’s what cancerous bitrot looks like. :confused:

The whole cppname business was completely rewritten in cppyy master and this particular function is not needed in the first place, but to have a localized fix, at least it should not only add the ‘const’, but also push the Py_DECREF two statements down. Either way, the scope id is a data member of the type instance, so GetScope() is completely superfluous.

You should probably also replace ‘_PyObject_GC_TRACK’ by ‘PyObject_GC_Track’ (in Pythonize.cxx). The former is a macro version of the latter, but accesses a variable that is no longer exported in 3.7, leading to a missing symbol (_PyGC_generation0). This was the only issue I found in cppyy master to support 3.7 (fixes are in repo; to be released soon enough).

There used to be a performance improvement, but I see no adverse effect today by replacing the macro with the function call.

1 Like

Hi,

The bug is being tracked here:

https://sft.its.cern.ch/jira/browse/ROOT-9521

Enric

cppyy master with support for p3.7 has been released on PyPI.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.