Garfield++ installation Cmake

I’m just beginning to learnGarfield++.
I tried to install Garfield++ using this link,
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


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:


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

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 program, please update the path to the Garfield headers, i. e. replace
#include "MediumMagboltz.hh"
#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

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