Hi, all.
I am new to Geant4 and Ubuntu. I attempted to install and compile Geant4-v11.1.2 on Ubuntu 20.04.3 installed under WSL1 of Windows 10. The installation and compiling went well but error occured when running example B1. Part of the output is as follows:
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: dxcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
Specific steps in my installation are listed as follows, referring to a tutorial on the Internet.
First, I downloaded the Geant4 package and moved it to the geant4 directory.
cp $HOME/Downloads/geant4-v11.1.2.tar.gz $HOME/geant4
tar -xzvf geant4-v11.1.2.tar.gz
Then, preparation for installing Geant4 is performed by following codes under $HOME/geant4/.
mkdir geant4-build && cd geant4-build
sudo apt-get install qt4* cmake libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev libhdf5-serial-dev hdf5-tools
sudo apt-get install -y libexpat1 libexpat1-dev
sudo apt install qt5*
Then I created geant4-install directory under $HOME/geant4, and then executed following codes under $HOME/geant4/geant4-build/.
sudo cmake -DCMAKE_INSTALL_PREFIX=$HOME/geant4/geant4-install -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_USE_QT=ON GEANT4_BUILD_MULTITHREADED=ON $HOME/geant4/geant4-v11.1.2
sudo make -j8
sudo make install -j8
cd $HOME/geant4/geant4-install/bin
source geant4.sh
I downloaded all 12 data packages on Windows and moved them to $HOME/geant4/geant4-install/share/Geant4/data, then unziped them and deleted the zip packages.
sudo cp *.tar.gz $HOME/geant4/geant4-install/share/Geant4/data
cd $HOME/geant4/geant4-install/share/Geant4/data
sudo ls *.tar.gz | sudo xargs -n1 tar xzvf
sudo rm *.tar.gz
Then I added the path of Geant4 to .bashrc file.
source ~/geant4/geant4-install/bin/geant4.sh
source ~/geant4/geant4-install/share/Geant4/geant4make/geant4make.sh
source ~/.bashrc
Example B1 is performed with the following codes. The error occured after executing command “./exampleB1”.
cd $HOME/geant4/geant4.v11.1.2/examples/basic/B1
mkdir build&&cd build
source ~/.bashrc
cmake ../
make -j8
./exampleB1
Post the error message again.
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: dxcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
I really need your help. Considering I am brand new to both Geant4 and Linux Command, some direct guidance on operating would be useful for me. If any additional information is required, I will provide it as soon as I see it. Any help will be appriciated.
Sincerely yours,
Luca
_Geant4 Version:_v11.1.2
_Operating System:_Ubuntu 20.04.3 on Windows 10
_CMake Version:_3.16.3