Does gcc version 4.1.2 work well for ROOT v 5.22?

Dear experts,

I am having a problem compiling my simulation code, which is a combination of ROOT and Geant4 functions, and my ROOT macros on my desktop PC. I hope to get some hints from you. Here are the facts:

1: The simulation code and ROOT macros work well on my laptop, which has Fedora 10 with gcc version 4.3.2 working on it. I am using ROOT_V5.22 on this machine.

2: The operating system for my desktop is Fedora 8 with gcc v4.1.2.

3: I have no problem to install and run ROOT version 5.22 and 5.14 on my desktop PC. And it seems that both versions work fine.

4: I can compile my simulation code with ROOT_V5.14, and it works fine.

5: However, the ROOT_V5.14 does not work well with my analyzing macro. The same macro runs much faster on my laptop (with ROOT_V5.22) than on this desktop. The CPU and memory of this desktop PC are no worse than those on my laptop.

So I would like to use ROOT_V5.22 on my desktop.

6: However, my simulation code does not compile with ROOT_V5.22 on my desktop. The same code does not have any problem on my laptop with the same version of ROOT. The error messages are something like:
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TClass::Streamer(void*, TBuffer&, TClass const*) const'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TVirtualStreamerInfo::CanDelete()'
/space/pang/root/root_v5.22/lib/libNet.so: undefined reference to `TCollection::Print(char const*, TPRegexp&, int) const'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `ROOT::TSchemaRule::HasTarget(TString const&) const'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TDirectory::UnregisterContext(TDirectory::TContext*)'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TVirtualStreamerInfo::GetElementCounter(char const*, TClass*)'
/space/pang/root/root_v5.22/lib/libNet.so: undefined reference to `TCollection::GetCollectionEntryName(TObject*) const'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TString::Hash(void const*, int)'
/space/pang/root/root_v5.22/lib/libRIO.so: undefined reference to `TProcessID::GetPID()'

In the makefile, I am using ROOT with

   ROOTLIBS      = $(shell $(ROOTSYS)/bin/root-config --glibs) -lMinuit -lHtml
   ROOTLIBS      := $(filter-out -lNew,$(ROOTLIBS))
   ROOTLIBS      := $(filter-out -lThread,$(ROOTLIBS))
   ROOTLIBS      := $(filter-out -lpthread,$(ROOTLIBS))

I don’t understand why the same code working well on my laptop does not work on my desktop. The only difference I can see now is the version of gcc. Is it really because of the gcc version 4.1.2 is not good for ROOT_V5.22. (However, it is puzzling again that ROOT_V5.22 itself seems to work…)

Pang

Are you mixing code compiled with gcc4.1.2 and a library compiled with gcc4.3.2 or vice-versa?

Rene

Thanks for reply :slight_smile:

I think I am not mixing code compiled with different versions of gcc.

The problem now is in “compiling” not running the code with ROOT_v5.22.

Pang

Sorry, it turned out that it is not a problem with ROOT, it is a problem with Geant4:

My problem is solved by changing following line in binmake.gmk file:

@$(CXX) $(CXXFLAGS) $(CPPFLAGS) \

to

@$(CXX) $(shell $(ROOTSYS)/bin/root-config --glibs) $(CXXFLAGS) $(CPPFLAGS) \