Home | News | Documentation | Download

Garfield++ installation Cmake

Hi
I’m just beginning to learnGarfield++.
I tried to install Garfield++ using this link http://garfieldpp.web.cern.ch/garfieldpp/getting-started/,
no errors were reported during the installation using the cmake GARFIELD_HOME and make instructions.But when I tried to run Example/Gem,the following error occurred

1234

So I used this way to Cmake,and successfully solved the problem

BUT!!!When I ran a script written by a colleague(it can run successfully in his computer), the same error report came back!


Here is the makefile script:

微信截图_20200916103316

I don’t know what the problem is,looking forward to your reply
Thanks!!

Hi,
your colleague’s makefile was meant to be used with the old way of building Garfield (which was using different diretories), it won’t work with the CMake build. Can you try with the recipe in the second part of the instructions you posted, i. e. in your TripleGEM directory

  • create a build folder (mkdir build; cd build)
  • run CMake (cmake ..)
  • build the application (make)

Also in your avalancheV1.cc program, please update the path to the Garfield headers, i. e. replace
#include "MediumMagboltz.hh"
by
#include "Garfield/MediumMagboltz.hh"
Let me know if it works.

Thank you so much for your reply!I used the scheme you mentioned, but there is no CMakeList.txt file


Should I rewrite a new CMakeList.txt?

Ah, yes, you can copy and adapt the one from the GEM example.

Hi I wrote a CMakeList.txt file and solved the problem successfully!
The problem that had been bothering me for a week was finally solved!
Thanks sooooo much for your help