[ROOT] isnan, finite, Geant4 and ROOT

From: Isidro.Gonzalez.Caballero@cern.ch
Date: Tue Jul 23 2002 - 10:15:35 MEST


Hi Rooters,
	I have seen several reports on problems compiling Geant4 and Root
with isnan and finite (I even set one sometime ago a believe). I solved
this some time ago by removing (-ansi -pedantic) flags from the
compilation. I am now with Geant4.4.1 and ROOT 3/03/07 compiled under a
RH7.1 linux box with gcc 2.95.3 (I installed it locally myself). I have
this application which mixes both, and I get the following error messages
(full compilation command is also given):

----------------
g++ -Wall -ansi -pedantic -pipe -fno-for-scope -DGNU_GCC -O -fPIC
-I/home/iglez2/rootgcc95/include -DG4OPTIMISE -DG4USE_STL -Iinclude
-I/home/iglez2/lhcxx/specific/@sys/CLHEP/1.8.0.0/include
-DG4USE_STD_NAMESPACE -DG4VERBOSE -DG4_STORE_TRAJECTORY
-I/home/iglez2/geant4/geant4.4.1/source/interfaces/basic/include
-I/home/iglez2/geant4/geant4.4.1/source/interfaces/common/include
-I/home/iglez2/geant4/geant4.4.1/source/interfaces/GAG/include
-DG4UI_USE_TERMINAL -DG4VIS_USE_DAWNFILE
-I/home/iglez2/geant4/geant4.4.1/source/visualization/FukuiRenderer/include
-DG4VIS_USE_HEPREPFILE
-I/home/iglez2/geant4/geant4.4.1/source/visualization/HepRep/include
-DG4VIS_USE_RAYTRACER
-I/home/iglez2/geant4/geant4.4.1/source/visualization/RayTracer/include
-DG4VIS_USE_VRMLFILE
-I/home/iglez2/geant4/geant4.4.1/source/visualization/VRML/include
-DG4VIS_USE_ASCIITREE -DG4VIS_USE_GAGTREE
-I/home/iglez2/geant4/geant4.4.1/source/visualization/Tree/include
-DG4VIS_USE -DG4_SOLVE_VIS_TEMPLATES
-I/home/iglez2/geant4/geant4.4.1/source/visualization/management/include
-I/home/iglez2/geant4/geant4.4.1/source/visualization/modeling/include
-I/home/iglez2/geant4/geant4.4.1/source/global/management/include
-I/home/iglez2/geant4/geant4.4.1/source/global/HEPRandom/include
-I/home/iglez2/geant4/geant4.4.1/source/global/HEPGeometry/include
-I/home/iglez2/geant4/geant4.4.1/source/global/HEPNumerics/include
-I/home/iglez2/geant4/geant4.4.1/source/run/include
-I/home/iglez2/geant4/geant4.4.1/source/materials/include
-I/home/iglez2/geant4/geant4.4.1/source/parameterisations/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/management/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/bosons/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/leptons/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/hadrons/barions/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/hadrons/ions/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/hadrons/mesons/include
-I/home/iglez2/geant4/geant4.4.1/source/particles/shortlived/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/management/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/general/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/decay/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/optical/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/transportation/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/parameterisation/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/photolepton_hadron/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/electromagnetic/standard/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/electromagnetic/muons/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/electromagnetic/utils/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/electromagnetic/xrays/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/electromagnetic/lowenergy/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/management/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/processes/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/util/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/cross_sections/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/cascade/evaporation/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/cascade/utils/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/coherent_elastic/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/chiral_inv_phase_space/body/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/chiral_inv_phase_space/interface/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/de_excitation/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/diffractive_string/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/high_energy/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/kinetic_model/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/management/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/pre_equilibrium/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/quark_gluon_string/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/string_common/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/string_fragmentation/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/generator/util/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/high_energy/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/low_energy/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/neutron_hp/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/isotope_production/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/radiative_decay/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/models/leading_particle/include
-I/home/iglez2/geant4/geant4.4.1/source/processes/hadronic/stopping/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/management/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/CSG/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/specific/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/BREPS/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/Boolean/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/STEP/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/solids/STEPinterface/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/volumes/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/verification/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/magneticfield/include
-I/home/iglez2/geant4/geant4.4.1/source/geometry/biasing/include
-I/home/iglez2/geant4/geant4.4.1/source/track/include
-I/home/iglez2/geant4/geant4.4.1/source/tracking/include
-I/home/iglez2/geant4/geant4.4.1/source/digits+hits/detector/include
-I/home/iglez2/geant4/geant4.4.1/source/digits+hits/hits/include
-I/home/iglez2/geant4/geant4.4.1/source/digits+hits/digits/include
-I/home/iglez2/geant4/geant4.4.1/source/readout/include
-I/home/iglez2/geant4/geant4.4.1/source/event/include
-I/home/iglez2/geant4/geant4.4.1/source/graphics_reps/include
-I/home/iglez2/geant4/geant4.4.1/source/interco ms/include
-I/home/iglez2/geant4/geant4.4.1/source/g3tog4/include -c -o
/home/iglez2/benchmarks/proton/Gheisha/tmp/Linux-g++/alice/AliEventAction.o
src/AliEventAction.cc

In file included from /home/iglez2/rootgcc95/include/TObject.h:188,
                 from /home/iglez2/rootgcc95/include/TNamed.h:26,
                 from /home/iglez2/rootgcc95/include/TDirectory.h:25,
                 from /home/iglez2/rootgcc95/include/TFile.h:25,
                 from src/AliEventAction.cc:33:
/home/iglez2/rootgcc95/include/TBuffer.h:421: warning: carriage return in preprocessing directive
/home/iglez2/rootgcc95/include/TBuffer.h:423: warning: carriage return in preprocessing directive
In file included from /home/iglez2/rootgcc95/include/TArrayD.h:25,
                 from /home/iglez2/rootgcc95/include/TTree.h:63,
                 from src/AliEventAction.cc:34:
/home/iglez2/rootgcc95/include/TArray.h:71: warning: carriage return in preprocessing directive
/home/iglez2/rootgcc95/include/TArray.h:73: warning: carriage return in preprocessing directive
In file included from /home/iglez2/rootgcc95/include/TTree.h:63,
                 from src/AliEventAction.cc:34:
/home/iglez2/rootgcc95/include/TArrayD.h:70: warning: carriage return in preprocessing directive
/home/iglez2/rootgcc95/include/TArrayD.h:72: warning: carriage return in preprocessing directive
In file included from /home/iglez2/rootgcc95/include/TTree.h:67,
                 from src/AliEventAction.cc:34:
/home/iglez2/rootgcc95/include/TArrayI.h:70: warning: carriage return in preprocessing directive
/home/iglez2/rootgcc95/include/TArrayI.h:72: warning: carriage return in preprocessing directive
In file included from /home/iglez2/rootgcc95/include/TString.h:31,
                 from /home/iglez2/rootgcc95/include/TCollection.h:34,
                 from /home/iglez2/rootgcc95/include/TSeqCollection.h:26,
                 from /home/iglez2/rootgcc95/include/TList.h:26,
                 from /home/iglez2/rootgcc95/include/TNamed.h:29,
                 from /home/iglez2/rootgcc95/include/TDirectory.h:25,
                 from /home/iglez2/rootgcc95/include/TFile.h:25,
                 from src/AliEventAction.cc:33:
/home/iglez2/rootgcc95/include/TMath.h: In function `static Int_t TMath::Finite(double)':
/home/iglez2/rootgcc95/include/TMath.h:403: `finite' undeclared (first use this function)
/home/iglez2/rootgcc95/include/TMath.h:403: (Each undeclared identifier is reported only once
/home/iglez2/rootgcc95/include/TMath.h:403: for each function it appears in.)
/home/iglez2/rootgcc95/include/TMath.h:403: warning: control reaches end of non-void function `TMath::Finite(double)'
/home/iglez2/rootgcc95/include/TMath.h: In function `static Int_t TMath::IsNaN(double)':
/home/iglez2/rootgcc95/include/TMath.h:407: `isnan' undeclared (first use this function)
/home/iglez2/rootgcc95/include/TMath.h:407: warning: control reaches end of non-void function `TMath::IsNaN(double)'
src/AliEventAction.cc: In method `void AliEventAction::CalculateFragmentTotals(const G4Track &)':
src/AliEventAction.cc:218: warning: assignment to `G4int' from `double'
gmake: *** [/home/iglez2/benchmarks/proton/Gheisha/tmp/Linux-g++/alice/AliEventAction.o] Error 1
---------------------

Any idea on how to solve it without removing -ansi -pedantic?

Thankyou very much for your help,

	
		Isidro

+---------------------------+--------------------------------+
| Isidro González Caballero | mailto:Isidro.Gonzalez@cern.ch |
| CERN-EP / Mailbox: F28010 | http://home.cern.ch/~iglez/    |
| 1211 Geneva 23            |               -o-              |
| Switzerland               | Tel: +41 22 76 73060, 73316    |
+---------------------------+--------------------------------+



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:00 MET