QT5 error on building a Geant4 project

Hi,

I have a GEANT4 project, which has been build and tested in the past.
I am trying to get it running in my desktop (Fedora 33).

I have installed Geant4.10.06.p03 on my machine,
gcc.exec (GCC) 9.2.0

I can successfully run examples on my machine. I tried the basic example B1 and B4.

While, trying to “make” this project, I end up having this error -

Using global libraries …

Linking sunShare_co69_to_ni69

/usr/bin/ld: /usr/lib64/libQt5Core.so: undefined reference to `std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource()@GLIBCXX_3.4.28

/usr/bin/ld: /usr/lib64/libQt5Core.so: undefined reference to `vtable for std::pmr::monotonic_buffer_resource@GLIBCXX_3.4.28’

collect2: error: ld returned 1 exit status

make: *** [/home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/geant4make/config/binmake.gmk:410: /home/mansi/geant4_workdir/bin/Linux-g++/sunShare_co69_to_ni69] Error 1

[mansi@localhost geant4_SuN_bDecay]$ cd

It seems the error is with Qt5.
I had build Geant4 in machine with USE_QT=ON
Any help on how to resolve it.

Wishes
M

Could you please try building with CMake/make rather than the deprecated GNUmakefiles please? This looks like a configuration/setup issue with the system (or Geant4 scripts) as if Qt5 and gcc have been installed by the system package manager, everything should work.

Ok thanks.

The project doesn’t contain any CMakeList.txt file.
It only has a GNUMakefile.

Wishes
M

In the meantime, could you post the results of:

$ env | sort

and

$ make CPPVERBOSE=1

so we can check what settings there are in the environment and exactly what compile commands are being used.

Hi,

Thanks.
I have attached the output of these.

Wishes
M
cpp.txt (2.9 KB)
env.txt (5.1 KB)

please check the outputs.

wishes
M

Try running:

$ ldd /usr/lib64/libQt5Core.so | grep libstdc++

This should print the standard library being used, something similar to libstdc++.so.6 => /lib64/libstdc++.so.6. Take the path to the lib and run:

$ strings <path to libstdc++> | grep GLIBCXX

and post the output here. I suspect you have a mismatch between the compiler and standard library somewhere. Also, what is printed by:

$ which g++

and

$ `which g++` --version

Thanks,

[mansi@localhost ~]$ ldd /usr/lib64/libQt5Core.so | grep libstdc++
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fd885fe8000)
[mansi@localhost ~]$

[mansi@localhost ~]$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

GLIBCXX_3.4

GLIBCXX_3.4.1

GLIBCXX_3.4.2

GLIBCXX_3.4.3

GLIBCXX_3.4.4

GLIBCXX_3.4.5

GLIBCXX_3.4.6

GLIBCXX_3.4.7

GLIBCXX_3.4.8

GLIBCXX_3.4.9

GLIBCXX_3.4.10

GLIBCXX_3.4.11

GLIBCXX_3.4.12

GLIBCXX_3.4.13

GLIBCXX_3.4.14

GLIBCXX_3.4.15

GLIBCXX_3.4.16

GLIBCXX_3.4.17

GLIBCXX_3.4.18

GLIBCXX_3.4.19

GLIBCXX_3.4.20

GLIBCXX_3.4.21

GLIBCXX_3.4.22

GLIBCXX_3.4.23

GLIBCXX_3.4.24

GLIBCXX_3.4.25

GLIBCXX_3.4.26

GLIBCXX_3.4.27

GLIBCXX_3.4.28

GLIBCXX_DEBUG_MESSAGE_LENGTH

[mansi@localhost ~]$

[mansi@localhost ~]$ which g++

~/mesasdk/bin/g++

[mansi@localhost ~]$

[mansi@localhost ~]$ which g++ --version

g++.exec (GCC) 9.2.0

Copyright (C) 2019 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I think this is the problem - gcc 9.2 only provides GLIBCXX_3.4.27. The Qt5 install is the system one, which I’d guess is gcc 9.3.0, check that /usr/bin/g++ is indeed that.

You’ll need to remove ~/mesasdk/bin/g++ from your PATH then try recompiling.

Hi, Thanks

After removing. > ~/mesasdk/bin/g++, I can successfully compile the code.

this is what I get at the end,

####-------------------------------------------------------####

/home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6

@@@ G4ParticleHPInelastic instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Inelastic

@@@ G4ParticleHPInelasticData instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6

NeutronHP: /Capture file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Capture/CrossSection/6_nat_Carbon

NeutronHP: /Elastic file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Elastic/CrossSection/6_nat_Carbon

NeutronHP: /Inelastic file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Inelastic/CrossSection/6_nat_Carbon

ERROR: Can not open a macro file <vis.mac>. Set macro path with “/control/macroPath” if needed.

-------- WWWW ------- G4Exception-START -------- WWWW -------

*** G4Exception : UIMAN0123

issued by : G4UImanager::ApplyCommand

Command aborted (400)

Error code : 400

*** This is just a warning message. ***

-------- WWWW -------- G4Exception-END --------- WWWW -------

Why a GUI interface doesn’t come up, as usually it should ? I attached the linked file also.
Just still learning GEANT4, so getting acquainted.

Wishes
M
sunShare_co69_to_ni69.cc (4.1 KB)

make sure that the macro file is in the same folder as your compiled binary, or specify a folder with the command /control/macroPath <path>
easiest is just to copy all macro files to the correct location :slight_smile:

Thanks,

I copied the macro files to the folder which contained the binary.
But, now it gives the following error :slightly_frowning_face:

####-------------------------------------------------------####
/home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6
@@@ G4ParticleHPInelastic instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Inelastic
@@@ G4ParticleHPInelasticData instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6
NeutronHP: /Capture file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Capture/CrossSection/6_nat_Carbon
NeutronHP: /Elastic file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Elastic/CrossSection/6_nat_Carbon
NeutronHP: /Inelastic file for Z = 6, A = 12 is not found and NeutronHP will use /home/mansi/Geant4.10.6/geant4.10.06.p03-install/share/Geant4-10.6.3/data/G4NDL4.6/Inelastic/CrossSection/6_nat_Carbon
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 32
Current serial number in output stream: 31
[mansi@localhost Linux-g++]$ ls
AD.vis.mac a.mac ‘HISTCONTROL=ignoredups’ SQ.vis.mac sunShare_co69_to_ni69 vis.mac
[mansi@localhost Linux-g++]$ pwd
/home/mansi/geant4_workdir/bin/Linux-g++
[mansi@localhost Linux-g++]$

could be an error with the graphics driver?

Okay,
But if I run the examples, a graphics window did pop up.

M

could it be that you chose a different visualization driver than in the examples? The Visualization Drivers — Book For Application Developers 10.7 documentation

I would compare the macros, also the init_vis.mac or vis.mac, or copy from the examples that work for you…

Thanks, I shall check that.

Just on the same topic, also if I try to run this project now, on my MacBook (Mojave 10.14),
which has Geant4.10.04 version installed.

This is error I get, when I try to execute it.

####-------------------------------------------------------####

/Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5

@@@ G4ParticleHPInelastic instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Inelastic

@@@ G4ParticleHPInelasticData instantiated for particle neutron data directory variable is G4NEUTRONHPDATA pointing to /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5

NeutronHP: /Capture file for Z = 8, A = 18 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Capture/CrossSection/8_17_Oxygen

NeutronHP: /Elastic file for Z = 8, A = 18 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Elastic/CrossSection/8_17_Oxygen

NeutronHP: /Inelastic file for Z = 8, A = 18 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Inelastic/CrossSection/8_17_Oxygen

NeutronHP: /Capture file for Z = 6, A = 12 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Capture/CrossSection/6_nat_Carbon

NeutronHP: /Elastic file for Z = 6, A = 12 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Elastic/CrossSection/6_nat_Carbon

NeutronHP: /Inelastic file for Z = 6, A = 12 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Inelastic/CrossSection/6_nat_Carbon

NeutronHP: /Capture file for Z = 6, A = 13 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Capture/CrossSection/6_nat_Carbon

NeutronHP: /Elastic file for Z = 6, A = 13 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Elastic/CrossSection/6_nat_Carbon

NeutronHP: /Inelastic file for Z = 6, A = 13 is not found and NeutronHP will use /Users/mansisaxena/geant4_10.04/geant4.10.04-install/share/Geant4-10.4.3/data/G4NDL4.5/Inelastic/CrossSection/6_nat_Carbon

G4OpenGLXViewer::G4OpenGLXViewer failed to allocate a standard colormap.

X Error of failed request: BadMatch (invalid parameter attributes)

Major opcode of failed request: 1 (X_CreateWindow)

Serial number of failed request: 26

Current serial number in output stream: 33

Also, when I do “make”, there were a lot of warnings earlier on (some below), but it creates a executable at the end.

Mansis-MacBook-Air:geant4_SuN_bDecay mansisaxena$ make

Making dependency for file sunShare_co69_to_ni69.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/SuNBetaDecay.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/SteppingAction.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/RunAction.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/PrimaryGeneratorAction.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/EventAction.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Making dependency for file src/DetectorConstruction.cc …
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
g++.exec: error: unrecognized command line option ‘-stdlib=libc++’
Compiling DetectorConstruction.cc …
clang: warning: -lCore: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lImt: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lRIO: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lNet: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lHist: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lGraf: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lGraf3d: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lGpad: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lROOTVecOps: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lTree: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lTreePlayer: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lRint: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lPostscript: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lMatrix: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lPhysics: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lMathCore: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lThread: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lMultiProc: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lROOTDataFrame: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lpthread: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -lm: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: -ldl: ‘linker’ input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: ‘-L/Users/mansisaxena/build_6.18/lib’ [-Wunused-command-line-argument]

Thanks. Really appreciate the help. I would like to get it up and running in my MacBook laptop too.

Wishes
M