Re: [ROOT] gSystem->Load, gInterpreter->AddIncludePath problems

From: Jacek M. Holeczek (holeczek@us.edu.pl)
Date: Fri Nov 05 2004 - 11:30:50 MET


Hi,
I have some news for you ... :-)

I have a shared library in a file "./G4/G4.so".

I can load it from the root command line :
-----------------------
root [0] cout << gSystem->Load(gSystem->ExpandPathName("G4/G4")) << endl;
0
root [1] .q
-----------------------

My shortest script is :
-----------------------
void x(void)
{
  cout << gSystem->Load(gSystem->ExpandPathName("G4/G4")) << " ";
  cout << gSystem->Load(gSystem->ExpandPathName("./G4/G4")) << " ";

  cout << gSystem->Load(gSystem->ExpandPathName("G4/G4.so")) << " ";
  cout << gSystem->Load(gSystem->ExpandPathName("./G4/G4.so")) << " ";

  cout << gSystem->Load(gSystem->ExpandPathName("G4/G4.lulu")) << " ";
  cout << gSystem->Load(gSystem->ExpandPathName("./G4/G4.lulu")) << " ";

  cout << gSystem->Load(gSystem->ExpandPathName("G4/G4.blah")) << " ";
  cout << gSystem->Load(gSystem->ExpandPathName("./G4/G4.blah")) << endl;
}
-----------------------
and the output is :
-----------------------
root [0] .x x.cxx
1 1 1 1 1 1 1 1
root [1] cout << gSystem->Load(gSystem->ExpandPathName("G4/G4")) << endl;
1
root [2] .q
-----------------------
Note, it did not load the library from the script, it did not see that
files with strange extensions do not exist, and afterwards, it was even
unable to load the library from the cint command line.

What concerns the AddIncludePath problem, I have found the following.
My "real" script contains :
	gSystem->Load(... G4/G4.so)
	...
	gInterpreter->AddIncludePath(path1)
	gInterpreter->AddIncludePath(path2)
	...
	gSystem->Load(... OtherLib.so)
The "OtherLib.so" depends on the "G4.so", and because the "G4.so" is NOT
loaded, I get :
	dlopen error: ... OtherLib.so: undefined symbol: _ZTI13G4UImessenger
	Load Error: Failed to load Dynamic link library ... OtherLib.so
	(int)(-1)
	*** Interpreter error recovered ***
and this error causes the problem ...
Before the "gSystem->Load(... OtherLib.so)", I get proper output from the
"gInterpreter->GetIncludePath()", after this "error recovery" I can see
that the "gInterpreter->GetIncludePath()" is replaced with the standard
default version (just the default "root_include" path), however, the
".include" cint command still returns the "proper" string with all added
paths.

Hope it helps,
Best regards,
Jacek.



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET