Open eguiraud opened 4 years ago
Another reproducer:
~ root -l
root [0] Long32_t ba;
ROOT_prompt_0:1:9: error: expected ';' after expression
Long32_t ba;
^
;
ROOT_prompt_0:1:10: error: use of undeclared identifier 'ba'
Long32_t ba;
^
root [1] Long64_t ba;
root.exe: ../../../../../../../../root_dbg/interpreter/llvm/src/tools/clang/lib/Sema/SemaDecl.cpp:12576: clang::Decl* clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool): Assertion `!Cleanup.exprNeedsCleanups() && "Unaccounted cleanups in function"' failed.
Thanks @eguiraud, I will take a look at this thing soon. Actually, I think these are two different problems, but we'll see...
Another reproducer:
~ root -l root [0] Long32_t ba; ROOT_prompt_0:1:9: error: expected ';' after expression Long32_t ba; ^ ; ROOT_prompt_0:1:10: error: use of undeclared identifier 'ba' Long32_t ba; ^ root [1] Long64_t ba; root.exe: ../../../../../../../../root_dbg/interpreter/llvm/src/tools/clang/lib/Sema/SemaDecl.cpp:12576: clang::
As suspected, these were two different issues. The quoted issue was fixed in https://github.com/root-project/root/pull/9160. The original reported issue is to be investigated.
This is still a problem in 6.26.04:
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
root.exe: /home/conda/feedstock_root/build_artifacts/root_base_1654795774398/work/root-source/interpreter/cling/lib/Interpreter/DynamicLibraryManagerSymbol.cpp:1187: std::string cling::Dyld::searchLibrariesForSymbol(llvm::StringRef, bool): Assertion `!llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(mangledName) && "Library already loaded, please use dlsym!"' failed.
Thanks for the ping, @eguiraud! :-)
I had some work on a branch that fixes this and other related issues (grouped in #10049), but I still need to find the time to polish that code.
This is still present in v6.28.04 (LLVM 13) but the error is much more verbose:
/tmp root -l
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
IncrementalExecutor::executeFunction: symbol '_ZSt4swapIP4TH1DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::enable_if<__and_<std::__not_<std::__is_tuple_like<TH1D*> >, std::is_move_constructible<TH1D*>, std::is_move_assignable<TH1D*> >::value, void>::type std::swap<TH1D*>(TH1D*&, TH1D*&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt11make_sharedIN4ROOT8Internal3RDF13RJittedActionEJRNS0_6Detail3RDF12RLoopManagerERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISE_EERNS2_15RColumnRegisterESI_EESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueESN_E4typeEEDpOT0_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::shared_ptr<std::enable_if<!is_array<ROOT::Internal::RDF::RJittedAction>::value, ROOT::Internal::RDF::RJittedAction>::type> std::make_shared<ROOT::Internal::RDF::RJittedAction, ROOT::Detail::RDF::RLoopManager&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ROOT::Internal::RDF::RColumnRegister&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&>(ROOT::Detail::RDF::RLoopManager&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ROOT::Internal::RDF::RColumnRegister&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4moveIRSt10shared_ptrIN4ROOT6Detail3RDF13RJittedDefineEEEONSt16remove_referenceIT_E4typeEOS8_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::remove_reference<std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&>::type&& std::move<std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&>(std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4moveIRN4ROOT8Internal3RDF15RColumnRegisterEEONSt16remove_referenceIT_E4typeEOS6_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::remove_reference<ROOT::Internal::RDF::RColumnRegister&>::type&& std::move<ROOT::Internal::RDF::RColumnRegister&>(ROOT::Internal::RDF::RColumnRegister&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4moveIRKSt10shared_ptrIN4ROOT8Internal3RDF13RJittedActionEEEONSt16remove_referenceIT_E4typeEOS9_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::remove_reference<std::shared_ptr<ROOT::Internal::RDF::RJittedAction> const&>::type&& std::move<std::shared_ptr<ROOT::Internal::RDF::RJittedAction> const&>(std::shared_ptr<ROOT::Internal::RDF::RJittedAction> const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN4ROOT8Internal3RDF14MakeWeakOnHeapINS1_13RJittedActionEEEPSt8weak_ptrIT_ERKSt10shared_ptrIS5_E' unresolved while linking [cling interface function]!
You are probably missing the definition of std::weak_ptr<ROOT::Internal::RDF::RJittedAction>* ROOT::Internal::RDF::MakeWeakOnHeap<ROOT::Internal::RDF::RJittedAction>(std::shared_ptr<ROOT::Internal::RDF::RJittedAction> const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN4ROOT8Internal3RDF16MakeSharedOnHeapI4TH1DEEPSt10shared_ptrIT_ERKS6_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::shared_ptr<TH1D>* ROOT::Internal::RDF::MakeSharedOnHeap<TH1D>(std::shared_ptr<TH1D> const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN4ROOT6Detail3RDF13MakeResultPtrI4TH1DEENS_3RDF10RResultPtrIT_EERKSt10shared_ptrIS6_ERNS1_12RLoopManagerES8_INS_8Internal3RDF11RActionBaseEE' unresolved while linking [cling interface function]!
You are probably missing the definition of ROOT::RDF::RResultPtr<TH1D> ROOT::Detail::RDF::MakeResultPtr<TH1D>(std::shared_ptr<TH1D> const&, ROOT::Detail::RDF::RLoopManager&, std::shared_ptr<ROOT::Internal::RDF::RActionBase>)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSteqI4TH1DEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator==<TH1D>(std::shared_ptr<TH1D> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN4ROOT8Internal3RDF16MakeSharedOnHeapINS_6Detail3RDF9RNodeBaseEEEPSt10shared_ptrIT_ERKS8_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::shared_ptr<ROOT::Detail::RDF::RNodeBase>* ROOT::Internal::RDF::MakeSharedOnHeap<ROOT::Detail::RDF::RNodeBase>(std::shared_ptr<ROOT::Detail::RDF::RNodeBase> const&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZStneIN4ROOT8Internal3RDF11RActionBaseEEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator!=<ROOT::Internal::RDF::RActionBase>(std::shared_ptr<ROOT::Internal::RDF::RActionBase> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
root [2]
Still present in current master:
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
IncrementalExecutor::executeFunction: symbol '_ZSt4moveIRN4ROOT8Internal3RDF15RColumnRegisterEEONSt16remove_referenceIT_E4typeEOS6_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::remove_reference<ROOT::Internal::RDF::RColumnRegister&>::type&& std::move<ROOT::Internal::RDF::RColumnRegister&>(ROOT::Internal::RDF::RColumnRegister&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4moveIRSt10shared_ptrIN4ROOT6Detail3RDF13RJittedDefineEEEONSt16remove_referenceIT_E4typeEOS8_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::remove_reference<std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&>::type&& std::move<std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&>(std::shared_ptr<ROOT::Detail::RDF::RJittedDefine>&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt8_DestroyIPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_EvT_S7_RSaIT0_E' unresolved while linking [cling interface function]!
You are probably missing the definition of void std::_Destroy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZStneIN4ROOT8Internal3RDF11RActionBaseEEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator!=<ROOT::Internal::RDF::RActionBase>(std::shared_ptr<ROOT::Internal::RDF::RActionBase> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4swapIP4TH1DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::enable_if<__and_<std::__not_<std::__is_tuple_like<TH1D*> >, std::is_move_constructible<TH1D*>, std::is_move_assignable<TH1D*> >::value, void>::type std::swap<TH1D*>(TH1D*&, TH1D*&)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSteqI4TH1DEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator==<TH1D>(std::shared_ptr<TH1D> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
I think the fixed state should behave like this:
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
root [2]
The first (wrong) line produces a helpful compiler error, the second (valid) line produces a plot.
The issue is still there with master and LLVM 16. I add in the loop @devajithvs , who might be able to authoritatively comment about the issue.
To add my memory here: I think this was originally fixed by Javier, but I ended up re-introducing it when I made the remaining tests pass to merge https://github.com/root-project/root/pull/13565 :disappointed:
@devajithvs do you think this is something easy to fix?
I was looking into this and this seems similar to the issue: https://github.com/root-project/root/issues/10049
It's strange that this works:
root [0] std::unique_ptr<TFile> foo{TFile::Open("foo.root", "RECREATE")};
root [1] foo.GetName()
ROOT_prompt_1:1:4: error: no member named 'GetName' in 'std::unique_ptr<TFile, std::default_delete<TFile> >'; did you mean to use '->' instead of '.'?
foo.GetName()
^
->
root [2] foo->GetName()
(const char *) "foo.root"
while the example here doesn't:
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
IncrementalExecutor::executeFunction: symbol '_ZSteqI4TH1DEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator==<TH1D>(std::shared_ptr<TH1D> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZStneIN4ROOT8Internal3RDF11RActionBaseEEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator!=<ROOT::Internal::RDF::RActionBase>(std::shared_ptr<ROOT::Internal::RDF::RActionBase> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSt4swapIP4TH1DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_' unresolved while linking [cling interface function]!
You are probably missing the definition of std::enable_if<__and_<std::__not_<std::__is_tuple_like<TH1D*> >, std::is_move_constructible<TH1D*>, std::is_move_assignable<TH1D*> >::value, void>::type std::swap<TH1D*>(TH1D*&, TH1D*&)
Maybe you need to load the corresponding shared library?
root [2]
Works after the LLVM upgrade!
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1]
Thanks, @devajithvs.
No, it doesn't work:
root [0] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
ROOT_prompt_0:1:52: error: no member named 'DrawClone' in 'ROOT::RDF::RResultPtr<TH1D>'; did you mean to use '->' instead of '.'?
ROOT::RDataFrame(10).Define("x", "42").Histo1D("x").DrawClone()
^
->
root [1] ROOT::RDataFrame(10).Define("x", "42").Histo1D("x")->DrawClone()
IncrementalExecutor::executeFunction: symbol '_ZSt4swapIP4TH1DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_' unresolved while linking [cling interface function]!
IncrementalExecutor::executeFunction: symbol '_ZStneIN4ROOT8Internal3RDF11RActionBaseEEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator!=<ROOT::Internal::RDF::RActionBase>(std::shared_ptr<ROOT::Internal::RDF::RActionBase> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZSteqI4TH1DEbRKSt10shared_ptrIT_EDn' unresolved while linking [cling interface function]!
You are probably missing the definition of bool std::operator==<TH1D>(std::shared_ptr<TH1D> const&, decltype(nullptr))
Maybe you need to load the corresponding shared library?
Please, please, read through the full thread. As remarked, the important invocation is the second one that is correct and should work without errors!
Oh, thanks for that! The multi-line outputs are hard to read sometimes, and I missed the line second invocation. Alright, so I confirm it still doesn't work, just like #10049.
To Reproduce
The first line executed is invalid C++ code, and cling rightly complains. The second line is valid code, but cling does not seem to be able to compile it after the previous compilation failure. Opening a new ROOT prompt and directly inserting the valid code works fine.
Setup
ROOT master@3ae45ea5f9, RelWithDebInfo. I could not reproduce with master@dcac6e1bf0, Debug build type. The 6.22.02 conda package also seems to be affected.