# Garfield installation issue

**URL:** <https://root-forum.cern.ch/t/garfield-installation-issue/42604>\
**Category:** Garfield++\
**Created:** [December 5, 2020, 5:39am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604 "2020-12-05T05:39:38Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 27, 2020, 10:49am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/41 "2020-12-27T10:49:51Z")

</div>

You need to type `git pull` in the directory to which you git cloned the Garfield++ repository. In your case that’s `/home/ahmer/Desktop/garfield-v2` not `/home/ahmer/Desktop/garfield` (I don’t know why you did it like that).

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 2:40am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/42 "2020-12-28T02:40:14Z")

</div>

yes yes sorry i was confused yesterday.

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 2:42am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/43 "2020-12-28T02:42:46Z")

</div>

i was trying to tell qurat-ul-ain zahoor which also asking for the garfield installation gudance. i was trying to tell in our own lamguage little bit. and tar file of garfield we have to un tar it after that we have to do this process. am i right?

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 5:45am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/44 "2020-12-28T05:45:07Z")

</div>

dear i think there is any issue its not working. see!!

 ![Screenshot from 2020-12-28 10-42-46](https://root-forum.cern.ch/uploads/default/original/3X/3/d/3d2dc6951dceb890d2a5be8b31b0e0b8b1aec6a1.jpeg)

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 28, 2020, 6:36am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/45 "2020-12-28T06:36:30Z")

</div>

Your clone of the Garfield++ repository is in `/home/ahmer/Desktop/garfield-v2`. So:

```auto
cd /home/ahmer/Desktop/garfield-v2
git pull

```

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 28, 2020, 6:40am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/46 "2020-12-28T06:40:04Z")

</div>

You do **not** need any tar file to install Garfield++!

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 8:11am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/47 "2020-12-28T08:11:38Z")

</div>

but i used and untar it in the /home/ahmer/Desktop/garfield. is there any issue?

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 8:19am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/48 "2020-12-28T08:19:37Z")

</div>

yes i did it…

 ![Screenshot from 2020-12-28 13-15-12](https://root-forum.cern.ch/uploads/default/original/3X/7/b/7bac594241be5fc45602911f71cb40e441ed4234.png)  
now again in the /home/ahmer/Desktop/garfield  
mkdir build  
cd build  
source thisroot.sh  
cmake  
make  
like this?

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 28, 2020, 9:58am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/49 "2020-12-28T09:58:40Z")

</div>

As I said in my first reply, the file `garfield-v2.tar.gz` has nothing to do with Garfield++ and is of no use for building or running Garfield++.

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 2:29pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/50 "2020-12-28T14:29:25Z")

</div>

ok dear i understand. now i have to make build directory in garfield-v2 and cmake, make and make install in this?

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 28, 2020, 2:45pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/51 "2020-12-28T14:45:15Z")

</div>

Dear i have mkdir in the garfield-v2. and cmake, make, and make install. all this and i’m here now. is it ok?  
installation complete? anything else to do?

 ![Screenshot from 2020-12-28 19-42-25](https://root-forum.cern.ch/uploads/default/original/3X/c/c/cc3e87fe8b81535fa3f54c6bdd21310f752d6f0f.jpeg) ![Screenshot from 2020-12-28 19-42-48](https://root-forum.cern.ch/uploads/default/original/3X/3/a/3a138fba7052fd342e2e6d514e04ab44e561cf14.jpeg)

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 28, 2020, 4:48pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/52 "2020-12-28T16:48:45Z")

</div>

Looks good!

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 29, 2020, 4:56am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/53 "2020-12-29T04:56:38Z")

</div>

i want to ask one more thing my head asked me to do cmake with full examples and docs on but the program was giving errors and i have done it with just cmake $GARFIELD\_HOME. can you see what the issue or can i resolve it?

 ![Screenshot from 2020-12-29 09-53-33](https://root-forum.cern.ch/uploads/default/original/3X/0/9/09770cb0ce31bd304b909c159785690a9254f875.jpeg)

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 29, 2020, 4:59am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/54 "2020-12-29T04:59:32Z")

</div>

solution that i told you better understanding do not use the tar file etc. just make a directory and git clone command and when its done follow the procedure as hschindl told us. and you can see mine questions and issues as i discussed with hschindl.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 29, 2020, 2:46pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/55 "2020-12-29T14:46:49Z")

</div>

Building the examples is switched on by default, so just typing

```auto
cmake $GARFIELD_HOME

```

as you did is fine.

PS: the square brackets in `cmake [-DCMAKE_INSTALL_PREFIX=...]` and so on indicate optional arguments. So you would have to remove the square brackets (`[]`) when you type the command.

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 29, 2020, 4:32pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/56 "2020-12-29T16:32:35Z")

</div>

ok ok thanks a lot hschindl. i’m really very sorry that i have very much disturb you. thanks a lot. and what you think as i typed the command line which represents the paths about the geant4.sh. is it interface with the geant4 or not?

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [December 31, 2020, 7:00am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/57 "2020-12-31T07:00:21Z")

</div>

i have tried to run the geant4garfieldinterface example and its giving errors during the cmake can i get some help?

 ![Screenshot from 2020-12-31 11-38-10](https://root-forum.cern.ch/uploads/default/original/3X/9/a/9af36f6f0c820e2d2aecc27db8257e9c6c109900.jpeg)

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 1, 2021, 6:17pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/58 "2021-01-01T18:17:52Z")

</div>

Hello @ahmer_k,

It seems that the Garfield header directory is not part of the compiler search path. Please, check the CMake configuration log (the output of the `cmake` command) to see any relevant error/warning messages, e.g. `Cannot find Garfield package` or so.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [January 1, 2021, 6:43pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/59 "2021-01-01T18:43:48Z")

</div>

Is it possible that you forgot to source the `setup.sh` script in the Garfield++ build folder?  
Can you type ` echo $CMAKE_PREFIX_PATH` and see if it includes the Garfield++ install directory?

---

<div class="post-metadata">

**Author:** ![ahmer\_k](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ahmer_k/32/24214_2.png) [@ahmer\_k](https://root-forum.cern.ch/u/ahmer_k)\
**Post date:** [January 3, 2021, 3:55am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/60 "2021-01-03T03:55:12Z")

</div>

ok dear thanks for your time. i’ll check.

[Previous page](https://root-forum.cern.ch/t/garfield-installation-issue/42604.md?page=2)

[Next page](https://root-forum.cern.ch/t/garfield-installation-issue/42604.md?page=4)
