how to run G4beamline on sever

144 views
Skip to first unread message

PJ

unread,
Sep 10, 2023, 11:28:44 PM9/10/23
to G4Beamline
I am a PhD student. I have an experience with GEANT4 and can run it on the supercomputer. However, I am currently trying to run G4beamline on a server but am getting stuck with how to execute my work. the OS is CentOS7. So, I installed G4beamline-3.06 from the source code, by using these command

$ cd G4beamline-3.06-source
$ cp g4bl/CMakelists.txt g4bl/CMakeLists.txt
$ cp g4bldata/CMakelists.txt g4bldata/CMakeLists.txt
$ cp g4blgui/CMakelists.txt g4blgui/CMakeLists.txt
$ cp g4blmpi/CMakelists.txt g4blmpi/CMakeLists.txt
$ cp g4bltest/CMakelists.txt g4bltest/CMakeLists.txt
$ mkdir build ; cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/local/G4beamline-3.06 -DG4BL_VISUAL=ON -DG4BL_GUI=ON -DG4BL_ROOT=ON -DG4BL_GSL=ON -D G4BL_FFTW=ON -DG4BL_MPI=OFF -DCMAKE_PREFIX_PATH=/home/r21234/OSS/geant4.10.06.p01/build ..
$ make 2>&1 | tee make.log
$ make install 2>&1 | tee make_install.log

Then I got G4beamline-3.06-SLF64.tgz at my home directory (/home/username)

my question is Where should I put input file? myjop.in and How to execute it ??
How to run?? What is command ?? g4bl myjob.in ???  

based on my experience in GEANT4, I have scr(.cc) include(.hh) cmakefile main.cc then cmake and make in build directory, and execute my jo bby ./myjop run.mac

Could you please suggest me? Thank you very much.

Tom Roberts

unread,
Sep 11, 2023, 12:12:56 AM9/11/23
to PJ, G4Beamline
On 9/10/23 10:28 PM, PJ wrote:
> I am a PhD student. I have an experience with GEANT4 and can run it on
> the supercomputer.
If, by chance, you want to run G4beamline 3.08 on perlmutter.nersc.gov,
it is already built there, with MPI enabled. Email me for details.
> > However, I am currently trying to run G4beamline on a server but am
> getting stuck with how to execute my work. the OS is CentOS7. So, I
> installed G4beamline-3.06 from the source code, by using these command
>
> $ cd G4beamline-3.06-source

OK. But I suggest using G4beamline 3.08 -- it has some bug fixes and an
updated Geant4.

On CentOS7 you do not need to build G4beamline from source, the file
G4beamline-3.06-SLF64.tgz that you downloaded should work. Just un-tar
it, add its bin directory into your PATH, and use 'g4bl' or 'g4blgui'.

Pursuing building from source:

> $ cp g4bl/CMakelists.txt g4bl/CMakeLists.txt
> $ cp g4bldata/CMakelists.txt g4bldata/CMakeLists.txt
> $ cp g4blgui/CMakelists.txt g4blgui/CMakeLists.txt
> $ cp g4blmpi/CMakelists.txt g4blmpi/CMakeLists.txt
> $ cp g4bltest/CMakelists.txt g4bltest/CMakeLists.txt
All of those do nothing, and are not needed. Please follow the
instructions in doc/BUILD.txt.
> $ mkdir build ; cd build
> $ cmake -DCMAKE_INSTALL_PREFIX=$HOME/local/G4beamline-3.06
> -DG4BL_VISUAL=ON -DG4BL_GUI=ON -DG4BL_ROOT=ON -DG4BL_GSL=ON -D
> G4BL_FFTW=ON -DG4BL_MPI=OFF
> -DCMAKE_PREFIX_PATH=/home/r21234/OSS/geant4.10.06.p01/build ..

*** YOU HAVE CONFLICTING PREFIX PATHS. Note the G4beamline Cmake files
expect the Geant4 install directory to be in GEANT4_DIR. Presumably you
have already setup the library environment variables, or your build
would fail.

Start over:

    $ cd G4beamline-3.06-source
    $ rm -fr build
    $ mkdir build; cd build
    $ cmake -DCMAKE_INSTALL_PREFIX=$HOME/local/G4beamline-3.06
-DG4BL_VISUAL=ON -DG4BL_GUI=ON -DG4BL_ROOT=ON -DG4BL_GSL=ON -D
G4BL_FFTW=ON -DG4BL_MPI=OFF ..
    $ make 2>&1 | tee make.log
    $ make install 2>&1 | tee make_install.log

> Then I got G4beamline-3.06-SLF64.tgz at my home directory (/home/username)
That file was not built by the above commands. I suspect you downloaded
it -- creation time should tell.
> my question is Where should I put input file? myjop.in and How to
> execute it ??
> How to run?? What is command ?? g4bl myjob.in ???

Put your input file wherever is most convenient for you. I invariably
put mine in a directory related to the project I am working on.

After the above build, do this:

    $ source $HOME/local/G4beamline-3.06/bin/g4bl-setup.sh
    $ # perhaps put that into your .profile

then to use the GUI:

    $ g4blgui &

To use the command-line:

    $ cd <wherever myjob.in is located>
    $ g4bl myjob.in
    $ # that puts the output files into the current directory

Tom Roberts

PJ

unread,
Sep 11, 2023, 4:16:06 AM9/11/23
to G4Beamline, Tom Roberts
I'm sorry for disturbing you again.
I get problems like below..........

[Phanthip@hokusai2 bin]$ which g4bl
~/G4beamline-3.06-source/build/bin/g4bl
[Phanthip@hokusai2 bin]$ g4bl -
g4bl: error while loading shared libraries: libgsl.so.27: cannot open shared object file: No such file or directory
[Phanthip@hokusai2 bin]$ g4blgui &
[1] 69686
[Phanthip@hokusai2 bin]$ qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.


and when I tried to test by..................

[Phanthip@hokusai2 bin]$ g4bltest
platformName=LINUX
g4blDir=/bwfefs/home/Phanthip/G4beamline-3.06-source/build
currentDir=/bwfefs/home/Phanthip/G4beamline-3.06-source/build/bin

test112: ***ERROR: =run '"/bwfefs/home/Phanthip/G4beamline-3.06-source/build/bin/g4bl" test112.in >>g4bl.out 2>&1' failed
test113: ***ERROR: =run '"/bwfefs/home/Phanthip/G4beamline-3.06-source/build/bin/g4bl" test113.in >>g4bl.out 2>&1' failed
***g4bltest: 108 tests failed out of 114 tests (1 omitted)
   Current directory: "/bwfefs/home/Phanthip/G4beamline-3.06-source/build/bin"
   For each failing test a directory has been created containing the output(s).

then I tried..........................

[Phanthip@hokusai2 bin]$ g4bldata
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

if you have time please tell me how to solve the problems. Thank you.

Best regards,
Phanthip


ในวันที่ วันจันทร์ที่ 11 กันยายน ค.ศ. 2023 เวลา 13 นาฬิกา 12 นาที 56 วินาที UTC+9 Tom Roberts เขียนว่า:
Reply all
Reply to author
Forward
0 new messages