# Installation of Garfield++

**URL:** <https://root-forum.cern.ch/t/installation-of-garfield/18710>\
**Category:** Garfield++\
**Created:** [January 19, 2015, 11:47pm UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710 "2015-01-19T23:47:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebqian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@sebqian](https://root-forum.cern.ch/u/sebqian)\
**Post date:** [January 19, 2015, 11:47pm UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/1 "2015-01-19T23:47:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![geniejhang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/ee7513/32.png) [@geniejhang](https://root-forum.cern.ch/u/geniejhang)\
**Post date:** [January 20, 2015, 6:52am UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/2 "2015-01-20T06:52:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sebqian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@sebqian](https://root-forum.cern.ch/u/sebqian)\
**Post date:** [January 20, 2015, 11:46pm UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/3 "2015-01-20T23:46:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sebqian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@sebqian](https://root-forum.cern.ch/u/sebqian)\
**Post date:** [January 23, 2015, 8:17pm UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/4 "2015-01-23T20:17:38Z")

</div>

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 to`TGeoVolume::DummyMedium()’  
/home/sebqian/garfieldpp/Library/libGarfield.a(PlottingEngineRoot.o): In function `Garfield::PlottingEngineRoot::SetDefaultStyle()': PlottingEngineRoot.cc:(.text+0x2cc): undefined reference to`TStyle::SetPalette(int, int\*, float)’  
/home/sebqian/garfieldpp/Library/libGarfield.a(ViewFEMesh.o): In function `Garfield::ViewFEMesh::DrawElements()': ViewFEMesh.cc:(.text+0x81de): undefined reference to`TMatrixT::NaNValue()‘  
[ViewFEMesh.cc](http://ViewFEMesh.cc):(.text+0x822b): undefined reference to `TMatrixT<double>::NaNValue()' ViewFEMesh.cc:(.text+0x8273): undefined reference to`TMatrixT::NaNValue()‘  
[ViewFEMesh.cc](http://ViewFEMesh.cc):(.text+0x82be): undefined reference to `TMatrixT<double>::NaNValue()' ViewFEMesh.cc:(.text+0x830b): undefined reference to`TMatrixT::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 function`global constructors keyed to GarfieldDict.C’:  
GarfieldDict.C:(.text+0x751ca): undefined reference to `ROOT::RegisterModule()'  
collect2: ld returned 1 exit status  
make: \*\*\* [garfroot] Error 1

---

<div class="post-metadata">

**Author:** ![geniejhang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/ee7513/32.png) [@geniejhang](https://root-forum.cern.ch/u/geniejhang)\
**Post date:** [February 15, 2015, 11:21am UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/5 "2015-02-15T11:21:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [February 15, 2015, 3:38pm UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/6 "2015-02-15T15:38:52Z")

</div>

Hi,

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

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [June 21, 2018, 11:41am UTC](https://root-forum.cern.ch/t/installation-of-garfield/18710/7 "2018-06-21T11:41:00Z")

</div>

Closed on June 21, 2018, 11:41am UTC

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