Hello,
I have been trying to create a standalone executable of the track.C macro with the intent to debug it and become more familiar with the data structures and the methods to manage and render particle tracks.
I have managed to make a manual build of the latest ROOT distribution with debug symbols. I have subsequently used it to generate the dictionary and shared library with this command:
root [0] .L track.C+g
which created the following:
-rw-r–r-- 1 pbr pbr 8288 Jan 5 15:04 track_C.d
-rw-r–r-- 1 pbr pbr 1449 Jan 5 15:04 track_C_ACLiC_dict_rdict.pcm
-rwxr-xr-x 1 pbr pbr 344296 Jan 5 15:04 track_C.so
I then compiled the main program:
#include "TEveTrackPropagator.h"
#include "TEveTrack.h"
#include "TEveVSDStructs.h"
#include "TEveManager.h"
#include "TEveViewer.h"
#include "TSystem.h"
#include "TGLViewer.h"
#include "TMath.h"
#include "TEveViewer.h"
#include "TEvePointSet.h"
#include <iostream>
#include "./track.C"
//void track(int, bool);
int main(){
track(4,kTRUE);
return 0;
}
with the following:
and finally linked the two with the following command:
~/root_install2/tmp$ g++ -g -o build/main_track_C.exe build/main_track_C.o src/track_C.so -Wl,-rpath,'$ORIGIN' `../bin/root-config --libs` `../bin/root-config --glibs` -lEve -lRGL -lpthread -lrt -Lhome/pbr/root_install2/lib
This generated the standalone executable with the debug symbols, however when run it exits with a segmentation violation error.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b8bba0 in TApplication::InitializeGraphics (this=0x0) at /home/pbr/root_src/core/base/src/TApplication.cxx:264
264 LoadGraphicsLibs();
Here is the full stack trace:
(gdb) bt
#0 0x00007ffff7b8bba0 in TApplication::InitializeGraphics (this=0x0) at /home/pbr/root_src/core/base/src/TApplication.cxx:264
#1 0x00007ffff4eb2af7 in TEveManager::Create (map_window=true, opt=0x55555555e241 "FIV")
at /home/pbr/root_src/graf3d/eve/src/TEveManager.cxx:905
#2 0x000055555555a5ee in track (mode=4, isRungeKutta=true) at ../src/./track.C:170
#3 0x000055555555b87a in main () at ../src/main_track_C.cpp:21
My goal again is to follow this “simple” example step by step to get a better understanding of the data structures and methods in play.
What am I missing?
Is there a better way to accomplish this?
Thank you.
Pietro
_ROOT Version: 6.22/02
_Platform: Debian GNU/Linux 10 (buster)
_Compiler: g++ (Debian 8.3.0-6) 8.3.0