# Building and running an application in a cluster

**URL:** <https://root-forum.cern.ch/t/building-and-running-an-application-in-a-cluster/39866>\
**Category:** Garfield++\
**Tags:** cmake\
**Created:** [June 10, 2020, 5:21pm UTC](https://root-forum.cern.ch/t/building-and-running-an-application-in-a-cluster/39866 "2020-06-10T17:21:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Christian](https://root-forum.cern.ch/u/Christian)\
**Post date:** [June 10, 2020, 5:21pm UTC](https://root-forum.cern.ch/t/building-and-running-an-application-in-a-cluster/39866/1 "2020-06-10T17:21:49Z")

</div>

Hi,

I’m trying to run an application of mine in a cluster from my University. Since I don’t know the Garfield’s Library path there, I guess the best strategy would be to compile there. And again as I don’t know the Libraries’ path, I guess I can’t use my usual makefile, because for example there is a $GARFIELD\_HOME command there.  
So I believe I should follow the “Building and running an application” that I found on garfieldpp website, that is, for Gem the example:

```auto
cp -r $GARFIELD_HOME/Examples/Gem .
mkdir Gem/build; cd Gem/build
cmake ..
make
./gem

```

Although, for that I should use a CMakeLists.txt file, which I usually don’t use in my personal computer, and I don’t even know how to write or find one of that.  
How can I write this CMakeLists.txt file?

---

<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:** [June 10, 2020, 6:19pm UTC](https://root-forum.cern.ch/t/building-and-running-an-application-in-a-cluster/39866/2 "2020-06-10T18:19:56Z")

</div>

Hi,  
yes, if Garfield++ is not installed on your cluster, then you will need to build the project yourself, following the instructions on

> **[README.md · master · garfield / garfieldpp](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/README.md)**
>
> http://garfieldpp.web.cern.ch/garfieldpp/

  
or  
[http://garfieldpp.web.cern.ch/garfieldpp/getting-started/](http://garfieldpp.web.cern.ch/garfieldpp/getting-started/)  
and then build your application against it using the recipe ("Building and running an application”) that you found on the website.  
You’ll find a CMakeLists.txt file in all of the Examples subdirectories of the source tree, for instance (for the GEM example):  

> **[Examples/Gem/CMakeLists.txt · master · garfield / garfieldpp](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Examples/Gem/CMakeLists.txt)**
>
> http://garfieldpp.web.cern.ch/garfieldpp/

  
It should be quite straightforward to adapt it to your application.

---

<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:** [June 24, 2020, 6:20pm UTC](https://root-forum.cern.ch/t/building-and-running-an-application-in-a-cluster/39866/3 "2020-06-24T18:20:02Z")

</div>

Closed on June 24, 2020, 6:20pm UTC

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