Hello everyone. I’m using roofit in pyroot. I had a code which was working some time ago but when I changed my operating system and root version, it’s not working anymore. It’s working on my laptop where I’m using Ubuntu. I know where the problem is coming from but don’t know how to solve it.
x = RooRealVar("x","m_{tt} [GeV]",700,6000);
fa1 = TF1("fa1","-x",700,6000);
rfa1 = RooFit.bindFunction(fa1,x);
Other things from RooFit work properly but it cannot bind a TF1 to a RooAbsReal
This is the error:
IncrementalExecutor::executeFunction: symbol '_ZN6RooFit12bindFunctionEP3TF1R10RooAbsReal' unresolved while linking symbol '__cf_21'!
You are probably missing the definition of RooFit::bindFunction(TF1*, RooAbsReal&)
Maybe you need to load the corresponding shared library?
Error in <TClingCallFunc::make_wrapper>: Failed to compile
Hi Lorenzo.
This is working on my other system as well but I don’t know what I’m missing in the build that it’s not working right now. How should I install those libraries?
This is how I build my ROOT:
cmake … -Dall=ON
I even tried ROOT version 5.99.06 and I get the similiar error:
IncrementalExecutor: use of undefined symbol '_ZN6RooFit12bindFunctionEP3TF1R10RooAbsReal'!
IncrementalExecutor: calling unresolved symbol, see previous error message!
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007fa10bd30a3c in waitpid () from /lib64/libc.so.6
#1 0x00007fa10bcaede2 in do_system () from /lib64/libc.so.6
#2 0x00007fa104300779 in TUnixSystem::StackTrace() () from /home/sina/Apps/root/lib/libCore.so
#3 0x00007fa104302e2c in TUnixSystem::DispatchSignals(ESignals) () from /home/sina/Apps/root/lib/libCore.so
#4 <signal handler called>
#5 0x00007fa0ff58079d in TCling::ClassInfo_GetBaseOffset(ClassInfo_t*, ClassInfo_t*, void*, bool) const () from /home/sina/Apps/root/lib/libCling.so
#6 0x00007fa104e784de in PyROOT::Utility::UpcastOffset(ClassInfo_t*, ClassInfo_t*, void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#7 0x00007fa104e696c3 in PyROOT::BindRootObject(void*, TClass*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#8 0x00007fa104e930b0 in PyROOT::TMethodHolder::CallSafe(void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#9 0x00007fa104e9106a in PyROOT::TMethodHolder::Execute(void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#10 0x00007fa104e70dda in PyROOT::(anonymous namespace)::mp_call(PyROOT::MethodProxy*, _object*, _object*) () from /home/sina/Apps/root/lib/libPyROOT.so
#11 0x00007fa10c9a9a63 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#12 0x00007fa10ca3e236 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#13 0x00007fa10ca4503d in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#14 0x00007fa10ca45142 in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0
#15 0x00007fa10ca5e57f in run_mod () from /lib64/libpython2.7.so.1.0
#16 0x00007fa10ca5f73e in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0
#17 0x00007fa10ca609c9 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0
#18 0x00007fa10ca71b7f in Py_Main () from /lib64/libpython2.7.so.1.0
#19 0x00007fa10bc8e3d5 in __libc_start_main () from /lib64/libc.so.6
#20 0x000000000040066e in _start ()
===========================================================
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5 0x00007fa0ff58079d in TCling::ClassInfo_GetBaseOffset(ClassInfo_t*, ClassInfo_t*, void*, bool) const () from /home/sina/Apps/root/lib/libCling.so
#6 0x00007fa104e784de in PyROOT::Utility::UpcastOffset(ClassInfo_t*, ClassInfo_t*, void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#7 0x00007fa104e696c3 in PyROOT::BindRootObject(void*, TClass*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#8 0x00007fa104e930b0 in PyROOT::TMethodHolder::CallSafe(void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#9 0x00007fa104e9106a in PyROOT::TMethodHolder::Execute(void*, bool) () from /home/sina/Apps/root/lib/libPyROOT.so
#10 0x00007fa104e70dda in PyROOT::(anonymous namespace)::mp_call(PyROOT::MethodProxy*, _object*, _object*) () from /home/sina/Apps/root/lib/libPyROOT.so
#11 0x00007fa10c9a9a63 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#12 0x00007fa10ca3e236 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#13 0x00007fa10ca4503d in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#14 0x00007fa10ca45142 in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0
#15 0x00007fa10ca5e57f in run_mod () from /lib64/libpython2.7.so.1.0
#16 0x00007fa10ca5f73e in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0
#17 0x00007fa10ca609c9 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0
#18 0x00007fa10ca71b7f in Py_Main () from /lib64/libpython2.7.so.1.0
#19 0x00007fa10bc8e3d5 in __libc_start_main () from /lib64/libc.so.6
#20 0x000000000040066e in _start ()
===========================================================
[sina@sinaotl ~]$ ls -l /home/sina/Apps/root-6.16.00/ROOT/lib/libCore.so
-rwxrwxr-x. 1 sina sina 31025056 Feb 4 13:33 /home/sina/Apps/root-6.16.00/ROOT/lib/libCore.so
[sina@sinaotl ~]$ ls -l /home/sina/Apps/root-6.16.00/ROOT/lib/libRooFit*.so
-rwxrwxr-x. 1 sina sina 51398392 Feb 4 13:37 /home/sina/Apps/root-6.16.00/ROOT/lib/libRooFitCore.so
-rwxrwxr-x. 1 sina sina 21534568 Feb 4 13:38 /home/sina/Apps/root-6.16.00/ROOT/lib/libRooFit.so
The issue is likely due to RooFit::bindFunction being in libRooFit, while the other symbols you use are in libRooFitCore. ROOT fails to automatically load libRooFit, because autoloading based on functions doesn’t work yet - we’re working on this, though!
If you add gSystem.Load("libRooFit") before the use of RooFit.bindFunction things should look better. Can you confirm?