star-bnl / star-sw

Core software for STAR experiment
26 stars 63 forks source link

rootlogoff.C needs a fix for ROOT6 #657

Open genevb opened 2 months ago

genevb commented 2 months ago

We now have root4star using ROOT 6.24.06 in SL23x. However, upon quitting root4star, we get the following error:

> root4star -b -l -q
 *** Start at Date : Fri Feb 16 11:37:17 2024

/afs/rhic.bnl.gov/star/packages/SL23x/StRoot/macros/rootlogoff.C:5:19: error: 'StMaker' is not a class, namespace, or enumeration
    StMaker* mk = StMaker::GetChain();
                  ^
/afs/rhic.bnl.gov/star/packages/SL23x/StRoot/macros/rootlogoff.C:5:19: note: 'StMaker' declared here
/afs/rhic.bnl.gov/star/packages/SL23x/StRoot/macros/rootlogoff.C:6:9: error: use of undeclared identifier 'mk'
    if (mk) {
        ^
/afs/rhic.bnl.gov/star/packages/SL23x/StRoot/macros/rootlogoff.C:7:7: error: use of undeclared identifier 'mk'
      mk->Finish();
      ^

I do not know what the appropriate solution is for this. I did find that by copying minimally what I see in bfc.C, a local rootlogoff.C loads and executes for ROOT 6.24.06 without errors if I add the following two lines at the top...but is this the best thing to do?

#pragma cling load("St_base")
#pragma cling load("StChain")

Some additional notes regarding testing...

  1. A local rootlogoff.C (neither in the working directory, not under a local StRoot/macros) does not override the rootlogoff.C under $STAR/StRoot/macros when quitting root4star. The only way I could test local changes to rootlogoff.C was to execute .L rootlogoff.C or .x rootlogoff.C from the root4star prompt (it will look for local macros when doing so).
  2. .x rootlogoff.C works in our ROOT 5.34.38 libraries, but .L rootlogoff.C does not, resulting in a different error which I suppose is inconsequential since the macro is only ever called with the intent to execute, not simply load.
genevb commented 2 months ago

I should add that to use root4star in SL23x at the moment, one needs to do the following:

setup 64bits
starver SL23x config/v0.3.0-rhel7-root6.24.06
klendathu2k commented 2 months ago

I strongly suspect that is the correct solution. I think that you could test this my adding mk->ls(4); to the rootlogoff, and confirm that it is calling finish on the chain that you instantiated.