-- SebastianKupny - 22 Feb 2012

Building dynamic linked libraries (so) from macro

If you have a macro and you want to use the code as compiled program you can do that:) You need to
  1. include all headers of the objects used in your macro
  2. export two environment variables (ASYEOSROOT and ASYEOSROOTLIB) with paths to your project. These variables are used in macro loadlibs.C (see inside for details)
  3. create macro loadlibs.C - see the code

Creating dynamic linked library (and running)

   root -l
   .x loadlibs.C
   .x  unpacker.C+(...)

Will create so lib and launch the execution function. When you in the interpreter rootcint load the library then you can also call the main function like any other.

Using the library

  • In cint: open the root console, load library and finally call the function
    • root -l
    • gSystem->Load("PathToDirectory/unpacker.C")
    • unpacker()
  • In standalone program:
    • To be finished
  • In root bath mode
    • you can run it in batch with the command root -b loadlibs.C unpacker.C+(...) but that didn't work me

Note Be carefull to recompile everything in your build dir. if you want to change the type of CHIMERA outputs you want in you program (raw or calibrated), by having (in TRootEvent directory) TRootEvent.h being TRootEventId.h or TRootEvent_raw.h (cp them to TRootEvent.h before compiling)

Based on information given by Aranud
Topic attachments
I Attachment Action Size Date Who Comment
loadlibs.CC loadlibs.C manage 0.8 K 2012-02-22 - 15:51 SebastianKupny loading libs command to create linked library from macro in asyeos
Topic revision: r2 - 2012-02-26, SebastianKupny
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)