# 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:** 1

<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 5, 2020, 5:39am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/1 "2020-12-05T05:39:38Z")

</div>

i’m installing garfield and during that installation i’m having troubled during this. any one help for its installation. thanks for your time.

 ![Screenshot from 2020-12-05 10-37-43](https://root-forum.cern.ch/uploads/default/original/3X/2/a/2a449bc639d2286f636155e845fa49d7a7158bcf.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 5, 2020, 11:01am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/2 "2020-12-05T11:01:49Z")

</div>

Hi,  
as you can see from the error message, cloning the git repository didn’t work because the directory `~/Desktop/garfield` is not empty.

Which is true because you have an archive `garfield-v2.tar.gz` there, which seems to contain the source code for a [different software](https://www.ebi.ac.uk/birney-srv/GARFIELD/) which is also called Garfield but has nothing to do with [Garfield++](https://garfieldpp.web.cern.ch/garfieldpp/).

Can you make sure the directory `~/Desktop/garfield` is empty and try again? Or use a different destination path in `git clone`?

---

<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 7, 2020, 2:30pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/3 "2020-12-07T14:30:42Z")

</div>

thanks dear i’ll try. and thanks for your time too.

---

<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 7, 2020, 3:03pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/4 "2020-12-07T15:03:37Z")

</div>

hschindl what to do next after the completing this git clone downloading?

---

<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 7, 2020, 5:33pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/5 "2020-12-07T17:33:28Z")

</div>

You can find instructions here (“Building the project”)

> **[README.md · master · garfield / garfieldpp](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/README.md)**
>
> http://garfieldpp.web.cern.ch/garfieldpp/

or here (“Building the project from source”):

> **[Garfield++](https://garfieldpp.web.cern.ch/garfieldpp/getting-started/)**

---

<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 13, 2020, 6:50am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/6 "2020-12-13T06:50:28Z")

</div>

thanks dear for your instructions and time but now i’m getting this.

 ![Screenshot from 2020-12-13 11-49-28](https://root-forum.cern.ch/uploads/default/original/3X/7/a/7a83fb37377de81b655dd0cc0a3b0cd16a034eb1.png)

---

<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 13, 2020, 6:51am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/7 "2020-12-13T06:51:02Z")

</div>

check if anyone can help.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 13, 2020, 9:41am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/8 "2020-12-13T09:41:12Z")

</div>

> [@Fatal error when trying to run the Gem example](https://root-forum.cern.ch/t/fatal-error-when-trying-to-run-the-gem-example/39995/7):
>
> Below, you can find simple instructions on how to build Garfield++ (with examples) from scratch. Try (in case of problems, inspect the three created “\*.out.txt” files): # ... assuming you are using a bash like shell ... source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT export GARFIELD\_HOME=${PWD}/garfieldpp # where to build Garfield++ rm -rf ${GARFIELD\_HOME} # make sure you start with an empty directory git clone --depth=1 https://gitlab.cern.ch/garfield/garfieldpp.git ${GARFIEL…

---

<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 13, 2020, 9:53am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/9 "2020-12-13T09:53:39Z")

</div>

Hi,  
the square brackets are meant to indicate optional arguments. If you are happy with the default settings you can just type:  
`cmake $GARFIELD_HOME`

---

<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 13, 2020, 10:05am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/10 "2020-12-13T10:05:49Z")

</div>

One more thing: from what I can see in the screenshot you sent, you set the environment variable `$GARFIELD_HOME` to `/home/ahmer/Desktop/garfield`, but then you cloned the repository to `/home/ahmer/Desktop/garfield/garfield-2` and created your `build` directory in `/home/ahmer/Desktop/garfield`. I’m not sure if this is what you intended to do, but if it is, you need to modify the argument of the `cmake` command:

`cmake /home/ahmer/Desktop/garfield/garfield-2`

---

<div class="post-metadata">

**Author:** ![Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/qurat-ul-ain_zahoor/32/24341_2.png) [@Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/u/Qurat-ul-Ain_Zahoor)\
**Post date:** [December 17, 2020, 11:15am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/11 "2020-12-17T11:15:20Z")

</div>

can u tell me that what is the procedure to install garfield++. i want to install it on my laptop .kindly help me

---

<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 17, 2020, 11:27am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/12 "2020-12-17T11:27:10Z")

</div>

> **[Garfield++](https://garfieldpp.web.cern.ch/garfieldpp/getting-started/)**

or

> **[README.md · master · garfield / garfieldpp](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/README.md)**
>
> http://garfieldpp.web.cern.ch/garfieldpp/

---

<div class="post-metadata">

**Author:** ![Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/qurat-ul-ain_zahoor/32/24341_2.png) [@Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/u/Qurat-ul-Ain_Zahoor)\
**Post date:** [December 19, 2020, 10:56am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/13 "2020-12-19T10:56:47Z")

</div>

hi i also wants to download garfield ++ for simulation.can u please guide me that how to install it the procedure that will help me  
it would be a great favour for me  
thanks

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 19, 2020, 10:58am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/14 "2020-12-19T10:58:32Z")

</div>

> [@Fatal error when trying to run the Gem example](https://root-forum.cern.ch/t/fatal-error-when-trying-to-run-the-gem-example/39995/7):
>
> Below, you can find simple instructions on how to build Garfield++ (with examples) from scratch. Try (in case of problems, inspect the three created “\*.out.txt” files): # ... assuming you are using a bash like shell ... source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT export GARFIELD\_HOME=${PWD}/garfieldpp # where to build Garfield++ rm -rf ${GARFIELD\_HOME} # make sure you start with an empty directory git clone --depth=1 https://gitlab.cern.ch/garfield/garfieldpp.git ${GARFIEL…

---

<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 19, 2020, 6:56pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/15 "2020-12-19T18:56:54Z")

</div>

Hi,  
did you try the installation instructions on the website (links posted above)?

---

<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 21, 2020, 9:59am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/16 "2020-12-21T09:59:44Z")

</div>

yes but i make the garfield-2 because of error to cloned it. and by following to paper you sent to me i make the directory build in 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 21, 2020, 10:04am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/17 "2020-12-21T10:04:06Z")

</div>

i’m getting this error.

 ![Screenshot from 2020-12-21 20-02-29](https://root-forum.cern.ch/uploads/default/original/3X/9/a/9a5cc8f03fef46f7a438d6126289aee42f4205a3.png)

---

<div class="post-metadata">

**Author:** ![Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/qurat-ul-ain_zahoor/32/24341_2.png) [@Qurat-ul-Ain\_Zahoor](https://root-forum.cern.ch/u/Qurat-ul-Ain_Zahoor)\
**Post date:** [December 21, 2020, 10:37am UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/18 "2020-12-21T10:37:07Z")

</div>

yes i have and aldo install root file cmake .kindly tell me how to install it and how to properly do procedures

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 21, 2020, 12:21pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/19 "2020-12-21T12:21:27Z")

</div>

> [@Fatal error when trying to run the Gem example](https://root-forum.cern.ch/t/fatal-error-when-trying-to-run-the-gem-example/39995/7):
>
> Below, you can find simple instructions on how to build Garfield++ (with examples) from scratch. Try (in case of problems, inspect the three created “\*.out.txt” files): # ... assuming you are using a bash like shell ... source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT export GARFIELD\_HOME=${PWD}/garfieldpp # where to build Garfield++ rm -rf ${GARFIELD\_HOME} # make sure you start with an empty directory git clone --depth=1 https://gitlab.cern.ch/garfield/garfieldpp.git ${GARFIEL…

---

<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 21, 2020, 9:57pm UTC](https://root-forum.cern.ch/t/garfield-installation-issue/42604/20 "2020-12-21T21:57:28Z")

</div>

Ok, so you cloned the repository to the directory `/home/ahmer/Desktop/garfield/garfield/garfield-2`. If that is what you want, please do the following:

1. Source the `thisroot.sh` script. I’m assuming your root installation is located in `/home/ahmer/Desktop/root`. If this is not the case, please adapt the path accordingly.  
`source /home/ahmer/Desktop/root/bin/thisroot.sh`
2. Set the environment variable `GARFIELD_HOME` to point to the directory that contains the Garfield++ source tree.  
`export GARFIELD_HOME=/home/ahmer/Desktop/garfield/garfield/garfield-2`
3. Follow the usual instructions for building the project:

```auto
cd $GARFIELD_HOME
mkdir build
cd build
cmake ..
make
make install
. $GARFIELD_HOME/build/setup.sh

```

Or maybe you’d prefer your Garfield++ source directory to be `/home/ahmer/Desktop/garfield` (which I think is what you wanted in the first place)? Then please first clean out `/home/ahmer/Desktop/garfield`:

```auto
rm -rf /home/ahmer/Desktop/garfield/Build
rm -rf /home/ahmer/Desktop/garfield/garfield
rm -rf /home/ahmer/Desktop/garfield-2
rm -rf /home/ahmer/Desktop/garfield-v2
rm /home/ahmer/Desktop/garfield-v2.tar.gz

```

Then redo the `git clone` step

```auto
git clone https://gitlab.cern.ch/garfield/garfieldpp.git $GARFIELD_HOME

```

and follow the standard installation instructions.

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