# Installing Garfield++

**URL:** <https://root-forum.cern.ch/t/installing-garfield/52065>\
**Category:** Garfield++\
**Created:** [October 23, 2022, 10:26pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065 "2022-10-23T22:26:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sarah/32/34502_2.png) [@sarah](https://root-forum.cern.ch/u/sarah)\
**Post date:** [October 23, 2022, 10:26pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/1 "2022-10-23T22:26:35Z")

</div>

Hello everyone, I’m trying to install garfield++ on ubuntu but this error keeps coming up

CMake Error at CMakeLists.txt:77 (include):  
include could not find load file:

```
/home/sarah/products/Root/modules/RootNewMacros.cmake

```

– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)  
– Found GSL: /usr/include (found version “2.4”)  
– Found OpenMP\_CXX: -fopenmp (found version “4.5”)  
– Found OpenMP\_Fortran: -fopenmp (found version “4.5”)  
– Found OpenMP: TRUE (found version “4.5”)  
– Creating a new library named magboltz with API version 11  
CMake Error at CMakeLists.txt:184 (root\_generate\_dictionary):  
Unknown CMake command “root\_generate\_dictionary”.

– Configuring incomplete, errors occurred!  
See also “/home/sarah/Documents/garfield/build/CMakeFiles/CMakeOutput.log”.

how to fix it please ?  
thank you so much in advance.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 25, 2022, 9:22am UTC](https://root-forum.cern.ch/t/installing-garfield/52065/2 "2022-10-25T09:22:21Z")

</div>

Welcome to the ROOT forum  
@hschindl might help you.

---

<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:** [October 25, 2022, 9:39am UTC](https://root-forum.cern.ch/t/installing-garfield/52065/3 "2022-10-25T09:39:53Z")

</div>

Maybe @mato or @caiazza can help? Or a ROOT expert?

---

<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:** [October 25, 2022, 10:41am UTC](https://root-forum.cern.ch/t/installing-garfield/52065/4 "2022-10-25T10:41:37Z")

</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…

BTW. The “`RootNewMacros.cmake`” error suggests that you try to use a ROOT “source code” distribution instead of its “(pre)compiled binaries”.

---

<div class="post-metadata">

**Author:** ![sarah](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sarah/32/34502_2.png) [@sarah](https://root-forum.cern.ch/u/sarah)\
**Post date:** [October 27, 2022, 8:12pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/5 "2022-10-27T20:12:20Z")

</div>

The same error occured  
/home/sarah/products/Root/modules/RootNewMacros.cmake

– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.1”)  
– Found GSL: /usr/include (found version “2.4”)  
– Found OpenMP\_CXX: -fopenmp (found version “4.5”)  
– Found OpenMP\_Fortran: -fopenmp (found version “4.5”)  
– Found OpenMP: TRUE (found version “4.5”)  
– Creating a new library named magboltz with API version 11  
CMake Error at CMakeLists.txt:184 (root\_generate\_dictionary):  
Unknown CMake command “root\_generate\_dictionary”.

– Configuring incomplete, errors occurred!  
See also “/home/sarah/garfieldpp/build/CMakeFiles/CMakeOutput.log”.

I don’t even know what’s the problem?

---

<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:** [October 27, 2022, 8:25pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/6 "2022-10-27T20:25:11Z")

</div>

What do you get from:  
`root-config --platform --arch --version`  
`root-config --prefix`  
`root-config --cflags`

---

<div class="post-metadata">

**Author:** ![sarah](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sarah/32/34502_2.png) [@sarah](https://root-forum.cern.ch/u/sarah)\
**Post date:** [October 28, 2022, 1:46pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/7 "2022-10-28T13:46:17Z")

</div>

![Screenshot from 2022-10-28 15-44-42](https://root-forum.cern.ch/uploads/default/original/3X/1/a/1a7e96bca0420916bd1d5a22d22797b4f9841e88.png)

---

<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:** [October 28, 2022, 1:50pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/8 "2022-10-28T13:50:44Z")

</div>

Check that you have GSL: `gsl-config --version`  
and make sure that you have at least “CMake 3.9”: `cmake --version`

Attach the three “`*.out.txt`” files created by my [“simple instructions on how to build Garfield++ (with examples) from scratch”](https://root-forum.cern.ch/t/fatal-error-when-trying-to-run-the-gem-example/39995/7).

BTW. @hschindl The configuration step outputs a strange line:

```nohighlight
(...)
-- Found OpenMP: TRUE (found version "4.5")
-- Creating a new library named magboltz with API version 11
-- Creating a new library named with API version # NOTE: NO NAME AND NO VERSION
-- Garfield++ examples will be built. In order disable this option use -DWITH_EXAMPLES=OFF
(...)

```

---

<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:** [October 28, 2022, 6:54pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/9 "2022-10-28T18:54:27Z")

</div>

Hmm, that does look strange, thanks…

---

<div class="post-metadata">

**Author:** ![sarah](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sarah/32/34502_2.png) [@sarah](https://root-forum.cern.ch/u/sarah)\
**Post date:** [October 29, 2022, 9:43am UTC](https://root-forum.cern.ch/t/installing-garfield/52065/10 "2022-10-29T09:43:29Z")

</div>

![Screenshot from 2022-10-29 11-41-11](https://root-forum.cern.ch/uploads/default/original/3X/f/c/fcdc0d7d52e7d0a466476fd4d574455d1ee8abfb.png)

that’s what i got …  
please what do you mean about ( Attach the three “`*.out.txt`” files created by my ), what should i do ?!  
thanks so much in advance

---

<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:** [October 29, 2022, 9:58am UTC](https://root-forum.cern.ch/t/installing-garfield/52065/11 "2022-10-29T09:58:34Z")

</div>

> [@sarah](#):
>
> please what do you mean about ( Attach the three “`*.out.txt`” files created by my ), what should i do ?!

Follow [these instructions](https://root-forum.cern.ch/t/fatal-error-when-trying-to-run-the-gem-example/39995/7). This should produce three `*.out.txt` files.

---

<div class="post-metadata">

**Author:** ![sarah](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sarah/32/34502_2.png) [@sarah](https://root-forum.cern.ch/u/sarah)\
**Post date:** [October 31, 2022, 3:30pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/12 "2022-10-31T15:30:32Z")

</div>

I’m so sorry for the late reply.  
i’ve followed the instructions above, here’s a screenshots with details hoping you could help me please.

 ![Screenshot from 2022-10-31 17-28-04](https://root-forum.cern.ch/uploads/default/original/3X/1/2/1210e5a23c99788e809dc0d48fc318d7485e14f2.png)  
 ![Screenshot from 2022-10-31 17-28-11](https://root-forum.cern.ch/uploads/default/original/3X/4/5/456eb0f461eeaf5e95979a6ab2b9d5b04c83011c.png)

---

<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:** [October 31, 2022, 6:32pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/13 "2022-10-31T18:32:11Z")

</div>

So, we do not know what happens.

Try this …

The ROOT Team provides [ready-to-use binary distributions for some systems (see “ **Download a pre-compiled binary distribution** ” therein)](https://root.cern/install/#download-a-pre-compiled-binary-distribution), including various Ubuntu versions, which you just need to download and unpack.

For Ubuntu 18.04 / x86\_64 / gcc 7.5: [https://root.cern/download/?C=M;O=A;P=\*[uU][bB][uU][nN][tT][uU]\*18\*](https://root.cern/download/?C=M;O=A;P=*%5BuU%5D%5BbB%5D%5BuU%5D%5BnN%5D%5BtT%5D%5BuU%5D*18*)

---

<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:** [November 14, 2022, 6:32pm UTC](https://root-forum.cern.ch/t/installing-garfield/52065/14 "2022-11-14T18:32:37Z")

</div>

Closed on November 14, 2022, 6:32pm UTC

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