# Installation error at make step

**URL:** <https://root-forum.cern.ch/t/installation-error-at-make-step/64627>\
**Category:** Garfield++\
**Created:** [February 3, 2026, 12:07am UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627 "2026-02-03T00:07:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 3, 2026, 12:07am UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/1 "2026-02-03T00:07:21Z")

</div>

Hello,

I am trying to install Garfield++ using the instructions from this webpage: [Installation - Garfield++](https://garfieldpp.docs.cern.ch/install/)

At the “make -j4” step, I encountered the following error

```auto
In file included from input_line_9:7:
In file included from /home/d/Nuclear_phys4bash/Garfield/Include/Garfield/ComponentFieldMap.hh:10:
In file included from /home/d/Nuclear_phys4bash/Garfield/Include/Garfield/Component.hh:9:
/home/d/Nuclear_phys4bash/Garfield/Include/Garfield/Symmetry.hh:144:7: error: cannot initialize a variable of type 'const Garfield::Symmetry::Type' with an rvalue of type 'unsigned int'
      static_cast<std::uint32_t>(Type::PeriodicX) |
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/d/Nuclear_phys4bash/Garfield/Include/Garfield/Symmetry.hh:152:7: error: cannot initialize a variable of type 'const Garfield::Symmetry::Type' with an rvalue of type 'unsigned int'
      static_cast<std::uint32_t>(Type::PeriodicY) |
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/d/Nuclear_phys4bash/Garfield/Include/Garfield/Symmetry.hh:160:7: error: cannot initialize a variable of type 'const Garfield::Symmetry::Type' with an rvalue of type 'unsigned int'
      static_cast<std::uint32_t>(Type::PeriodicZ) |
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

I am not sure what is wrong. Before this step, I did “cmake $GARFIELD\_HOME”, and it ran successfully. I only got the following warning that it couldn’t find Geant4:

```auto
CMake Warning at Examples/Geant4GarfieldInterface/CMakeLists.txt:16 (find_package):
  By not providing "FindGeant4.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Geant4", but
  CMake did not find one.

  Could not find a package configuration file provided by "Geant4" with any
  of the following names:

    Geant4Config.cmake
    geant4-config.cmake

  Add the installation prefix of "Geant4" to CMAKE_PREFIX_PATH or set
  "Geant4_DIR" to a directory containing one of the above files. If "Geant4"
  provides a separate development package or SDK, be sure it has been
  installed.

```

Please note that I haven’t installed Geant4. Also, the installation page has no mention regarding Geant4.

Any suggestions on how to solve this error? I have no prior knowledge to Garfield, so, sorry in advance if this question is too naive. My ROOT and OS versions are

_OS_: Ubuntu 20.04.6 LTS x86\_64  
_ROOT_: 6.24/08 (Built for linuxx8664gcc)

Best,  
Divyang.

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [February 3, 2026, 10:17am UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/2 "2026-02-03T10:17:27Z")

</div>

Perhaps @hschindl can help with 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:** [February 6, 2026, 10:45am UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/3 "2026-02-06T10:45:29Z")

</div>

Hi,  
can you do a git pull and try again? This fix by Francois Lagarde (thanks a lot!) should solve the issue:

> **[fix https://root-forum.cern.ch/t/installation-error-at-make-step/64627 (!586)...](https://gitlab.cern.ch/garfield/garfieldpp/-/merge_requests/586)**
>
> http://garfieldpp.docs.cern.ch/

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 6, 2026, 1:49pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/4 "2026-02-06T13:49:10Z")

</div>

Thanks!

This update solved the errors I mentioned in the question. However, I got the following error during the “make -j4” step:

```auto
[43%] Linking CXX executable plot_gas
[43%] Linking CXX executable mwpc
[44%] Linking CXX executable ion_signal
[44%] Linking CXX executable full_tpc_sim
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/plot_gas.dir/build.make:108: Examples/AliceTPC/plot_gas] Error 1
make[1]: *** [CMakeFiles/Makefile2:2117: Examples/AliceTPC/CMakeFiles/plot_gas.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AnalyticField/CMakeFiles/mwpc.dir/build.make:108: Examples/AnalyticField/mwpc] Error 1
make[1]: *** [CMakeFiles/Makefile2:2213: Examples/AnalyticField/CMakeFiles/mwpc.dir/all] Error 2
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/ion_signal.dir/build.make:108: Examples/AliceTPC/ion_signal] Error 1
make[1]: *** [CMakeFiles/Makefile2:2149: Examples/AliceTPC/CMakeFiles/ion_signal.dir/all] Error 2
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/full_tpc_sim.dir/build.make:108: Examples/AliceTPC/full_tpc_sim] Error 1
make[1]: *** [CMakeFiles/Makefile2:2181: Examples/AliceTPC/CMakeFiles/full_tpc_sim.dir/all] Error 2

```

I again thank you for working on this, and apologies if I am making a mistake.

Here is the full log  
[log.txt](https://root-forum.cern.ch/uploads/short-url/ru4OhOlz9bLVEKjCtKzE9PtrVjc.txt) (15.4 KB)

---

<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:** [February 6, 2026, 3:32pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/5 "2026-02-06T15:32:02Z")

</div>

Hi,  
what compiler/platform are you using?

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 6, 2026, 4:11pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/6 "2026-02-06T16:11:09Z")

</div>

_gcc compiler_: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0  
_OS_ : Ubuntu 20.04.6 LTS x86\_64  
_ROOT_ : 6.24/08 (Built for linuxx8664gcc)

If needed:  
_g++ compiler_: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

---

<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:** [February 6, 2026, 5:50pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/7 "2026-02-06T17:50:22Z")

</div>

Can you try adding extra curly braces in lines 138, 149, 150 and 161 of the file `Include/Garfield/ComponentChargedRing.hh`?

```cpp
- static constexpr double m_kEllipticKCoeffs[m_kTaylorOrder] = {
+ static constexpr double m_kEllipticKCoeffs[m_kTaylorOrder] = {{

```

```cpp
- 2133423721.0 / 68719476736.0};
+ 2133423721.0 / 68719476736.0}};

```

```cpp
- static constexpr double m_kEllipticECoeffs[m_kTaylorOrder] = {
+ static constexpr double m_kEllipticECoeffs[m_kTaylorOrder] = {{

```

```cpp
- -112285459.0 / 68719476736.0};
+ -112285459.0 / 68719476736.0}};

```

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 6, 2026, 6:18pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/8 "2026-02-06T18:18:10Z")

</div>

Seems like “make -j4” doesn’t like it. It gives the following errors:

```auto
In file included from input_line_9:12:
In file included from /home/d/Nuclear_phys4bash/Garfield/Include/Garfield/AvalancheGridSpaceCharge.hh:10:
/home/d/Nuclear_phys4bash/Garfield/Include/Garfield/ComponentChargedRing.hh:138:65: error: excess elements in scalar initializer
  static constexpr double m_kEllipticKCoeffs[m_kTaylorOrder] = {{
                                                                ^
/home/d/Nuclear_phys4bash/Garfield/Include/Garfield/ComponentChargedRing.hh:150:65: error: excess elements in scalar initializer
  static constexpr double m_kEllipticECoeffs[m_kTaylorOrder] = {{
                                                                ^

```

Please note that I did a fresh start by removing all the files and “git clone”-ing the project.

Here is the full log:  
[log.txt](https://root-forum.cern.ch/uploads/short-url/rq7Xx2AcZncsFe3VmhoUq7R8IF8.txt) (2.6 KB)

---

<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:** [February 7, 2026, 2:31pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/9 "2026-02-07T14:31:58Z")

</div>

Hmm… can you try changing

```cpp
static constexpr double m_kEllipticKCoeffs[m_kTaylorOrder] = {{

```

to

```cpp
static constexpr std::array<double, m_kTaylorOrder> m_kEllipticKCoeffs = {{

```

and

```cpp
static constexpr double m_kEllipticECoeffs[m_kTaylorOrder] = {{

```

to

```cpp
static constexpr std::array<double, m_kTaylorOrder> m_kEllipticECoeffs = {{

```

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 7, 2026, 5:48pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/10 "2026-02-07T17:48:58Z")

</div>

No success. Here is the error:

```auto
[43%] Linking CXX executable mwpc
[44%] Linking CXX executable ion_signal
/usr/bin/ld: ../../[44%] Linking CXX executable full_tpc_sim
libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/plot_gas.dir/build.make:108: Examples/AliceTPC/plot_gas] Error 1
make[1]: *** [CMakeFiles/Makefile2:2117: Examples/AliceTPC/CMakeFiles/plot_gas.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AnalyticField/CMakeFiles/mwpc.dir/build.make:108: Examples/AnalyticField/mwpc] Error 1
make[1]: *** [CMakeFiles/Makefile2:2213: Examples/AnalyticField/CMakeFiles/mwpc.dir/all] Error 2
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/ion_signal.dir/build.make:108: Examples/AliceTPC/ion_signal] Error 1
make[1]: *** [CMakeFiles/Makefile2:2149: Examples/AliceTPC/CMakeFiles/ion_signal.dir/all] Error 2
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticECoeffs'
/usr/bin/ld: ../../libGarfield.so.0.3: undefined reference to `Garfield::ComponentChargedRing::m_kEllipticKCoeffs'
collect2: error: ld returned 1 exit status
make[2]: *** [Examples/AliceTPC/CMakeFiles/full_tpc_sim.dir/build.make:108: Examples/AliceTPC/full_tpc_sim] Error 1
make[1]: *** [CMakeFiles/Makefile2:2181: Examples/AliceTPC/CMakeFiles/full_tpc_sim.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

```

---

<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:** [February 8, 2026, 7:15pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/11 "2026-02-08T19:15:42Z")

</div>

Hi again,  
I’ve just merged a set of commits that I hope should fix your issue:

> **[ComponentChargedRing (!592) · Merge requests · garfield / garfieldpp · GitLab](https://gitlab.cern.ch/garfield/garfieldpp/-/merge_requests/592)**
>
> Move evalPoly2 and definition of coefficients of the power series to an anonymous namespace. Make GetEllipticIntegralsTaylor static. Move calculation of m\_q0 to SetMedium.

Can you do a git pull and try again?

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [February 8, 2026, 8:45pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/12 "2026-02-08T20:45:15Z")

</div>

It worked! I also successfully ran the GEM example as suggested on the installation page.

---

<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:** [February 22, 2026, 8:46pm UTC](https://root-forum.cern.ch/t/installation-error-at-make-step/64627/13 "2026-02-22T20:46:05Z")

</div>

Closed on February 22, 2026, 8:46pm UTC

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