bug ?

From: E Anciant (anciant@phnx7.saclay.cea.fr)
Date: Wed Feb 03 1999 - 11:31:18 MET


Hello Rooters,

I am trying to use the attached rootlogon.C macro which is supposed
to load a bunch of shared libraries, but it stops with the following
output:

phns86: /home/crash4/anciant/CLAS/packages/clasroot/macro <307> root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   2.21/01   14 January 1999   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

CINT/ROOT C/C++ Interpreter version 5.13.83, Dec 2 1998
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
Welcome to the Root CLAS analysis framework

Fortran shared libraries loaded for SunOS
Local Path :/home/crash4/anciant/CLAS/slib/SunOS
Def Path :/home/crash4/thauger/CLAS/builds/LATEST/slib/SunOS
TObjString = /libbosio.so
TObjString = /libROOTclasbos.so
TObjString = /libROOTbosbank.so
TObjString = /libROOTclasana.so
TObjString = /libROOTclasevent.so
TObjString = /libROOTgenbod.so
TObjString = /libROOTkinfit.so
/home/crash4/anciant/CLAS/slib/SunOS/libbosio.so
/home/crash4/thauger/CLAS/builds/LATEST/slib/SunOS/libbosio.so
/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasbos.so
/home/crash4/thauger/CLAS/builds/LATEST/slib/SunOS/libROOTclasbos.so
Error: Array index out of range __MAKECINT__ -> [0]  valid upto EOF
FILE:/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasbos.so LINE:1
*** Interpreter error recovered ***
root [0] .file
  0 fp=0xfe4362a4 lines=409  file="iostream.h" 
  1 fp=0xfe4362b4 lines=39   file="iosenum.h" 
  2 fp=0xfe4362c4 lines=12   file="bool.h" 
  3 fp=0x       0 lines=0    file="/opt/SUNWspro/lib/libF77.so" 
  4 fp=0x       0 lines=0    file="/opt/SUNWspro/lib/libM77.so" 
  5 fp=0x       0 lines=0   
file="/home/crash4/anciant/CLAS/slib/SunOS/libbosio.so" 
  6 fp=0x       0 lines=0
file="/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasbos.so" 
G__MAXFILE = 500

if I try to load the libraries one by one by hand, everything works
fine:

root [0]   TIter
next(&c);                                                                    
root [1] objs =
(TObjString*)next()                                                           
(class TObjString*)0x48e0a8
root [2]     locallib = localpath +
objs->String();                                           
root [3]     cout << locallib.Data() <<
endl;                                                 
/home/crash4/anciant/CLAS/slib/SunOS/libbosio.so
root [4]    
gSystem->Load(locallib.Data());                                                  
Warning: File "/home/crash4/anciant/CLAS/slib/SunOS/libbosio.so" already
loaded
root [5] objs = (TObjString*)next()                
(class TObjString*)0x48e0d0
root [6]     locallib = localpath + objs->String();
root [7]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasbos.so
root [8]     gSystem->Load(locallib.Data());       
Warning: File "/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasbos.so"
already loaded
root [9] objs = (TObjString*)next()                
(class TObjString*)0x48e0f8
root [10]     locallib = localpath + objs->String();
root [11]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTbosbank.so
root [12]     gSystem->Load(locallib.Data());       
root [13] objs = (TObjString*)next()                
(class TObjString*)0x48e120
root [14]     locallib = localpath + objs->String();
root [15]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasana.so
root [16]     gSystem->Load(locallib.Data());       
root [17] objs = (TObjString*)next()                
(class TObjString*)0x48e148
root [18]     locallib = localpath + objs->String();
root [19]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTclasevent.so
root [20]     gSystem->Load(locallib.Data());       
root [21] objs = (TObjString*)next()                
(class TObjString*)0x48e170
root [22]     locallib = localpath + objs->String();
root [23]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTgenbod.so
root [24]     gSystem->Load(locallib.Data());       
root [25] objs = (TObjString*)next()                
(class TObjString*)0x48e198
root [26]     locallib = localpath + objs->String();
root [27]     cout << locallib.Data() << endl;      
/home/crash4/anciant/CLAS/slib/SunOS/libROOTkinfit.so
root [28]     gSystem->Load(locallib.Data());       
root [29] objs = (TObjString*)next()                
(class TObjString*)0x0

Is this a bug, or did I missed something ?

eric

rootlogon.C:

{
gROOT->Reset();

G__loadfile("iostream.h");
//G__loadfile("string.h");

cerr<<"Welcome to the Root CLAS analysis framework\n\n";

if (gSystem->Getenv("OSCLAS")) {
  if (!(strcmp(gSystem->Getenv("OSCLAS"),"SunOS"))) {
    gSystem->Load("/opt/SUNWspro/lib/libF77.so");
    gSystem->Load("/opt/SUNWspro/lib/libM77.so");
    cout << "Fortran shared libraries loaded for SunOS" << endl;
  } elseif(.false.) {
  } else {
    cout << "WARNING : fortran shared libraries unknown for OS: "<<
gSystem->Getenv("OSCLAS") << endl;
  }
} else {
  cout << "WARNING: The environement variable OSNAME is not defined"
<<endl;
  cout << "         No fortran shared library loaded !!!" << endl;
  }

if (gSystem->Getenv("CLAS_BUILD") && gSystem->Getenv("TOP_DIR")) {
  TString defpath(gSystem->Getenv("CLAS_BUILD"));
  TString localpath(gSystem->Getenv("TOP_DIR"));
  TString slibpath("/slib/");
  slibpath += gSystem->Getenv("OSCLAS");
  defpath += slibpath;
  localpath += slibpath;
  
  TOrdCollection c; // list of libraries to load:
  
  c.Add(new TObjString("/libbosio.so"));
  c.Add(new TObjString("/libROOTclasbos.so"));
  c.Add(new TObjString("/libROOTbosbank.so"));
  c.Add(new TObjString("/libROOTclasana.so"));
  c.Add(new TObjString("/libROOTclasevent.so"));
  c.Add(new TObjString("/libROOTgenbod.so"));
  c.Add(new TObjString("/libROOTkinfit.so"));
  
  cout << "Local Path :" << localpath << endl;
  cout << "Def Path :" << defpath << endl;

  TString locallib;
  TString deflib;

  c.Print();
  TObjString *objs;
  TIter next(&c);
  while (objs = (TObjString*)next()) {
    locallib = localpath + objs->String();
    deflib = defpath + objs->String();

    cout << locallib.Data() << endl;
    cout << deflib.Data() << endl;

    gSystem->Load(locallib.Data());

    /*
    if (gSystem->Load(locallib.Data()) == -1) {
      if (gSystem->Load(deflib.Data()) == -1) 
	cout << "Root Ana ERROR: Could not load " << deflib << " Library "
<<endl;
      else
	cout << deflib << " loaded instead" << endl;
    }
    else
      cout << locallib << " loaded" << endl;
      */
  }
  
  //G__loadfile("clasbanks.h");
  //G__loadfile("TBOSBank.cc");
}
else {
  cout << "ERROR: CLAS environement variables not defined - No shared
libraries loaded ";
  cout <<endl;
}

}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET