Building ROOT 6.24 (the v6-24-00-patches branch)

Hello again,

I tried with both option, only -Dxrootd=OFF and both -Dall=ON -Dxrootd=OFF, and the compilation always fails here:

[ 80%] Building CXX object bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/src/CPPConstructor.cxx.o
/Users/diiego/software/ROOT/ROOT_6.24/v6-24-00-patches/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx:125:31: error: expression is not assignable
                Py_TYPE(self) = (PyTypeObject*)pyclass;
                ~~~~~~~~~~~~~ ^
1 error generated.
gmake[2]: *** [bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/build.make:132: bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/src/CPPConstructor.cxx.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:32585: bindings/pyroot/cppyy/CPyCppyy/CMakeFiles/cppyy3_11.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

Any clue about what may be happening? I guess it has to be with PyROOT, but do not know what.

Thanks again

I’m afraid you face “cppyy3_11” problems, e.g., something like:

@bellenot @etejedor Could someone backport the required fixes to “v6-24-00-patches” (the last version which supports “-std=c++11”)?

So… Does this have a solution? I’m a bit lost at this point to be honest.

Wait until the relevant changes are committed in the v6-24-00-patches branch

@bellenot Was this the only fix needed for “cppyy3_11”? Here (see above) it actually complained about “expression is not assignable”, not about a missing “code.h”.

@Wile_E_Coyote Oh, ok, sorry. Then I’ll have to investigate next week. And FYI, I’m not a PyROOT expert (not even a user)

So, we may need some python experts … @Axel @vpadulan

Working on it

Thanks!

So hopefully the PR #12514 should fix it. I’ll let you know once it’s merged
EDIT: I’m looking for all required changes for Python 3.11, and it will take more efforts and time than expected… Stay tuned!

Ok, thanks a lot again!

OK, the PR failed. So we will need a Python expert here, once one is available…

@Diego_Costas_Rodrigu So … in the meantime … maybe you could try to build it with the old Python 2.7 only:
-DCMAKE_CXX_STANDARD=11 -Dall=ON -Dxrootd=OFF -DPYTHON_EXECUTABLE=/usr/local/bin/python2.7
This would test if the rest of ROOT builds fine.
Also, maybe (for the moment) you can live with Python 2.7 (if your software is compatible with the old ROOT 5.34, it should also be compatible with the old Python 2.7).
Once the problems with Python 3.11 are solved, you could try to use the new version.

And BTW, are you forced to use Python 3.11? Can’t you simply install let’s say 3.10 (or 3.9, or 3.8)?

Hey, thanks guys.

First I tried forcing the build to use Python 2.7, but it crashes anyway:

[ 98%] Linking CXX shared library ../../lib/libPyMVA.so
ld: warning: ignoring file /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_PyCObject_AsVoidPtr", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyCObject_Type", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyDict_GetItemString", referenced from:
      TMVA::MethodPyAdaBoost::Train() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Train() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::SetupKerasModel(bool) in MethodPyKeras.cxx.o
      TMVA::MethodPyKeras::GetKerasBackend() in MethodPyKeras.cxx.o
      TMVA::MethodPyKeras::Train() in MethodPyKeras.cxx.o
      TMVA::MethodPyKeras::GetMvaValues(long long, long long, bool) in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Train() in MethodPyRandomForest.cxx.o
      ...
  "_PyDict_New", referenced from:
      TMVA::PyMethodBase::PyMethodBase(TString const&, TMVA::Types::EMVA, TString const&, TMVA::DataSetInfo&, TString const&) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::PyMethodBase(TMVA::Types::EMVA, TMVA::DataSetInfo&, TString const&) in PyMethodBase.cxx.o
  "_PyDict_SetItemString", referenced from:
      TMVA::MethodPyAdaBoost::ProcessOptions() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyAdaBoost::Train() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyAdaBoost::ReadModelFromFile() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::ProcessOptions() in MethodPyGTB.cxx.o
      TMVA::MethodPyGTB::Train() in MethodPyGTB.cxx.o
      TMVA::MethodPyGTB::ReadModelFromFile() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::SetupKerasModel(bool) in MethodPyKeras.cxx.o
      ...
  "_PyErr_Format", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyErr_Print", referenced from:
      TMVA::PyMethodBase::PyRunString(TString, TString, int) in PyMethodBase.cxx.o
  "_PyErr_SetString", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyExc_AttributeError", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyExc_RuntimeError", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyGILState_Ensure", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyGILState_Release", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyImport_AddModule", referenced from:
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyImport_Import", referenced from:
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyImport_ImportModule", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyLong_AsLong", referenced from:
      TMVA::MethodPyKeras::SetupKerasModel(bool) in MethodPyKeras.cxx.o
      TMVA::MethodPyKeras::Train() in MethodPyKeras.cxx.o
      TMVA::MethodPyTorch::ProcessOptions() in MethodPyTorch.cxx.o
  "_PyLong_FromLong", referenced from:
      TMVA::MethodPyKeras::Train() in MethodPyKeras.cxx.o
      TMVA::MethodPyTorch::Train() in MethodPyTorch.cxx.o
  "_PyModule_GetDict", referenced from:
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_PyObject_CallFunctionObjArgs", referenced from:
      TMVA::MethodPyTorch::GetMvaValues(long long, long long, bool) in MethodPyTorch.cxx.o
  "_PyObject_CallMethod", referenced from:
      TMVA::MethodPyAdaBoost::GetMvaValues(long long, long long, bool) in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyAdaBoost::GetMvaValue(double*, double*) in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyAdaBoost::GetMulticlassValues() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::GetMvaValues(long long, long long, bool) in MethodPyGTB.cxx.o
      TMVA::MethodPyGTB::GetMvaValue(double*, double*) in MethodPyGTB.cxx.o
      TMVA::MethodPyGTB::GetMulticlassValues() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::GetMvaValues(long long, long long, bool) in MethodPyKeras.cxx.o
      ...
  "_PyObject_CallObject", referenced from:
      TMVA::PyMethodBase::Eval(TString) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::Serialize(TString, _object*) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::UnSerialize(TString, _object**) in PyMethodBase.cxx.o
  "_PyObject_GetAttrString", referenced from:
      TMVA::MethodPyAdaBoost::Init() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyAdaBoost::CreateRanking() in MethodPyAdaBoost.cxx.o
      TMVA::MethodPyGTB::Init() in MethodPyGTB.cxx.o
      TMVA::MethodPyGTB::CreateRanking() in MethodPyGTB.cxx.o
      TMVA::MethodPyKeras::Init() in MethodPyKeras.cxx.o
      TMVA::MethodPyRandomForest::Init() in MethodPyRandomForest.cxx.o
      TMVA::MethodPyRandomForest::CreateRanking() in MethodPyRandomForest.cxx.o
      ...
  "_PyRun_SimpleFileExFlags", referenced from:
      TMVA::MethodPyTorch::SetupPyTorchModel(bool) in MethodPyTorch.cxx.o
  "_PyRun_StringFlags", referenced from:
      TMVA::MethodPyKeras::SetupKerasModel(bool) in MethodPyKeras.cxx.o
      TMVA::MethodPyTorch::ProcessOptions() in MethodPyTorch.cxx.o
      TMVA::MethodPyTorch::Init() in MethodPyTorch.cxx.o
      TMVA::PyMethodBase::PyRunString(TString, TString, int) in PyMethodBase.cxx.o
  "_PyString_AsString", referenced from:
      TMVA::MethodPyKeras::Train() in MethodPyKeras.cxx.o
  "_PyUnicodeUCS2_FromString", referenced from:
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_Py_BuildValue", referenced from:
      TMVA::PyMethodBase::Eval(TString) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::Serialize(TString, _object*) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::UnSerialize(TString, _object**) in PyMethodBase.cxx.o
  "_Py_Finalize", referenced from:
      TMVA::PyMethodBase::PyFinalize() in PyMethodBase.cxx.o
  "_Py_GetProgramName", referenced from:
      TMVA::PyMethodBase::Py_GetProgramName() in PyMethodBase.cxx.o
  "_Py_Initialize", referenced from:
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
  "_Py_IsInitialized", referenced from:
      TMVA::PyMethodBase::PyMethodBase(TString const&, TMVA::Types::EMVA, TString const&, TMVA::DataSetInfo&, TString const&) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::PyIsInitialized() in PyMethodBase.cxx.o
      TMVA::PyMethodBase::PyInitialize() in PyMethodBase.cxx.o
      TMVA::PyMethodBase::PyMethodBase(TMVA::Types::EMVA, TMVA::DataSetInfo&, TString const&) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::Eval(TString) in PyMethodBase.cxx.o
      TMVA::PyMethodBase::Serialize(TString, _object*) in PyMethodBase.cxx.o
  "_Py_SetProgramName", referenced from:
      TMVA::PyMethodBase::PySetProgramName(TString) in PyMethodBase.cxx.o
  "__Py_TrueStruct", referenced from:
      TMVA::MethodPyKeras::GetKerasBackend() in MethodPyKeras.cxx.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [tmva/pymva/CMakeFiles/PyMVA.dir/build.make:200: lib/libPyMVA.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:33060: tmva/pymva/CMakeFiles/PyMVA.dir/all] Error 2

I’ll try with a Python 3.10 env as @bellenot said and let you know.

Thanks for all the help provided :slight_smile:

It looks like two versions got “mixed”. One is “/usr/local/bin/python2.7” and another one is “/Library/Frameworks/Python.framework/Versions/2.7”.
Moreover, it looks like you have incompatible libraries installed: “... building for macOS-arm64 but attempting to link with file built for macOS-x86_64

Yes… I do not know what could be those libraries that produce incompatibilities :confused:

Anyway, I made a new installation of python3.9 using brew and I managed to successfully install ROOT 6.24 with c++11, so it’s done! :slight_smile:

1 Like

Cool, good news! Thanks for letting us know and sorry for the delay…

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