Home | News | Documentation | Download

Garfield++ Installation

Hi, I am using this link to install Garfield++ into Ubuntu with ROOT-6.18.04 and GEANT4.10.06.p01.


When i typed command
$ cmake $GARFIELD_HOME -DCMAKE_INSTALL_PREFIX=$GARFIELD_HOME/garfieldpp-install
error occured(see screenshot).
Please help me.

Hi,
it looks like CMake doesn’t find your ROOT installation. Did you source the thisroot.sh script before building Garfield++?

Best regards,
Heinrich

PS: the instructions given on the link that you sent don’t seem to be fully up to date (the plain makefile and the garfroot executable don’t exist anymore).
I would recommend following the “official” instructions on the Garfield++ website:
http://garfieldpp.web.cern.ch/garfieldpp/getting-started/
or on gitlab:

Thank you for your response!
I also tried with the official installation guide but stuck there(see screenshot)

You have to provide a target. Try

cmake $GARFIELD_HOME

I tried with another procedure and installed it.
Now i wanna run its GEM example when i try to copy the folder to a local directory by using:

cp -r $GARFIELD_HOME/Examples/Gem

it did’t copy and the error is in the screenshot

You have to specify where to copy the folder. For instance, to copy it to your local directory, type
cp -r $GARFIELD_HOME/Examples/Gem .

Thank you for your response. It really helped me a lot. But in the when i execute make command then a fatal error occurred(see screenshot).

@mato do you have an idea what could be the issue?
Some people have reported that they managed to solve this by using the binary distribution of ROOT.
You could also try the recipe given here:

Inspect the output of (see if you have ROOT includes there): root-config --incdir

when i typed “root-config --incdir” than error is “root-config command not found”

Did you source the thisroot.sh script?

Yes i did, but still same error.

This suggests that you have a broken ROOT distribution.

The root-config should be in the same place as thisroot.sh and root.

The problem is that the ROOT installation is incomplete. As far I can see you did source root-6.18.04/build/bin/thisroot.sh which indicates that you are using the binaries and configuration files produced during the build process. Did you ‘install’ ROOT after building it with make install?
The difference is that the CMake configuration files, such as ROOTConfig.cmake that will chain the target include directories dependencies will assume that you have installed ROOT after building it.
You just need to finish the installation of ROOT specifying the location where you want the installation to be with -DCMAKE_INTALL_PREFIX=/home/afzaal/root-6.18.04/install and issue a make install. Then source /home/afzaal/root-6.18.04/install/bin/thisroot.sh.

Thanks for your response!
Really my root installation is incomplete. But when i give “make install” command
then error is "[100%] Built target hist2workspace
Install the project…
– Install configuration: “RelWithDebInfo”
– Up-to-date: /usr/local/lib
CMake Error at cmake_install.cmake:41 (file):
file INSTALL cannot set permissions on “/usr/local/lib”: Operation not
permitted.
Further more when i give following command after it
"-DCMAKE_INSTALL_PREFIX=/home/afzaal/root-6.18.04/install than error is “No such file or directory”.
Really need solution to complete install root.
Thanks.

The complete command in the build directory is:

cmake -DCMAKE_INSTALL_PREFIX=/home/afzaal/root-6.18.04/install .
make install

Ok but now error is
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.

CMake Error: The source “/home/afzaal/root-6.18.04/build/CMakeLists.txt” does not match the source “/home/afzaal/root-6.18.04/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.
Where i did mistake?

I was assuming that:

  • Your current directory was the build directory of ROOT
  • That you had previously configured (cmake …) and build (make …) the full ROOT project

And I didn’t want that you had to wait to re-build everything from starch again.

This seems not to be the case. Therefore follow the instructions from here or download a binary installation from https://root.cern/releases/release-61804/

Thank you very much mato! Your responses really helped me a lot. I executed all commands that you told successfully (hope this time ROOT is properly installed).
Cheers