Ubuntu 18.04 LTS (used through Windows WSL)
Geant4-10.6.p03
gcc 7.5.0
Hello,
I have followed the standard guidelines here for building and installing Geant4.
By the end of it, I have run the geant.sh and geant4make.sh scripts and my environmental variables are
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ printenv | grep G4
G4UI_USE_TCSH=1
G4INCLDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4INCL1.0
G4INSTALL=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/geant4make
G4WORKDIR=/home/aeroulis89/geant4_workdir
G4LIB_USE_ZLIB=1
G4LEVELGAMMADATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/PhotonEvaporation5.5
G4RADIOACTIVEDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/RadioactiveDecay5.4
G4MULTITHREADED=1
G4PIIDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4PII1.3
G4SAIDXSDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4SAIDDATA2.0
G4ABLADATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4ABLA3.1
G4SYSTEM=Linux-g++
G4REALSURFACEDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/RealSurface2.1.1
G4INCLUDE=/home/aeroulis89/geant4.10.06.p03-install/include/Geant4
G4NEUTRONHPDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6
G4PARTICLEXSDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4PARTICLEXS2.1
G4LIB=/home/aeroulis89/geant4.10.06.p03-install/lib/Geant4-10.6.3
G4VIS_USE_OPENGLQT=1
G4ENSDFSTATEDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4ENSDFSTATE2.2
G4LEDATA=/home/aeroulis89/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4EMLOW7.9.1
G4UI_USE_QT=1
G4LIB_BUILD_SHARED=1
Then, I embark on trying out example B1:
cp -r geant4.10.06.p03-install/share/Geant4-10.6.3/examples/basic/B1 g4B1example
cd /home/g4B1example
mkdir build
cd build
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ cmake -DGEANT4_DIR= /home/aeroulis89/geant4.10.06.p03-install/lib/Geant4-10.6.3/ /home/aeroulis89/g4B1example/
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version "2.2.5", minimum required is "2.2.5")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
GEANT4_DIR
-- Build files have been written to: /home/aeroulis89/g4B1example/build
Then I do make
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ make
Scanning dependencies of target exampleB1
[ 12%] Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o
[ 25%] Building CXX object CMakeFiles/exampleB1.dir/src/B1ActionInitialization.cc.o
[ 37%] Building CXX object CMakeFiles/exampleB1.dir/src/B1DetectorConstruction.cc.o
[ 50%] Building CXX object CMakeFiles/exampleB1.dir/src/B1EventAction.cc.o
[ 62%] Building CXX object CMakeFiles/exampleB1.dir/src/B1PrimaryGeneratorAction.cc.o
[ 75%] Building CXX object CMakeFiles/exampleB1.dir/src/B1RunAction.cc.o
[ 87%] Building CXX object CMakeFiles/exampleB1.dir/src/B1SteppingAction.cc.o
[100%] Linking CXX executable exampleB1
[100%] Built target exampleB1
Finally, I attempt to run it
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ ./exampleB1
Available UI session types: [ Qt, GAG, tcsh, csh ]
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aeroulis89'
G4WT1 > /control/saveHistory
G4WT0 > /control/saveHistory
G4WT1 > /run/verbose 2
G4WT0 > /run/verbose 2
G4WT1 > /run/initialize
G4WT0 > /run/initialize
G4WT0 > /run/physicsModified
G4WT1 > /run/physicsModified
Segmentation fault
I do not get a specific error number which is strange…
Then I try a naive idea, which tells me something about the libG4graphics library…
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ sudo ./exampleB1
./exampleB1: error while loading shared libraries: libG4graphics_reps.so: cannot open shared object file: No such file or directory
However this library does exist…
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ ldd exampleB1 | grep libG4graphics
libG4graphics_reps.so => /home/aeroulis89/geant4.10.06.p03-install/lib/libG4graphics_reps.so (0x00007f06d4be1000)
As another clue that I saw might be useful to know from other similar forum questions is my LD_LIBRARY_PATH
aeroulis89@DESKTOP-J2QLNGA:~/g4B1example/build$ echo $LD_LIBRARY_PATH
/usr/lib/x86_64-linux-gnu:/home/aeroulis89/geant4.10.06.p03-install/lib:/home/aeroulis89/geant4.10.06.p03-install/lib:/home/aeroulis89/builddir/lib
Can someone help me debug this? Any hint would be much appreciated.
Alex