Geant 4 can not find q_ws_win

– 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 XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version “3.2.0”, minimum required is “3.2.0”)
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
– Looking for Q_WS_X11
– Looking for Q_WS_X11 - found
– Looking for Q_WS_WIN
– Looking for Q_WS_WIN - not found
– Looking for Q_WS_QWS
– Looking for Q_WS_QWS - not found
– Looking for Q_WS_MAC
– Looking for Q_WS_MAC - not found
– Found Qt4: /usr/bin/qmake-qt4 (found version “4.8.7”)
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
– Configuring done
– Generating done
– Build files have been written to: /home/ai/Desktop/P/pyramid/I

What exactly is your problem? Build files have been written, so it look to have completed successfully.

my problem, when i start “make” the files they give me that

"(base) ai@AI:~/Desktop/P/pyramid/I$ make
Scanning dependencies of target task
[ 11%] Building CXX object CMakeFiles/task.dir/main.cc.o
/home/ai/Desktop/P/pyramid/main.cc: In function ‘int main(int, char**)’:
/home/ai/Desktop/P/pyramid/main.cc:31:10: warning: variable ‘interactive’ set but not used [-Wunused-but-set-variable]
bool interactive = false;
^~~~~~~~~~~
[ 22%] Building CXX object CMakeFiles/task.dir/src/ActionInitialization.cc.o
[ 33%] Building CXX object CMakeFiles/task.dir/src/DetectorConstruction.cc.o
[ 44%] Building CXX object CMakeFiles/task.dir/src/EventAction.cc.o
[ 55%] Building CXX object CMakeFiles/task.dir/src/PhysicsList.cc.o
[ 66%] Building CXX object CMakeFiles/task.dir/src/PrimaryGeneratorAction.cc.o
[ 77%] Building CXX object CMakeFiles/task.dir/src/RunAction.cc.o
[ 88%] Building CXX object CMakeFiles/task.dir/src/StackingAction.cc.o
[100%] Linking CXX executable task
[100%] Built target task
(base) ai@AI:~/Desktop/P/pyramid/I$ ./task


Geant4 version Name: geant4-10-06-patch-01 (14-February-2020)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/


… open Root analysis file : task6.root - done
G4 kernel has come to Quit state.
… write Root file : task6.root - done
================== Deleting memory pools ===================
Number of memory pools allocated: 2; of which, static: 0
Dynamic pools deleted: 2 / Total memory freed: 0.0038 MB

RunManagerKernel is deleted. Good bye :slight_smile:
(base) ai@AI:~/Desktop/P/pyramid/I$

"
the simulation is open and close at the same time and it never visualize, I try to install qt and opengl and many libraries at Geant 4 again but it never works.
i hope you have the answer of this problem

So that’s your problem! Looks like it’s running in “batch mode”. To run in interactive mode you have to make sure your main program starts an interactive session. Typically:

ui->SessionStart();

you can see this is the main file from inside the ui->SessionStart(); is exist

"#include

#include <G4RunManager.hh>

#ifdef G4VIS_USE
#include <G4VisExecutive.hh>
#endif

#ifdef G4UI_USE
#include <G4UIExecutive.hh>
#endif

#include <G4RunManager.hh>
#include <G4String.hh>
#include <G4UImanager.hh>
#include <G4ScoringManager.hh>

#include “ActionInitialization.hh”
#include “DetectorConstruction.hh”
#include “PhysicsList.hh”

using namespace std;

/* Main function that enables to:

    • run any number of macros (put them as command-line arguments)
    • start interactive UI mode (no arguments or “-i”)
      /
      int main(int argc, char
      * argv)
      {
      vector macros;
      bool interactive = false;

    // Parse command line arguments
    if (argc == 1)
    {
    interactive = true;
    }
    else
    {
    for (int i = 1; i < argc; i++)
    {
    G4String arg = argv[i];
    if (arg == “-i” || arg == “–interactive”)
    {
    interactive = true;
    continue;
    }
    else
    {
    macros.push_back(arg);
    }
    }
    }

    //Use sequential mode only
    G4RunManager* runManager = new G4RunManager();
    runManager->SetVerboseLevel(1);

    #ifdef G4VIS_USE
    G4VisManager* visManager = new G4VisExecutive();
    visManager->SetVerboseLevel(0); // Default, you can always override this using macro commands
    visManager->Initialize();
    #endif

    runManager->SetUserInitialization(new PhysicsList());
    runManager->SetUserInitialization(new DetectorConstruction());
    runManager->SetUserInitialization(new ActionInitialization());

    #ifdef G4UI_USE
    G4UIExecutive* ui;
    if (interactive)
    {
    ui = new G4UIExecutive(argc, argv);
    }
    #endif

    G4UImanager* UImanager = G4UImanager::GetUIpointer();

    for (auto macro : macros)
    {
    G4String command = "/control/execute ";
    UImanager->ApplyCommand(command + macro);
    }

    #ifdef G4UI_USE
    if (interactive)
    {
    UImanager->ApplyCommand("/control/execute macros/vis.mac");
    UImanager->ApplyCommand("/control/execute macros/gps.mac");
    ui->SessionStart();
    delete ui;
    }
    #endif

    delete runManager;
    return 0;
    }
    "

It exists. But is it executed?

see that …
(base) ai@AI:~/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X$ source /home/ai/Geant4/g4-install/bin/geant4.sh
(base) ai@AI:~/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X$ cmake -DGeant4_DIR= /home/ai/Geant4/g4-install/lib/Geant4-10.6.1/ …/
– 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 XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version “3.2.0”, minimum required is “3.2.0”)
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
– Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
– Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
– Looking for Q_WS_X11
– Looking for Q_WS_X11 - found
– Looking for Q_WS_WIN
– Looking for Q_WS_WIN - not found
– Looking for Q_WS_QWS
– Looking for Q_WS_QWS - not found
– Looking for Q_WS_MAC
– Looking for Q_WS_MAC - not found
– Found Qt4: /usr/bin/qmake-qt4 (found version “4.8.7”)
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
– Configuring done
– Generating done
– Build files have been written to: /home/ai/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X
(base) ai@AI:~/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X$ make
Scanning dependencies of target task
[ 11%] Building CXX object CMakeFiles/task.dir/main.cc.o
/home/ai/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/main.cc: In function ‘int main(int, char**)’:
/home/ai/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/main.cc:31:10: warning: variable ‘interactive’ set but not used [-Wunused-but-set-variable]
bool interactive = false;
^~~~~~~~~~~
[ 22%] Building CXX object CMakeFiles/task.dir/src/ActionInitialization.cc.o
[ 33%] Building CXX object CMakeFiles/task.dir/src/DetectorConstruction.cc.o
[ 44%] Building CXX object CMakeFiles/task.dir/src/EventAction.cc.o
[ 55%] Building CXX object CMakeFiles/task.dir/src/PhysicsList.cc.o
[ 66%] Building CXX object CMakeFiles/task.dir/src/PrimaryGeneratorAction.cc.o
[ 77%] Building CXX object CMakeFiles/task.dir/src/RunAction.cc.o
[ 88%] Building CXX object CMakeFiles/task.dir/src/StackingAction.cc.o
[100%] Linking CXX executable task
[100%] Built target task
(base) ai@AI:~/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X$ ./task


Geant4 version Name: geant4-10-06-patch-01 (14-February-2020)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/


… open Root analysis file : task6.root - done
G4 kernel has come to Quit state.
… write Root file : task6.root - done
================== Deleting memory pools ===================
Number of memory pools allocated: 2; of which, static: 0
Dynamic pools deleted: 2 / Total memory freed: 0.0038 MB

RunManagerKernel is deleted. Good bye :slight_smile:
(base) ai@AI:~/Geant4/g4-install/share/Geant4-10.6.1/examples/pyramid/X$

I can not figure where is the problem, if it missing library
or the linux or what is happening
and the compiler run the examples of the Geant 4 well but not that code i do not know why !!!

okay for your concern – i try to solve it with a friend – and i comment #ifdef G4VIS_USE and #ifdef G4UI_USE
and it worked as well but that is not the solution
so I can ask know what is the library that control all of that ?

Ah, yes. Sorry, I did not notice #ifdef G4VIS_USE in your code. They are no longer set in Geant4 10.6. From the Release Notes for 10.6:

  • The preprocessor macros G4UI_USE and G4VIS_USE are removed.