Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include "StEnumerations.h"
#include "TTree.h"
#include "TEnv.h"

#include <map>
#include <string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you removed the gSharedLibs line that was forcing these includes, so perhaps remove these includes too?


#define STAR_LOGGER 1
// PLease, preserve the comment after = { . It is used for documentation formatting
//
Expand Down Expand Up @@ -166,7 +170,7 @@ Int_t StBFChain::Load()
//LOG_QA << "Trying to load Library " << libL << endm;


iok = gSystem->Load(libL);
iok = LoadSharedLibrary(libL);
if (iok < 0) {

LOG_FATAL << "problem with loading of " << libL.Data() << endm;
Expand Down Expand Up @@ -197,6 +201,22 @@ Int_t StBFChain::Load()
LoadedLibs.Delete();
return status;
}
//_____________________________________________________________________________
// Single point for loading shared libraries
Int_t StBFChain::LoadSharedLibrary( const char* name ) {
#if ROOT_VERSION_CODE <= ROOT_VERSION(5,99,0)
return gSystem->Load(name);
#else
TInterpreter::EErrorCode code;
gInterpreter->ProcessLine( Form("#pragma cling load(\"%s\")",name), &code );
// code:
// 0 = successful execution of the line
// 1 = a recoverable failure, e.g. library not found. Result maps to -1.
// ... not sure what happens on mismatch ...
int result = code;
return -result;
#endif
};

//_____________________________________________________________________________
/// Maker-instantiation handler.
Expand Down Expand Up @@ -564,12 +584,12 @@ Int_t StBFChain::Instantiate()
if (GetOption("VFppLMV" ) ) mk->SetAttr("VFppLMV" , kTRUE);
if (GetOption("VFppLMV5" ) ) mk->SetAttr("VFppLMV5" , kTRUE);
if ( GetOption("VFPPVEv") ) {
gSystem->Load("StBTofUtil.so");
LoadSharedLibrary("StBTofUtil.so");
mk->SetAttr("VFPPVEv" , kTRUE);
}
else if (GetOption("VFPPV") && GetOption("Sti")) mk->SetAttr( "VFPPV", kTRUE);
if (GetOption("VFPPVEvNoBtof")){
gSystem->Load("StBTofUtil.so"); //Not used but loaded to avoid fail
LoadSharedLibrary("StBTofUtil.so"); //Not used but loaded to avoid fail
mk->SetAttr("VFPPVEvNoBtof", kTRUE);
}
if (GetOption("VFPPVnoCTB" ) ) mk->SetAttr("VFPPVnoCTB" , kTRUE);
Expand Down
1 change: 1 addition & 0 deletions StRoot/StBFChain/StBFChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class StBFChain : public StChain {
virtual Int_t Make(int number){ SetIventNumber(number); return StChain::Make(number);};
virtual Int_t Make(){return StChain::Make();};
virtual Int_t Load();
virtual Int_t LoadSharedLibrary(const char* name );
virtual Int_t Instantiate();
virtual Int_t Init();
virtual Int_t AddAB (const Char_t *after="",const StMaker *maker=0,const Int_t Opt=1);
Expand Down