Problem compiling REST with Garfield

REST version : v2.2.13
REST commit : 72e9d452

I am having troubles to make REST to recognise the Garfield installation. These are the steps I followed up to now, referencing the installation tutorials:

  1. I installed Garfield with the ./installGarfield.sh script. I also used the other installation scripts to be sure all the required software was installed. I checked that the required paths are in my .bashrc.
  2. I compiled REST as usual, with the following options for the cmake: -DREST_G4=ON and -DREST_GARFIELD=ON

But now, when I try to run the REST_DrawCombinedGasCurves macro (for example) that requires garfield to obtain the parameters of the gases, I get the following messages:

This REST is not compiled with garfield, Do not use Longitudinal Diffusion from TRestGas!
Please define the Longitudinal Diffusion in each process!

Am I doing something wrong?
Thank you very much!

Hi Elisa,

when you execute rest-config --flags what is the output you are getting?

Make sure you are using the version with Garfield installed.

rest-config --welcome

should give you that hint.

When you execute make install it is installing it at that location?


Just as additional comment …

The REST_DrawCombinedGasCurves macro is quite old, and might be obsolete. Only documented macros should be trusted.

For the moment, not many of them are documented …

Use: restManager ListMacros command to get a list of macros.

Additionally I believe if you run once cmake with Garfield disabled, and then try to enable it next time using cmake again, then it will not change in the final installation.

I believe this happened to me right now.

This a small bug, it should be fixed. But in the meantime clearing your build directory should do the job.

Be careful here :slight_smile:

cd build
rm -r *

Hi Javier,

Thank you for the tips. I am sorry this is going to be all over the place but I am attempting two installations of REST: on one hand, by my own at my own home, and on the other hand, the administrator of the server is attempting another where I don’t have admin permits. So:

  • The administrator achieved to fix the problem I mentioned before but I don’t know exactly what he did. With the installation he made, I can run REST correctly (not entirely true, but matter for another topic). However, when I type restManager ListMacros, I get the following

    RandomEngineRoot:
    Generator type: TRandom3
    Seed: 1569142573
    Heed:
    Database path: /home/common/software/garfieldpp/Heed/heed++/database
    [== Initializing ListMacros ==]
    REST ERROR. Task : ListMacros not found!!

    Also, how can I add new macros to be started with restRoot?

  • In my own installation, when I attempt make -j4, I get this error:

    [ 20%] Building CXX object source/metadata/CMakeFiles/RestMetadata.dir/__/__/rootdict/CINT_TRestGeometry.cxx.o
    In file included from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGas.h:50:0,
                 from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGeometry.h:27,
                 from /home/eruizchl/REST_v2/source/metadata/general/src/TRestGeometry.cxx:19:
    /home/common/software/garfieldpp/Include/TrackHeed.hh:9:38: fatal error: heed++/code/HeedParticle.h: No such file or directory
     #include "heed++/code/HeedParticle.h"
                                      ^
    compilation terminated.
    In file included from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGas.h:50:0,
                 from /home/eruizchl/REST_v2/build/rootdict/CINT_TRestGas.cxx:40:
    /home/common/software/garfieldpp/Include/TrackHeed.hh:9:38: fatal error: heed++/code/HeedParticle.h: No such file or directory
     #include "heed++/code/HeedParticle.h"
                                      ^
    compilation terminated.
    In file included from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGas.h:50:0,
                 from /home/eruizchl/REST_v2/source/metadata/general/src/TRestGas.cxx:216:
    /home/common/software/garfieldpp/Include/TrackHeed.hh:9:38: fatal error: heed++/code/HeedParticle.h: No such file or directory
     #include "heed++/code/HeedParticle.h"
                                      ^
    compilation terminated.
    In file included from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGas.h:50:0,
                 from /home/eruizchl/REST_v2/source/metadata/general/inc/TRestGeometry.h:27,
                 from /home/eruizchl/REST_v2/build/rootdict/CINT_TRestGeometry.cxx:40:
    /home/common/software/garfieldpp/Include/TrackHeed.hh:9:38: fatal error: heed++/code/HeedParticle.h: No such file or directory
     #include "heed++/code/HeedParticle.h"
                                      ^
    compilation terminated.
    

    And I don’t understand why because I can perfectly find the files in the folders they are supposed to be.

Thank you very much!!

Hi Elisa, I would open a new post for the questions you are doing since they do not seem related to Garfield anymore…

Anyway

Basically, if they are hosted at /macros/ directory they will be installed when doing make install, and then available when loading restRoot.

It exists the following file?
$REST_PATH/macros/REST_ListMacros.C

Please, make sure you do not have local changes on your cmake files, and re-build. Please, share the output of cmake, and make.

git reset --hard
cd build
rm -r *
cmake -DREST_GARFIELD=ON ../
make 

what is the output of those commands?

Sorry!! since the problem was with garfield and heed++ I though it was…

No it does not. In the $REST_PATH/macros/ folder I only find CMakeLists.txt, and several folders for each type of macros.

I did this, and I got the very same result.

I asked to the admin of the server, and he told me that he had to make several changes to the cmakelists and installation scripts to make REST work. I created a new branch called “mainz” so i can push the version he modified and see the changes. Is this ok? I’ll wait until I know your thougths, its been a while and I don’t know the work flow right now. We used to have our own branches before, but I see it is not the case anymore.

No, macros have nothing to be with Garfield …

Make sure you are at the right installation. What is the result of make install?

When I do make install it appears how it installs the macro files, for example

make install output

– Up-to-date: /programas/REST/v2.2.14/./macros/geant4/REST_ListIsotopes.C

– Up-to-date: /programas/REST/v2.2.14/./macros/geant4/REST_MeanTrackLeng.C

– Up-to-date: /programas/REST/v2.2.14/./macros/geant4/REST_FindIsotopes.C

– Up-to-date: /programas/REST/v2.2.14/./macros/geant4/REST_ReadNEvents_inROI.C

– Up-to-date: /programas/REST/v2.2.14/./macros/geant4/REST_ReadNEvents.C

– Up-to-date: /programas/REST/v2.2.14/./macros/CMakeLists.txt

– Up-to-date: /programas/REST/v2.2.14/./macros/REST_ListMacros.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_ValidateGeometry.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_MergeFiles.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_DrawCombinedGasCurves.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_ProduceReponseSignal.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_CheckReadout.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_CheckRunFileList.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_GenerateGasFile.C

– Up-to-date: /programas/REST/v2.2.14/./macros/tools/REST_DrawResponseSignal.C

– Up-to-date: /programas/REST/v2.2.14/scripts/restv2_1ToXml.py

– Up-to-date: /programas/REST/v2.2.14/./data

– Installing: /programas/REST/v2.2.14/./data/dataURL

– Up-to-date: /programas/REST/v2.2.14/./data/definitions

– Up-to-date: /programas/REST/v2.2.14/./data/definitions/processes.rml

– Up-to-date: /programas/REST/v2.2.14/./data/definitions/materials.xml

– Up-to-date: /programas/REST/v2.2.14/./data/definitions/gases.rml

– Up-to-date: /programas/REST/v2.2.14/./data/definitions/readouts.rml

The operation with branches is well described at the contribution guide.

It is ok, I will test those changes on our server, and then merge with the development branch v2.2.14_dev. We should never diverge branches, or produce results with local modifications, so that we are able to track/reproduce results produced with REST using git and the REST versioning system.

We should get to a merged version that can be installed on any system. Perhaps you could invite the administrator at Mainz to join this discussion.

This is the commit of Garfield that works for me c84002f. I know past versions changed the file structure of include files, and perhaps also the naming. That was usually the problem.

Thats the Garfield commit that is installed with the ./instalGarfield.sh script.

echo checkout the code...

#svn co http://svn.cern.ch/guest/garfield/tags/v1r0 $GARFIELD_HOME

git clone https://gitlab.cern.ch/garfield/garfieldpp.git $GARFIELD_HOME

cd $GARFIELD_HOME

git checkout c84002f1

I crosschecked the modifications that the admin made, and he only had to modify a little the CMakeLists.txt where Garfield is searched. With these modifications, the compilation was compleated without errors.

Since they are small changes, I deleted the mainz branch, checked into the 2.2.14_dev and did a commit following the contribution guide.

Thanks @elisa, it seems to me that the commit fixes a small bug not appearing in all conditions, or Garfield installations. Looks harmless for other systems.