MakeSelector Compiling

I have created MakeSelector files MyAnalysis.C and MyAnalysis.h which I now want to run in compiled mode.

I try to do this in the following way:-

chain->Process(“MyAnalysis.C+”)

but only get the error message

root [4] t1->Process(“MyAnalysis.C+”);
dlopen error: /media/sdb1/e452_bis/combi/./MyAnalysis_C.so: failed to map segment from shared object: Operation not permitted
Load Error: Failed to load Dynamic link library /media/sdb1/e452_bis/combi/./MyAnalysis_C.so
*** Interpreter error recovered ***
Error in TSelector::GetSelector: file MyAnalysis.C+ does not have a valid class deriving from TSelector

I have not added anything to the generated MakeSelector files so I don’t understand what the problem is here. [/i]

MakeSelector is not able to generate code to include include files necessary
to declare the data types found in a TTree. You must add these includes yourself. I suggest to try by simply doing

root > .L MyAnalysis.C+ before calling it with chain.Process.

Rene

HI Rene, I still don’t really understand what is going on here.

I have attached the generated MakeSelector files. They are UNEDITED, and would assume that these should compile (since they are the simplest of examples with nothing added by myself) using

chain->Process(“Event.C+”)

However I receive this error.

root [1] chain->Process(“Event.C+”);
Info in TUnixSystem::ACLiC: creating shared library /media/sdb1/e452_bis/combi/./Event_C.so
/media/sdb1/e452_bis/combi/./Event.C:51: warning: unused parameter ‘entry’
dlopen error: /media/sdb1/e452_bis/combi/./Event_C.so: failed to map segment from shared object: Operation not permitted
Load Error: Failed to load Dynamic link library /media/sdb1/e452_bis/combi/./Event_C.so
/media/sdb1/e452_bis/combi/./Event.C:51: warning: unused parameter ‘entry’
/usr/lib/gcc/i486-linux-gnu/4.1.2/…/…/…/…/lib/crt1.o: In function _start': (.text+0x18): undefined reference tomain’
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
Error in TSelector::GetSelector: file Event.C+ does not have a valid class deriving from TSelector

also .L Event.C+ does not work.

Regards, Nick.
Event.h (43 KB)
Event.C (3.12 KB)

I can compile your file correctly. To understand what happens during execution, I need your data file(s) and teh script creating your TChain.
Do you obersve the same problem when processing only one file ?

Rene

I have the same problem when trying to do this with one file. I cannot get the script to compile.

Feel free to download an example root file from ph.surrey.ac.uk/~php2np

and I also attach the chain macro.

Many thanks,
chain.cpp (4.35 KB)

This is now fixed in the CVS repository.

Cheers,
Philippe

The problem was due to a clash between your class “Event” and a similar name in the TMVA package.
If you do not want to pick the latest CVS, simply change the name of your class.

Rene

Thankyou for the taking the time to look into my problem, however you suggestion above still doesn’t appear to fix my problem. I still cannot even complile the MakeSelector output files with NOTHING added to them.

I performed the following

.x chain.cpp (using the chain macro supplied to you)

chain->MakeSelector(“NewCode”)

and then

chain->Process(“NewCode.C+”)

which then returns…

root [4] chain->Process(“NewCode.C+”)
Info in TUnixSystem::ACLiC: creating shared library /media/sdb1/e452_bis/combi/./NewCode_C.so
dlopen error: /media/sdb1/e452_bis/combi/./NewCode_C.so: failed to map segment from shared object: Operation not permitted
Load Error: Failed to load Dynamic link library /media/sdb1/e452_bis/combi/./NewCode_C.so
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/…/…/…/…/lib64/crt1.o: In function _start': (.text+0x20): undefined reference tomain’
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
Error in TSelector::GetSelector: file NewCode.C+ does not have a valid class deriving from TSelector
(Long64_t)(-1)

Same problem as before, both on my desktop and my own laptop (each running Root 5.16).

Any suggestions would be appreciated!

Thanks, Nick.

Most likely your SELinux is setup to prevent you from loading shared library. Check for example ittvis.com/services/techtip.asp?ttid=3092

Cheers,
Philippe

Thats very interesting, I shall give that to the system administrator and see what he thinks.

In the mean time I have also found something interesting. If the files are on my LOCAL hard disk then everything is fine. I have been doing this on my external USB disk and it appears that compilation fails on my two computers when running the codes from the external hard drive.

Have you ever come across this before, where compiling is fine on a local hard drive but not on external hard drive?

Cheers, Nick.

Hi,

I have not seen this particular case. However, it sounds like a reasonable restriction for SELinux to prevent by default the execution/loading of program/shared library on a removable disk (aka those might be virus).

Cheers,
Philippe