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)
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.
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 .