Segmentation fault and environment variable error in Linux while running exampleB1

I have build and installed geant4 on ubuntu and also build exampleB1 but when I run ./exampleB1 it gives segmentation fault error and when I run
./exampleB1 run1.mac
then it gives environment variable and I already set all the environment variables of all data libraries, both screenshots are given below

Very thanks to your support

The environment variables for data don’t go into PATH, they are set separetely, as documented in the Postinstall section of the Installation Guide

Thank you for your reply, I tried to set the environment variable as per the link you shared bu facing the below error on line 27 of geant4.csh;

The line 27 of geant4.csh is also attached in screenshot below,

I am very thankful for your support.


A couple of things:

  1. Go to your geant4-install folder, and then go in /share/Geant4-10.5.1/
  2. Create a folder “data” (case sensitive). Paste all the data files in that.
  3. then on a terminal do: source
  4. Try running the example on same terminal.

This should work. My humble suggestion would be to going through a basic linux training online, could be very helpful.


1 Like

Thank you very much, now it works.