Linking problem on OS with RooClassFactory

Dear Experts,
I’ve tried on my MAC the RooClassFactory.h in place of RooGenericPdf.h
The code compiles, but when I try to run it I get the following message:

Can you please help me to figure this out ?
Many thanks,

  • Mauro.

[ExtractYield::MakeAngWithEffPDF] @@@ 2D angularefficiency p.d.f. @@@
(9/16 * (2/3
((FsS) + (AsS20.89sqrt(3(FsS)(1-(FsS))(1/2 + TMath::ATan(FlS)/TMath::Pi())))CosThetaKArb) * (1-CosThetaMuArbCosThetaMuArb) + (1-(FsS)) * (2*(1/2 + TMath::ATan(FlS)/TMath::Pi())CosThetaKArbCosThetaKArb * (1-CosThetaMuArbCosThetaMuArb) + 1/2(1-(1/2 + TMath::ATan(FlS)/TMath::Pi())) * (1-CosThetaKArbCosThetaKArb) * (1+CosThetaMuArbCosThetaMuArb) + 4/3*(3/4*(1 - (1/2 + TMath::ATan(FlS)/TMath::Pi())) * 2TMath::ATan(AfbS)/TMath::Pi()) * (1-CosThetaKArbCosThetaKArb) * CosThetaMuArb))) * ((P0 + P1CosThetaKArb + P2CosThetaKArbCosThetaKArb + P3CosThetaKArbCosThetaKArbCosThetaKArb) + (P4 + P5CosThetaKArb + P6CosThetaKArbCosThetaKArb + P7CosThetaKArbCosThetaKArbCosThetaKArb) * CosThetaMuArb + (P8 + P9CosThetaKArb + P10CosThetaKArbCosThetaKArb + P11CosThetaKArbCosThetaKArbCosThetaKArb) * CosThetaMuArbCosThetaMuArb + (P12 + P13CosThetaKArb + P14CosThetaKArbCosThetaKArb + P15CosThetaKArbCosThetaKArbCosThetaKArb) * CosThetaMuArbCosThetaMuArbCosThetaMuArb + (P16 + P17CosThetaKArb + P18CosThetaKArbCosThetaKArb + P19CosThetaKArbCosThetaKArbCosThetaKArb) * CosThetaMuArbCosThetaMuArbCosThetaMuArbCosThetaMuArb + (P20 + P21CosThetaKArb + P22CosThetaKArbCosThetaKArb + P23CosThetaKArbCosThetaKArbCosThetaKArb) * CosThetaMuArbCosThetaMuArbCosThetaMuArbCosThetaMuArbCosThetaMuArb)
Info in TMacOSXSystem::ACLiC: creating shared library /Users/dinardo/Documents/MyDocuments/CMS/PhysicsAnalysis/B0Analysis/B0KstMuMu/plugins/RooAngleSPdf_cxx.so
ld: can’t link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) file ‘/System/Library/Extensions/AppleIntelHD5000GraphicsGLDriver.bundle/Contents/MacOS/AppleIntelHD5000GraphicsGLDriver’ for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in : Compilation failed!

*** Break *** segmentation violation
Generating stack trace…
0x000000010e22c636 in RooClassFactory::makePdfInstance(char const*, char const*, char const*, RooArgList const&, char const*) (in libRooFitCore.so) (RooClassFactory.cxx:332)
0x000000010e22c587 in RooClassFactory::makePdfInstance(char const*, char const*, RooArgList const&, char const*) (in libRooFitCore.so) (RooClassFactory.cxx:293)
0x000000010c2cbc72 in MakeAngWithEffPDF(TF2*, RooRealVar*, RooRealVar*, unsigned int, bool, RooArgSet*, RooArgSet*, std::__1::vector<double, std::__1::allocator >, int, bool) (in ExtractYield) + 9426
0x000000010c31e60c in InstantiateMass2AnglesFit(RooAbsPdf**, bool, RooRealVar
, RooRealVar*, RooRealVar*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, unsigned int, std::__1::vecto
0x000000010c33a09d in IterativeMass2AnglesFitq2Bins(RooDataSet*, bool, double, double, double, RooRealVar*, RooRealVar*, RooRealVar*, int, unsigned int, std::__1::vector<TH1D*, std::__1::allocator<TH1D*> >*, std::__1::vect
0x000000010c346b30 in main (in ExtractYield) + 26096
0x00007fff93ec7255 in start (in libdyld.dylib) + 1

OS version: 10.12.1

clang version:
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Hi,

Which ROOT version is that? (and sorry for the late reply - sometimes posts slip through the cracks…)

Cheers, Axel.

Hi Axel,
no problem.

I’m using root: root_v6.06.08

Cheers,

  • Mauro.

Hi,

Before RooAngleSPdf_cxx.so gets created (I suppose you have a “RooAngleSPdf.cxx+” somewhere), could you send the output of

printf("%s\n", gInterpreter->GetSharedLibs())

Cheers, Axel.

Hi Alex,
from root interactive session i get:

root [0] printf("%s\n", gInterpreter->GetSharedLibs())
/Users/dinardo/root/myBuild/lib/libRint.so /Users/dinardo/root/myBuild/lib/libCore.so /usr/lib/libz.1.dylib /usr/lib/libenergytrace.dylib /usr/lib/libScreenReader.dylib /usr/lib/libxml2.2.dylib /usr/lib/libarchive.2.dylib /usr/lib/libcoretls.dylib /usr/lib/libcoretls_cfhelpers.dylib /usr/lib/libxar.1.dylib /usr/lib/libsqlite3.dylib /usr/lib/libbz2.1.0.dylib /usr/lib/liblzma.5.dylib /usr/lib/libnetwork.dylib /usr/lib/libpcap.A.dylib /usr/lib/libmecabra.dylib /usr/lib/libcompression.dylib /usr/lib/libiconv.2.dylib /usr/lib/libheimdal-asn1.dylib /usr/lib/libmarisa.dylib /usr/lib/libChineseTokenizer.dylib /usr/lib/libcmph.dylib /usr/lib/libxslt.1.dylib /usr/lib/libate.dylib /usr/lib/libFosl_dynamic.dylib /Users/dinardo/root/myBuild/lib/libCling.so /Users/dinardo/root/myBuild/lib/libRIO.so /usr/lib/libncurses.5.4.dylib /Users/dinardo/root/myBuild/lib/libThread.so /Users/dinardo/root/myBuild/lib/libMathCore.so
(int) 918
root [1]

Cheers,

  • Mauro.

Hi,

Thanks - I’ll have to debug. This is not related to RooClassFactory but “simply” a question of compiling RooAngleSPdf.cxx after “too many” libraries have been loaded.

I try to filter the libraries we pass to the linker.

Cheers, Axel.

Axel,
The problem has to do with filtering libraries that are BUNDLES and cannot be linked. Some filtering was done with the commit github.com/root-mirror/root/com … 234ad01c3a
We need to extend it and ensure that the following library is also filtered. /System/Library/Extensions/AppleIntelHD5000GraphicsGLDriver.bundle/Contents/MacOS/AppleIntelHD5000GraphicsGLDriver

Pere

Hi All,
many thanks for looking into this.

So, my understanding is that I need to wait for
a new version of ROOT where the problem
should be fixed. Is this correct ?

  • Mauro.

We will try to provide you with a patch. But, before I would like to know what is the application you run to obtain the initial error? Is this the root executable? or something else?
Pere

Hi Pere,
it’s a standalone program, i.e. it’s a compiled program.

The instruction in the code are like:

I’m substituting this RooGenericPdf line:
AnglesPDF = new RooGenericPdf(“AngleS”,myString.str().c_str(),RooArgSet(*VarsAng,*VarsPoly));
with:
AnglesPDF = RooClassFactory::makePdfInstance(“AngleS”,myString.str().c_str(),RooArgSet(*VarsAng,*VarsPoly));

Cheers,

  • Mauro.

Can you please post the output of

otool -L <your standalone program>

Hi Mato,
probably I’m doing something wrong because I get the message:

root [0] otool -L ExtractYield.cc
ROOT_prompt_0:1:9: error: expected ‘;’ after expression
otool -L ExtractYield.cc
^
;
ROOT_prompt_0:1:10: error: use of undeclared identifier 'ExtractYield’
otool -L ExtractYield.cc
^
root [1] otool -L ExtractYield
ROOT_prompt_1:1:9: error: expected ‘;’ after expression
otool -L ExtractYield
^
;
ROOT_prompt_1:1:10: error: use of undeclared identifier 'ExtractYield’
otool -L ExtractYield

Cheers,

  • Mauro.

Hi Mauro,
Execute the command in the shell (directly in the Terminal).
Pere

Hi,
here it is:

iHulk:plugins dinardo$ otool -L ExtractYield
ExtractYield:
@rpath/libGui.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libNet.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHist.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGraf3d.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libGpad.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRint.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPostscript.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMatrix.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libPhysics.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMathCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libThread.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libMultiProc.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
@rpath/libMinuit.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRooFit.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRooFitCore.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libFoam.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)

Cheers,

  • Mauro.

Dear All,
I was wondering whether you had a chance to look into this.

Many thanks,

  • Mauro.

Added bug in JIRA sft.its.cern.ch/jira/browse/ROOT-8511

Dear All,
do you have any news about this issue ?

Many thanks and kind regards,

  • Mauro.

Dear All,
do you have any news about this issue ?

Many thanks and kind regards,

  • Mauro.

Finally fixed in the master and v6-08; it will be part of v6.08/06 to be released this week!

Apologies for the long delay…

Axel.

Hi,
many thanks.

One quick question: how can I link my program to library generated with the command:

AnglesPDF = RooClassFactory::makePdfInstance("AngleS",myString.str().c_str(),RooArgSet(*VarsAng,*VarsPoly));

The command creates the following files:

RooAngleSPdf.cxx
RooAngleSPdf.h
RooAngleSPdf_cxx.d
RooAngleSPdf_cxx.so
RooAngleSPdf_cxx_ACLiC_dict_rdict.pcm

How can then compile another program that links this library ?
in clang++ the option
.L . -l:$(wildcard *_cxx.so)
does not work.

Many thanks for your support.
Kind regards,

  • Mauro.