Re: Using third party software in a compiled macro

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Thu, 10 Jan 2008 12:24:00 +0100


Hi Marc de,

> Can I compile my macro in such a way that the Irrelevant object is
> used correctly? I’m not interested in serializing Irrelevant objects,
> or using them in CINT.

What do you want to do with bla.cpp? Do you want to e.g. ".L bla.cpp+"? In that case simply change your bla.cpp's #include to

#ifndef __MAKECINT__
#include “Irrelevant.h”
#endif

void Bla() {
#ifndef __MAKECINT__

   cout << “Doing bla” << endl;
   Irrelevant dummy;
   Dummy.DoNothing();
#endif
}

CINT doesn't need to know what Bla() does - it just needs to know that it is a void function. With the #ifndef-s you hide it from CINT. Now you just need to do:

gSystem->Load("$IRRELEVANT/lib/libIrrelevant"); gSystem->SetIncludePath("-I$ROOTSYS/include -I$IRRELEVANT/include") .L bla.cpp+

The loading of libIrrelevant is needed because the ACLIC invokes the linker with all loaded libraries - and by loading it all symbols of class Irrelevant will get resolved.

Cheers, Axel.

On 2008-01-10 12:11, Marc de Kamps wrote:
>
>
> Dear Rooters,
>
>
>
> How can I use third party software in macro’s? Suppose I have macro
> bla.cpp:
>
>
>
> #include “Irrelevant.h”
>
>
>
> void Bla()
>
> {
>
> cout << “Doing bla” << endl;
>
> Irrelevant dummy;
>
> Dummy.DoNothing();
>
> }
>
>
>
> The headers of irrelevantlib are in $IRRELEVANT/include, the library,
> libirrelevant.so, in $IRRELEVANT/lib.
>
>
>
> Can I compile my macro in such a way that the Irrelevant object is used
> correctly? I’m not interested in serializing Irrelevant objects, or
> using them in CINT.
>
> -
>
> Dr. Marc de Kamps
>
> Biosystems Group
>
> School of Computing
>
> University of Leeds
>
> LS29JT, Leeds, UK
>
>
>
> dekamps_at_comp.leeds.ac.uk <mailto:dekamps_at_comp.leeds.ac.uk>
>
> http:/www.comp.leeds.ac.uk/dekamps
>
>
>
Received on Thu Jan 10 2008 - 12:24:06 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 10 2008 - 17:50:01 CET