Installation of Garfield++

When I install garfield++ on my SLC6 PC (not CERN account), should I use both:
cd $GARFIELD_HOME; make
and
cd $GARFIELD_HOME/build; cmake $GARFIELD_HOME; make; make install?
The garfield++ website says that cmake is the alternative way to build library. So I assume it’s not necessary. But if I don’t use cmake, I get compiler errors when I try to build GarfRoot. If I use both, then GarfRoot can be built and run, but it always crashes when I use .q to quit it. So I feel really confused whether I install garfield++ properly. Can anyone clarify it? Thank you very much!

Hi.

I also tried to install GarfRoot with the latest ROOT package and failed.
When I used garfield++ revision 293 from svn, it worked with ROOT 5.30.

Thanks geniejhyang! So you don’t have to use cmake?
What is your gcc version?

I tried revision 293 and ROOT 5.30/06, SLC 6 gcc 4.4.7, now I can’t compile any example code and always get compile errors. Here’s the error message from compiling GarfRoot. Can anyone tell me what possibly went wrong? Is the libGarfield.a generated improperly?

/home/sebqian/garfieldpp/Library/libGarfield.a(GeometryRoot.o): In function Garfield::GeometryRoot::GetMedium(double, double, double, Garfield::Medium*&)': GeometryRoot.cc:(.text+0x659): undefined reference toTGeoVolume::DummyMedium()’
/home/sebqian/garfieldpp/Library/libGarfield.a(PlottingEngineRoot.o): In function Garfield::PlottingEngineRoot::SetDefaultStyle()': PlottingEngineRoot.cc:(.text+0x2cc): undefined reference toTStyle::SetPalette(int, int*, float)’
/home/sebqian/garfieldpp/Library/libGarfield.a(ViewFEMesh.o): In function Garfield::ViewFEMesh::DrawElements()': ViewFEMesh.cc:(.text+0x81de): undefined reference toTMatrixT::NaNValue()‘
ViewFEMesh.cc:(.text+0x822b): undefined reference to TMatrixT<double>::NaNValue()' ViewFEMesh.cc:(.text+0x8273): undefined reference toTMatrixT::NaNValue()‘
ViewFEMesh.cc:(.text+0x82be): undefined reference to TMatrixT<double>::NaNValue()' ViewFEMesh.cc:(.text+0x830b): undefined reference toTMatrixT::NaNValue()’
/home/sebqian/garfieldpp/Library/l/ibGarfield.a(ViewFEMesh.o):ViewFEMesh.cc:(.text+0x8356): more undefined references to TMatrixT<double>::NaNValue()' follow /home/sebqian/garfieldpp/Library/libGarfield.a(GarfieldDict.o): In functionglobal constructors keyed to GarfieldDict.C’:
GarfieldDict.C:(.text+0x751ca): undefined reference to `ROOT::RegisterModule()'
collect2: ld returned 1 exit status
make: *** [garfroot] Error 1

I’m sorry for late reply.
I’m using SL6.3 with gcc 4.4.6.
Hmm. That’s odd.

Hi,

This is the ROOT forum, not a Garfield forum - you are probably better off contacting the authors of Garfield.

Cheers, Axel.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.