Missing RooFit::bindFunction definition


_ROOT Version:6.16
_Platform:CentOS 7
_Compiler:gcc 8.2


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

==== SOURCE BEGIN ====

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-security"
__attribute__((used)) extern "C" void __cf_21(void* obj, int nargs, void** args, void* ret)
{
   if (ret) {
      new (ret) (RooAbsReal*) (((RooAbsReal* (&)(TF1*, RooAbsReal&))RooFit::bindFunction)(*(TF1**)args[0], (RooAbsReal&)*(RooAbsReal*)args[1]));
      return;
   }
   else {
      ((RooAbsReal* (&)(TF1*, RooAbsReal&))RooFit::bindFunction)(*(TF1**)args[0], (RooAbsReal&)*(RooAbsReal*)args[1]);
      return;
   }
}
#pragma clang diagnostic pop

==== SOURCE END ====

*** Break *** segmentation violation

Thanks,
Sina

Hi,

Your example its working on my ROOT build. Are you sure you have built all the RooFit libraries, libRooFit and libRooFitCore ?

Lorenzo

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

Thanks.

Ho

-Dall=In should be enough.

Then I would need to try on a similar machine. Can you remember me the architecture and compiler version?

Lorenzo

Hi,

CentOS-7-x86_64-Everything-1809-01
GCC version = 8.2.0
cmake version = 3.13.3

Do you need any other information?

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 ()
===========================================================

Hi,
I have tested on yhour arch and compiler, (cerntos7 + gcc 8.2) and your 3 lines :

    x    = RooRealVar("x","m_{tt} [GeV]",700,6000)
    fa1 = TF1("fa1","-x",700,6000)
    rfa1 = RooFit.bindFunction(fa1,x)

works fine.

Maybe you are having some configuration errors in your ROOT build. How did you install ROOT, from binaries or did you build it from source ?

Lorenzo

Hi Lorenzo,
I built it from the source file.

I don’t know then what could cause your problem. Have you tried in C++ if it works ? If not it might be a PyROOT problem

Lorenzo

Yes I had tried it.
It gives the same error with C++!!

Hi,

Can you send the output of

ls -l /home/sina/Apps/root/lib/libCore.so
ls -l /home/sina/Apps/root/lib/libRooFit*.so

Axel.

Hi Axel,

[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?

1 Like

Oh my!!
Thank you very much indeed Axel. It worked!

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