Problem with uploading package derived from TLorentzVector

hi,

I have a problem when trying to use a package (ie. Electron.par) which is an Electron class derived from TLorentzVector class. it failed when I enable it with an message:

...
Mst-0: building Electron ...
Mst-0: make: Nothing to be done for `all'.
Wrk-0.16: building Electron ...
Wrk-0.16: make: Nothing to be done for `all'.
Wrk-0.48: building Electron ...
Wrk-0.48: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Wrk-0.32: building Electron ...
Wrk-0.0: building Electron ...
Wrk-0.0: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic  -c Electron.cxx
Wrk-0.48: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic  -c Electron.cxx
Wrk-0.32: make: Nothing to be done for `all'.
Wrk-0.0: Generating dictionary ElectronDict.cxx...
Wrk-0.48: Generating dictionary ElectronDict.cxx...
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic  -c ElectronDict.cxx
Wrk-0.48: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic  -c ElectronDict.cxx
Wrk-0.0: g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so 
Wrk-0.0: libElectron.so done
Wrk-0.48: g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so 
Wrk-0.48: libElectron.so done
dlopen error: /afs/in2p3.fr/home/b/baotran/.proof/packages/Electron/./libElectron.so: undefined symbol: _ZTI14TLorentzVector
Load Error: Failed to load Dynamic link library /afs/in2p3.fr/home/b/baotran/.proof/packages/Electron/./libElectron.so
*** Interpreter error recovered ***
Error in <TProof::LoadPackageOnClient>: loading package Electron on client failed

where I had a reference to mother class in LinkDef header file which looks like: (I attached the .par package if it helps)

#ifdef __MAKECINT__ 

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class TLorentzVector+;
#pragma link C++ class Electron+;
#pragma link C++ class std::vector< int >+;
#pragma link C++ class std::vector< std::vector< int > >+;
#pragma link C++ class std::vector< std::vector< float >  >+;
#pragma link C++ class std::vector< std::vector< double >  >+;
#pragma link C++ class std::vector< float >;
#pragma link C++ class std::vector< std::string>;
#pragma link C++ class std::vector< std::vector< string > >+;
#pragma link C++ class std::vector< Electron >+;
#pragma link C++ class std::vector< TString >+;
#pragma link C++ class std::vector< std::vector< Electron > >+;
#pragma link C++ class std::vector< std::vector< double > >+;

Thank you for any helps or comments,
Tran
Electron.par (4.21 KB)

Hi,

you specify linker flags $(LIBS) to the compilation step, that won’t help:

-L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic

should be moved to where you link the .so e.g. as $(EXPLLINKLIBS):
g++ -shared -O2 -m64 Electron.o ElectronDict.o -o libElectron.so

Cheers, Axel.

hello Axel,

It still have problem in loading .so file

...
Mst-0: building Electron ...
Mst-0: make: Nothing to be done for `all'.
Wrk-0.0: building Electron ...
Wrk-0.0: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c Electron.cxx
Wrk-0.0: Generating dictionary ElectronDict.cxx...
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c ElectronDict.cxx
Wrk-0.0: g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so  -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic 
Wrk-0.0: libElectron.so done
(int)0
dlopen error: /scratch/proofbox/baotran/packages/Electron/./libElectron.so: undefined symbol: _ZNK14TLorentzVector5PrintEPKc
Load Error: Failed to load Dynamic link library /scratch/proofbox/baotran/packages/Electron/./libElectron.so
*** Interpreter error recovered ***

Do you know the reason? Please, help me!
thanks a lot,
Tran

Hi,

what does ldd /scratch/proofbox/baotran/packages/Electron/./libElectron.so show? You could add it as the last command in the list of commands building libElectron.so in your Makefile.

Cheers, Axel.

hello,

After inserting ldd command in Makefile, it show like:

Info in <TProof::BuildPackageOnClient>: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Unknown argument "--nostubs"!
Usage: root-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--auxcflags] [--ldflags] [--new] [--nonew] [--libs] [--glibs] [--bindir] [--libdir] [--incdir] [--etcdir] [--noauxcflags] [--noauxlibs] [--noldflags] [--has-<feature>] [--arch] [--platform] [--dicttype] [--config] [--features] [--svn-revision] [--python-version] [--cc] [--cxx] [--f77] [--ld ] [--help]
g++ -O2 -Wall -fPIC -pthread -m64 -I/usr/local/root/root_v5.27.06/include -c Electron.cxx
Generating dictionary ElectronDict.cxx...
g++ -O2 -Wall -fPIC -pthread -m64 -I/usr/local/root/root_v5.27.06/include -c ElectronDict.cxx
g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so  -L/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic 
libElectron.so done
ldd /scratch/proofbox/baotran/packages/Electron/./libElectron.so
ldd: /scratch/proofbox/baotran/packages/Electron/./libElectron.so: No such file or directory
make: *** [libElectron.so] Error 1
Error in <TProof::BuildPackageOnClient>: building package Electron on the client failed
Mst-0: building Electron ...
Mst-0: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Mst-0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c Electron.cxx
Mst-0: Generating dictionary ElectronDict.cxx...
Mst-0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c ElectronDict.cxx
Mst-0: g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so  -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic 
Mst-0: libElectron.so done
Mst-0: ldd /scratch/proofbox/baotran/packages/Electron/./libElectron.so
Mst-0:  libCore.so => /usr/local/root/root4laf/lib/libCore.so (0x00002b77865e0000)
Mst-0:  libCint.so => /usr/local/root/root4laf/lib/libCint.so (0x00002b7786f29000)
Mst-0:  libRIO.so => /usr/local/root/root4laf/lib/libRIO.so (0x00002b77878c5000)
Mst-0:  libNet.so => /usr/local/root/root4laf/lib/libNet.so (0x00002b7787c6d000)
Mst-0:  libHist.so => /usr/local/root/root4laf/lib/libHist.so (0x00002b7787f9f000)
Mst-0:  libGraf.so => /usr/local/root/root4laf/lib/libGraf.so (0x00002b77885f9000)
Mst-0:  libGraf3d.so => /usr/local/root/root4laf/lib/libGraf3d.so (0x00002b77889b3000)
Mst-0:  libGpad.so => /usr/local/root/root4laf/lib/libGpad.so (0x00002b7788ce0000)
Mst-0:  libTree.so => /usr/local/root/root4laf/lib/libTree.so (0x00002b7788fcf000)
Mst-0:  libRint.so => /usr/local/root/root4laf/lib/libRint.so (0x00002b77893e9000)
Mst-0:  libPostscript.so => /usr/local/root/root4laf/lib/libPostscript.so (0x00002b7789619000)
Mst-0:  libMatrix.so => /usr/local/root/root4laf/lib/libMatrix.so (0x00002b7789869000)
Mst-0:  libPhysics.so => /usr/local/root/root4laf/lib/libPhysics.so (0x00002b7789cd3000)
Mst-0:  libMathCore.so => /usr/local/root/root4laf/lib/libMathCore.so (0x00002b7789f77000)
Mst-0:  libThread.so => /usr/local/root/root4laf/lib/libThread.so (0x00002b778a34c000)
Mst-0:  libdl.so.2 => /lib64/libdl.so.2 (0x00002b778a5bc000)
Mst-0:  libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b778a7c0000)
Mst-0:  libm.so.6 => /lib64/libm.so.6 (0x00002b778aac0000)
Mst-0:  libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b778ad44000)
Mst-0:  libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b778af52000)
Mst-0:  libc.so.6 => /lib64/libc.so.6 (0x00002b778b16d000)
Mst-0:  libz.so.1 => /usr/lib64/libz.so.1 (0x00002b778b4c5000)
Mst-0:  libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b778b6d9000)
Mst-0:  libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00002b778b912000)
Mst-0:  /lib64/ld-linux-x86-64.so.2 (0x00002b77861b8000)
Wrk-0.0: building Electron ...
Wrk-0.0: Electron: version change (current: 5.27/06:35857, build: :-1): cleaning ... 
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c Electron.cxx
Wrk-0.0: Generating dictionary ElectronDict.cxx...
Wrk-0.0: g++ -O2 -Wall -fPIC -pthread -m64 -I/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/include -c ElectronDict.cxx
Wrk-0.0: g++ -shared -O2 -m64 Electron.o ElectronDict.o -o  libElectron.so  -L/afs/in2p3.fr/system/amd64_sl5/usr/local/root/root_v5.27.06/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic 
Wrk-0.0: libElectron.so done
Wrk-0.0: ldd /scratch/proofbox/baotran/packages/Electron/./libElectron.so
Wrk-0.0:        linux-vdso.so.1 =>  (0x00007fff9597d000)
Wrk-0.0:        libCore.so => /usr/local/root/root4laf/lib/libCore.so (0x00002b72814d4000)
Wrk-0.0:        libCint.so => /usr/local/root/root4laf/lib/libCint.so (0x00002b7281e1e000)
Wrk-0.0:        libRIO.so => /usr/local/root/root4laf/lib/libRIO.so (0x00002b72827ba000)
Wrk-0.0:        libNet.so => /usr/local/root/root4laf/lib/libNet.so (0x00002b7282b61000)
Wrk-0.0:        libHist.so => /usr/local/root/root4laf/lib/libHist.so (0x00002b7282e94000)
Wrk-0.0:        libGraf.so => /usr/local/root/root4laf/lib/libGraf.so (0x00002b72834ee000)
Wrk-0.0:        libGraf3d.so => /usr/local/root/root4laf/lib/libGraf3d.so (0x00002b72838a7000)
Wrk-0.0:        libGpad.so => /usr/local/root/root4laf/lib/libGpad.so (0x00002b7283bd5000)
Wrk-0.0:        libTree.so => /usr/local/root/root4laf/lib/libTree.so (0x00002b7283ec4000)
Wrk-0.0:        libRint.so => /usr/local/root/root4laf/lib/libRint.so (0x00002b72842dd000)
Wrk-0.0:        libPostscript.so => /usr/local/root/root4laf/lib/libPostscript.so (0x00002b728450e000)
Wrk-0.0:        libMatrix.so => /usr/local/root/root4laf/lib/libMatrix.so (0x00002b728475e000)
Wrk-0.0:        libPhysics.so => /usr/local/root/root4laf/lib/libPhysics.so (0x00002b7284bc7000)
Wrk-0.0:        libMathCore.so => /usr/local/root/root4laf/lib/libMathCore.so (0x00002b7284e6c000)
Wrk-0.0:        libThread.so => /usr/local/root/root4laf/lib/libThread.so (0x00002b7285241000)
Wrk-0.0:        libdl.so.2 => /lib64/libdl.so.2 (0x00002b72854b0000)
Wrk-0.0:        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b72856b5000)
Wrk-0.0:        libm.so.6 => /lib64/libm.so.6 (0x00002b72859b5000)
Wrk-0.0:        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b7285c38000)
Wrk-0.0:        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b7285e47000)
Wrk-0.0:        libc.so.6 => /lib64/libc.so.6 (0x00002b7286062000)
Wrk-0.0:        libz.so.1 => /usr/lib64/libz.so.1 (0x00002b72863b9000)
Wrk-0.0:        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b72865ce000)
Wrk-0.0:        libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00002b7286806000)
Wrk-0.0:        /lib64/ld-linux-x86-64.so.2 (0x00002b72810ac000)

It seems that Electron lib has been built well on each worker node but when I tried to include “Electron.h” in Tselector class, it doesn’t work.

Cheers,
Tran

Hi,

The main problem is that you do not load libPhysics, the library containing TLorenzVector. Autoload works for classes, not for libraries. Then the warnings about ‘nostubs’ and alike come from the fact that the Makefile that you use must be rather old.

Attached is the fixed PAR file (ElectronMk.par).

However, when you have a simple class, or a set of simple classes depending on each other, you can just load them in SETUP.C as you would do in a normal ROOT session. No need for makefiles, dictionary files, etc.
See Electron.par .

Gerri Ganis
Electron.par (571 Bytes)
ElectronMk.par (4.04 KB)

hello Gerri,

First, sorry for a late reply. I checked and it works now.
Thanks for your comment, it helps much :slight_smile:

Tran