[6.32/master] Fail to materialise simbols from `libMatrix`
Check duplicate issues.
- [ ] Checked for duplicates
Description
Any code run through TInterpreter::Declare that needs symbols from libMatrix ends up in
cling JIT session error: Failed to materialize symbols: { (main, { _ZN8TVectorTIfE8StreamerER7TBuffer, _ZN8TVectorTIfE8Delete_mEiRPf, _ZN8TVectorTIfE4DrawEPKc, _ZNK8TVectorTIfE5PrintEPKc, _ZN8TVectorTIfE5ClassEv }) }
See the simple reproducer below. Here is what I get with two different ROOT versions on lxplus:
ROOT 6.32.02 (LCG106)
[vpadulan@lxplus951 ~]$source /cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/setup.sh
[vpadulan@lxplus951 ~]$root --version
ROOT Version: 6.32.02
Built for linuxx8664gcc on Jun 19 2024, 05:05:49
From heads/master@tags/v6-32-02
[vpadulan@lxplus951 ~]$python repro_libphysics.py
cling JIT session error: Failed to materialize symbols: { (main, { _ZN8TVectorTIfE8StreamerER7TBuffer, _ZN8TVectorTIfE8Delete_mEiRPf, _ZN8TVectorTIfE4DrawEPKc, _ZNK8TVectorTIfE5PrintEPKc, _ZN8TVectorTIfE5ClassEv }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { _ZL5myvec, _ZN8TStorage19FilledByObjectAllocEPVKj, _ZNSt13__atomic_baseIhEppEi, _ZN4ROOT8Internal22THashConsistencyHolderIRK8TVectorTIfEE17fgHashConsistencyE, __cxx_global_var_initcling_module_306_, _ZN8TVectorTIfED2Ev, _ZN8TStorage14UpdateIsOnHeapERVKjRVj, _ZGVL5myvec, _ZN8TVectorTIfEC1Ev, _ZTI8TVectorTIfE, _ZTV8TVectorTIfE, __clang_call_terminate, _ZNK8TVectorTIfE11ShowMembersER16TMemberInspector, $.cling-module-306.__inits.0, _ZNK7TObject10IsSortableEv, _ZN8TVectorTIfEC2Ev, _ZNSt13__atomic_baseIhEppEv, _ZNK8TVectorTIfE3IsAEv, __orc_init_func.cling-module-306, _ZN8TVectorTIfED0Ev, _ZZNK8TVectorTIfE27CheckTObjectHashConsistencyEvE14recurseBlocker, _ZN7TObjectC2Ev, _ZN8TVectorTIfED1Ev, _ZStanSt12memory_orderSt23__memory_order_modifier, _ZNK8TVectorTIfE27CheckTObjectHashConsistencyEv, _ZNKSt13__atomic_baseIhEcvhEv, _ZTS8TVectorTIfE, _ZN8TVectorTIfE5ClearEPKc, _ZNK7TObject9GetOptionEv }) }
cling JIT session error: Failed to materialize symbols: { (main, { _ZGVL5myvec }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __cxx_global_var_initcling_module_307_, __orc_init_func.cling-module-307, _ZN12__cling_N51516__cling_Un1Qu314EPv, $.cling-module-307.__inits.0 }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __orc_init_func.cling-module-306 }) }
Traceback (most recent call last):
File "/afs/cern.ch/user/v/vpadulan/repro_libphysics.py", line 12, in <module>
raise SystemExit(main())
^^^^^^
File "/afs/cern.ch/user/v/vpadulan/repro_libphysics.py", line 9, in main
print(ROOT.myvec)
^^^^^^^^^^
File "/cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/lib/ROOT/_facade.py", line 164, in _fallback_getattr
raise AttributeError("Failed to get attribute {} from ROOT".format(name))
AttributeError: Failed to get attribute myvec from ROOT
ROOT 6.30.02 (LCG105)
[vpadulan@lxplus959 ~]$source /cvmfs/sft.cern.ch/lcg/views/LCG_105/x86_64-el9-gcc13-opt/setup.sh
[vpadulan@lxplus959 ~]$root --version
ROOT Version: 6.30/02
Built for linuxx8664gcc on Dec 20 2023, 18:59:44
From heads/master@tags/v6-30-02
[vpadulan@lxplus959 ~]$python repro_libphysics.py
Name: TVectorT<float> Title:
Reproducer
import ROOT
def main():
ROOT.gInterpreter.Declare('''
#include <TVectorT.h>
//R__LOAD_LIBRARY(libMatrix); // Uncomment to make the error disappear
const auto myvec = TVectorT<float>();
''')
print(ROOT.myvec)
if __name__ == "__main__":
raise SystemExit(main())
ROOT version
6.32.*
Installation method
Any
Operating system
Any
Additional context
No response
Following the issue
Small update to give further context, the following seemingly similar but subtly different snippet works also for ROOT 6.32
import ROOT
def main():
ROOT.gInterpreter.ProcessLine("const auto myvec = TVectorT<float>();")
print(ROOT.myvec)
if __name__ == "__main__":
raise SystemExit(main())
And it is clear that in this case ProcessLine tries much harder than Declare to automatically load libraries that might be necessary to evaluate the line.
Also, the reproducer from the issue description fails with the same error in ROOT latest master.
Here another incarnation https://root-forum.cern.ch/t/cling-fails-when-std-pow-and-root-integratormultidim-are-present/62508/2