Fatal error when trying to run the Gem example

Below, you can find simple instructions on how to build Garfield++ (with examples) from scratch.
Try (in case of problems, inspect the three created “*.out.txt” files):

# ... assuming you are using a bash like shell ...
source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT
export GARFIELD_HOME=${PWD}/garfieldpp # where to build Garfield++
rm -rf ${GARFIELD_HOME} # make sure you start with an empty directory
git clone --depth=1 https://gitlab.cern.ch/garfield/garfieldpp.git ${GARFIELD_HOME}
cd ${GARFIELD_HOME}
mkdir build
cd build
cmake -DWITH_EXAMPLES=ON ${GARFIELD_HOME} 2>&1 | tee -a cmake.out.txt
make 2>&1 | tee -a make.out.txt
make install 2>&1 | tee -a make.install.out.txt
# ls -al Examples/Gem # "gem" should be there
# source ./setupGarfield.sh # setup this Garfield++ (if you want to use it now)

If you want to build, e.g., the Gem example in another separate directory, try (in case of problems, inspect the two created “*.out.txt” files):

# ... assuming you are using a bash like shell ...
source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT
export GARFIELD_HOME=/full/path/to/your/garfieldpp # where it was built
source ${GARFIELD_HOME}/build/setupGarfield.sh # setup your Garfield++
# cd /full/path/to/where/you/want/to/play/with/it
rm -rf Gem # cleanup
cp -a ${GARFIELD_HOME}/Examples/Gem ./
cd Gem
mkdir build
cd build
cmake ../ 2>&1 | tee -a cmake.out.txt
make 2>&1 | tee -a make.out.txt
# ls -al # "gem" should be there

Detailed explanations can be found on the following web pages:

1 Like