# Garfield ++ example

**URL:** <https://root-forum.cern.ch/t/garfield-example/40834>\
**Category:** Garfield++\
**Created:** [August 5, 2020, 2:26am UTC](https://root-forum.cern.ch/t/garfield-example/40834 "2020-08-05T02:26:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Afzaal786](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/afzaal786/32/20527_2.png) [@Afzaal786](https://root-forum.cern.ch/u/Afzaal786)\
**Post date:** [August 5, 2020, 2:26am UTC](https://root-forum.cern.ch/t/garfield-example/40834/1 "2020-08-05T02:26:55Z")

</div>

Hi i installed Garfield using the link  
[http://garfieldpp.web.cern.ch/garfieldpp/getting-started/](http://garfieldpp.web.cern.ch/garfieldpp/getting-started/)  
Now i am trying to run Gem example using the same link  
At the very last step i got this error(see screenshot)

 ![Screenshot from 2020-08-05 07-21-00](https://root-forum.cern.ch/uploads/default/original/3X/5/5/5565135235823ca20e92a1b4436480f4dc17e439.png)

---

<div class="post-metadata">

**Author:** ![Khang\_Pham](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/khang_pham/32/19369_2.png) [@Khang\_Pham](https://root-forum.cern.ch/u/Khang_Pham)\
**Post date:** [August 5, 2020, 5:00am UTC](https://root-forum.cern.ch/t/garfield-example/40834/2 "2020-08-05T05:00:31Z")

</div>

After the cmake command, did you do make? Type make after you do cmake. It looks like you just did cmake and then called the gem executable, but that doesn’t exist until after the make command.

---

<div class="post-metadata">

**Author:** ![Afzaal786](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/afzaal786/32/20527_2.png) [@Afzaal786](https://root-forum.cern.ch/u/Afzaal786)\
**Post date:** [August 6, 2020, 2:11am UTC](https://root-forum.cern.ch/t/garfield-example/40834/3 "2020-08-06T02:11:02Z")

</div>

When i typed make command after cmake command than a fatal error occurred(see screenshot).

 ![Screenshot from 2020-08-06 07-07-58](https://root-forum.cern.ch/uploads/default/original/3X/1/b/1b411aecc6d3d95c096e23778cec584bba53e415.png)

---

<div class="post-metadata">

**Author:** ![Khang\_Pham](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/khang_pham/32/19369_2.png) [@Khang\_Pham](https://root-forum.cern.ch/u/Khang_Pham)\
**Post date:** [August 6, 2020, 1:27pm UTC](https://root-forum.cern.ch/t/garfield-example/40834/4 "2020-08-06T13:27:32Z")

</div>

I also encountered this problem in the past, but I am not sure if what you are experiencing is the same as what I did. For my case, it seemed like Garfield was having problems looking for ROOT libraries, so I needed to add a couple of things when I run CMake (btw, this is the instruction that I followed to install Garfield – [http://garfieldpp.web.cern.ch/garfieldpp/getting-started/](http://garfieldpp.web.cern.ch/garfieldpp/getting-started/)). On the instruction page, when you run CMake, the command that is provided is:

```auto
cmake [-DCMAKE_INSTALL_PREFIX=<installdir>] [-DWITH_DOCS=ON] [-DWITH_EXAMPLES=ON] $GARFIELD_HOME

```

For my case, I used that with two extra options:

```auto
cmake -DCMAKE_INSTALL_PREFIX=/home/khang/garfield/install -DWITH_DOCS=ON -DWITH_EXAMPLES=ON -DROOT_INSTALL_DIR=/home/khang/Cern_Root/root-6.20.02/root-install/include -DROOT_LIBRARY_DIR=/home/khang/Cern_Root/root-6.20.02/root-install/lib $GARFIELD_HOME

```

This fixes my problem at the time and I haven’t encountered this specific problem anymore after that.

---

<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:** [August 11, 2020, 8:10pm UTC](https://root-forum.cern.ch/t/garfield-example/40834/5 "2020-08-11T20:10:28Z")

</div>

Hi,  
I understood from this thread that your problem has been solved?

> [@Garfield++ Installation](https://root-forum.cern.ch/t/garfield-installation/40820/20):
>
> Thank you very much mato! Your responses really helped me a lot. I executed all commands that you told successfully (hope this time ROOT is properly installed). Cheers

---

<div class="post-metadata">

**Author:** ![Afzaal786](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/afzaal786/32/20527_2.png) [@Afzaal786](https://root-forum.cern.ch/u/Afzaal786)\
**Post date:** [August 12, 2020, 10:22am UTC](https://root-forum.cern.ch/t/garfield-example/40834/6 "2020-08-12T10:22:08Z")

</div>

Yes It is solved

---

<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:** [August 26, 2020, 10:22am UTC](https://root-forum.cern.ch/t/garfield-example/40834/7 "2020-08-26T10:22:16Z")

</div>

Closed on August 26, 2020, 10:22am UTC

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