Hi,
I am writing a program, which must have an implementation of REST packages and trying to compile it via “make”
Currently, I have an error during the compilation, stating this:
g++ -O3 -Wall -fPIC -g -std=c++11 -pthread -std=c++11 -m64 -I/local/home/al264242/Documents/Soft/root-6.20.00/install/include -I. -c -o EventLoop.o EventLoop.cpp
In file included from EventLoop.h:8,
from EventLoop.cpp:1:
Data.h:7:10: fatal error: TRestTools.h: No such file or directory
7 | #include "TRestTools.h"
| ^~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: EventLoop.o] Error 1
I used the script installROOT.sh with the modified installation path.
The full script is here:
#!/bin/bash
set -e
CURRENT_DIR=$PWD
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
ROOT_VERSION=6.24.02
ROOT_DIR=$SOFT/root-$ROOT_VERSION
mkdir -p ${ROOT_DIR}
cd ${ROOT_DIR}
f=root_v$ROOT_VERSION.source.tar.gz
if [ -f $f ]; then
echo use cache build/$f
else
if [ $machine == "Mac" ]; then
curl https://root.cern.ch/download/$f -o $f
else
wget https://root.cern.ch/download/$f
fi
fi
tar -xvzf $f
rm -rf source
mv root-$ROOT_VERSION source
mkdir -p ${ROOT_DIR}/build
cd ${ROOT_DIR}/build
cmake -DCMAKE_CXX_STANDARD=17 -Dgdml=ON -DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/install ../source
make -j10
make install
cd ${CURRENT_DIR}
echo ""
echo "Execute this to load the recently compiled ROOT version in your environment"
echo "source ${ROOT_DIR}/install/bin/thisroot.sh"
#echo "#Added by REST installROOT.sh script to setup ROOT environment" >> ~/.bashrc
#echo "source ${ROOT_DIR}/install/bin/thisroot.sh" >> ~/.bashrc
echo ""
Ok, that means it is compiled from sources. Perhaps the malloc is related to Garfield, since it comes just after loading RestDetector. Did you compile REST using REST_GARFIELD=ON?
Yes, I did. Although, I decided to recompile REST again and noticed that with an option REST_DECAY0 turned ON I receive an error:
[ 82%] Built target RestDetector
In file included from input_line_9:3:
/local/home/al264242/Documents/Soft/rest-framework2_3/source/libraries/geant4/inc/TRestGeant4ParticleSourceDecay0.h:4:10: fatal error: 'bxdecay0/decay0_generator.h' file not found
#include <bxdecay0/decay0_generator.h>
Without the Decay0 option (but, with REST_GARFIELD=ON), REST compiles without any visible problems, but restRoot isn’t working still - core dumped after the same libRestDetector.so library.
Decay0 is optional, so you need to install decay0 libraries. Then, if you get installed Decay0 libraries, you may enable REST_DECAY0 so that you are able to use the Decay0 generator inside restG4.
So, then, the problem is related to Garfield, perhaps selecting a different Garfield version will solve. Also, make sure Garfield is compiled against the same ROOT version you use to compile REST.