Geant4_vmc compiling issues

Hello all,

I tried to install geant4_vmc but while compiling I get several errors like “TString.h: No such file or directory” for every file included from ROOT.

Checking the Makefile, the variable ROOT_INCDIR point to the right directory, so the compiler should be able to find the files to include. All the others environment variables are correctly set.

I solved the problem adding $(shell root-config --cflags) to CXXFLAGS, but then I have the same problem when I try to compile the examples (and I can solve in the same way).

What is going wrong?

Other problem: I have to manually copy the .h and .cxx files from root/montecarlo/g4root/ to geant4_vmc/source/geometry. Shouldn’t those file be already processed when compiling ROOT with --enable-g4root? Are the two problems related?

Running on linux with:
-geant4.9.2.p01
-root 5.23.02
-vgm 3.02
-geant4_vmc 2.6

Thanks,

Fred

Hi Fred,

Could you send me the outputs from the following:
echo $ROOTSYS
root-config --incdir
and the output from geant4_vmc compilation after setting the environment
variable CXXVERBOSE to 1. (you can send just the output from compilation
of one .cxx file) and with Makefile without your modifications.
Also, what’s is your platform?

Regards,

Ivana

Dear Ivana, this is the output

shogun@linux:~/geant2/geant4_vmc/source> echo $ROOTSYS
/home/shogun/geant2
shogun@linux:~/geant2/geant4_vmc/source> root-config --incdir
/home/shogun/geant2/include/root
/home/shogun/geant2
shogun@linux:~/geant2/geant4_vmc/source> make
global/src/TG4G3ControlVector.cxx
g++ -O2 -g -Wall -W -fPIC -pipe -Woverloaded-virtual  -I. -Iglobal/include -Igeometry/include -Idigits+hits/include -Iphysics/include -Iphysics_list/include -Ievent/include -Irun/include -Ivisualization/include -I/home/shogun/geant2/include/geant4 -I/home/shogun/geant2/include -I/home/shogun/geant2/src/geant4/source/interfaces/common/include -I/home/shogun/geant2/vgm.3.02/packages/VGM/include -I/home/shogun/geant2/vgm.3.02/packages/ClhepVGM/include -I/home/shogun/geant2/vgm.3.02/packages/BaseVGM/include -I/home/shogun/geant2/vgm.3.02/packages/Geant4GM/include -I/home/shogun/geant2/vgm.3.02/packages/RootGM/include -I/home/shogun/geant2/vgm.3.02/packages/XmlVGM/include -I/home/shogun/geant2/include -DUSE_VGM -DG4VIS_USE -DG4VIS_USE_OPENGLX -DG4VIS_USE_OPENGL -I/home/shogun/geant2/src/geant4/source/visualization/OpenGL/include -I/home/shogun/geant2/src/geant4/source/visualization/management/include -I/home/shogun/geant2/src/geant4/source/visualization/modeling/include -I/home/shogun/geant2/src/geant4/source/interfaces/basic/include -I/home/shogun/geant2/src/geant4/source/interfaces/common/include -I/home/shogun/geant2/src/geant4/source/interfaces/GAG/include -DG4UI_USE_TERMINAL -DG4UI_USE_TCSH -I/include -I/usr/include/X11/extensions -I/usr/include/X11 -c global/src/TG4G3ControlVector.cxx -o /home/shogun/geant2/geant4_vmc/source/../tmp/tgt_linux/global/src/TG4G3ControlVector.o
In file included from global/include/TG4G3ControlVector.h:20,
                 from global/src/TG4G3ControlVector.cxx:17:
global/include/TG4Globals.h:25:21: error: TString.h: No such file or directory
In file included from global/include/TG4G3ControlVector.h:20,
                 from global/src/TG4G3ControlVector.cxx:17:
global/include/TG4Globals.h:76: error: expected `,' or `...' before `&' token
global/include/TG4Globals.h:77: error: ISO C++ forbids declaration of `TString' with no type
global/include/TG4Globals.h:81: error: expected `,' or `...' before `&' token
global/include/TG4Globals.h:82: error: ISO C++ forbids declaration of `TString' with no type
global/include/TG4Globals.h:86: error: `TString' does not name a type
global/include/TG4Globals.h:92: error: `Int_t' has not been declared
global/include/TG4Globals.h:92: error: expected `,' or `...' before `&' token
global/include/TG4Globals.h:92: error: ISO C++ forbids declaration of `TString' with no type
global/include/TG4Globals.h:97: error: `TString' does not name a type
global/include/TG4Globals.h:103: error: `TString' does not name a type
global/src/TG4G3ControlVector.cxx: In member function `TG4G3ControlValue TG4G3ControlVector::operator[](G4int) const':
global/src/TG4G3ControlVector.cxx:94: error: no matching function for call to `TG4Globals::Exception(const char [19], const char [11], const char [30])'
global/include/TG4Globals.h:77: note: candidates are: static void TG4Globals::Exception(int)
global/src/TG4G3ControlVector.cxx: In member function `G4bool TG4G3ControlVector::SetControl(TG4G3Control, TG4G3ControlValue, TG4G3CutVector&)':
global/src/TG4G3ControlVector.cxx:213: error: no matching function for call to `TG4Globals::Warning(const char [10], const char [13], const char [31])'
global/include/TG4Globals.h:82: note: candidates are: static void TG4Globals::Warning(int)
/home/shogun/geant2/include/CLHEP/Units/PhysicalConstants.h: At global scope:
/home/shogun/geant2/include/CLHEP/Units/PhysicalConstants.h:78: warning: `CLHEP::electron_charge' defined but not used
/home/shogun/geant2/include/CLHEP/Random/Randomize.h:67: warning: `CLHEP::HepRandomGenActive' defined but not used
make: *** [/home/shogun/geant2/geant4_vmc/source/../tmp/tgt_linux/global/src/TG4G3ControlVector.o] Error 1

I’m working on a i686 family, running suse 10.3 with gcc 4.2.1

Thanks for your help,

Fred

The problem is that when ROOTSYS environment variable is set,
the root includes are expected in $ROOTSYS/include (as this is where
the include files are put when you build Root with ROOTSYS set)
and the output from root-config is ignored.
It should be enough just to unset ROOTSYS environment variable
and compilation should work. Let me know.

Ivana