Compiling 10.07.p01 on Ubuntu 22.04

Dear Geant4 users,

I have been successfully using Geant4.10.07.p01 on an older computer with Ubuntu 20.04 LTS. I have recently tried to compile Geant4 on a newer system running Ubuntu 22.04 LTS with g++ version 11.2.0. When I try to compile Geant4 I receive the following error (just the top few lines shown) about the new declaration of fsqrt:

/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:73:10: error: ambiguating new declaration of ‘G4double fsqrt(G4double)’
73 | G4double fsqrt(G4double arg) { return std::sqrt(arg); }
| ^~~~~
In file included from /usr/include/c++/11/cmath:45,
from /usr/include/c++/11/complex:44,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Types.hh:74,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4ios.hh:35,
from /home/david/src/geant4.10.07.p01/source/global/management/include/globals.hh:35,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4ThreeVector.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:37,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:36:20: note: old declaration ‘float fsqrt(double)’
36 | __MATHCALL_NARROW (__MATHCALL_NAME (sqrt), __MATHCALL_REDIR_NAME2 (sqrt), 1);
| ^~~~~~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc: In member function ‘void G4tgrEvaluator::AddCommonFunctions()’:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:14: error: no matching function for call to ‘setFunction(const char [5], float (&)(double) noexcept)’
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~~

Can anyone point me in the right direction to fix this compilation error?

Many thanks,

David

I got exactly the same error on the same platform, but with Geant4.10.06.p03.

Any clues?

Thanks,
Fabio

Hi Fabio,

I’m afraid I don’t know what it causing the error.

Can someone else help?

Thanks,

David

Hello,

I have exactly the same problem, with the same output as you, in Ubuntu 22.04, but with Geant4.10.05.p01. Please help!

Thank you,

Jaime

At least for the 10.6/10.7 errors, what CMake settings are you using, and could you post an example of a compile command (and hence flags) with make VERBOSE=1 or similar please?

These versions have been compiled o.k. (to my knowledge without patches/unusual settings) on CentOS7 with GCC 11.2. I don’t have an Ubuntu system to hand right now, but can check in the next week or two.

However, I’d strongly recommend updating to the latest Geant4 11.0.2 to get the best support for the newest compilers, or at least the last patch to the 10.7 series (10.7.3). Geant4 10.5 is no longer being patched, and it’s likely there’ll be no further patches to the 10.6 series.

Dear Benjamin,

Many thanks for the message. My cmake command is as follows:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4.10.07.p01-2204 -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_INSTALL_DATADIR=/home/david/src/geant4_data -DGEANT4_USE_QT=ON -DGEANT4_USE_RAYTRACER_X11=ON …/geant4.10.07.p01

When I then run make VERBOSE=1 -j16 I get an error when the compilation is 93 % finished - I have included an extract of the terminal output below and have made the first two errors bold. Any help you can offer would be much appreciated.

Kind regards,

David

[ 93%] Building CXX object source/CMakeFiles/G4vis_management.dir/visualization/management/src/G4GraphicsSystemList.cc.o
cd /home/david/src/geant4.10.07.p01-build-2204b/source && /usr/bin/c++ -DG4LIB_BUILD_DLL -DG4vis_management_EXPORTS -I/home/david/src/geant4.10.07.p01/source/visualization/management/include -I/home/david/src/geant4.10.07.p01/source/digits_hits/detector/include -I/home/david/src/geant4.10.07.p01/source/digits_hits/digits/include -I/home/david/src/geant4.10.07.p01/source/digits_hits/hits/include -I/home/david/src/geant4.10.07.p01/source/digits_hits/scorer/include -I/home/david/src/geant4.10.07.p01/source/digits_hits/utils/include -I/home/david/src/geant4.10.07.p01-build-2204b/source/geometry/include -I/home/david/src/geant4.10.07.p01/source/geometry/biasing/include -I/home/david/src/geant4.10.07.p01/source/geometry/divisions/include -I/home/david/src/geant4.10.07.p01/source/geometry/magneticfield/include -I/home/david/src/geant4.10.07.p01/source/geometry/management/include -I/home/david/src/geant4.10.07.p01/source/geometry/navigation/include -I/home/david/src/geant4.10.07.p01/source/geometry/solids/Boolean/include -I/home/david/src/geant4.10.07.p01/source/geometry/solids/CSG/include -I/home/david/src/geant4.10.07.p01/source/geometry/solids/specific/include -I/home/david/src/geant4.10.07.p01/source/geometry/volumes/include -I/home/david/src/geant4.10.07.p01-build-2204b/source/global/include -I/home/david/src/geant4.10.07.p01/source/global/HEPGeometry/include -I/home/david/src/geant4.10.07.p01/source/global/HEPNumerics/include -I/home/david/src/geant4.10.07.p01/source/global/HEPRandom/include -I/home/david/src/geant4.10.07.p01/source/global/management/include -I/home/david/src/geant4.10.07.p01/source/externals/clhep/include -I/home/david/src/geant4.10.07.p01/source/externals/ptl/include -I/home/david/src/geant4.10.07.p01/source/graphics_reps/include -I/home/david/src/geant4.10.07.p01/source/intercoms/include -I/home/david/src/geant4.10.07.p01/source/materials/include -I/home/david/src/geant4.10.07.p01/source/externals/zlib/include -I/home/david/src/geant4.10.07.p01/source/externals/zlib/src -I/home/david/src/geant4.10.07.p01-build-2204b/source/externals/zlib -I/home/david/src/geant4.10.07.p01/source/particles/adjoint/include -I/home/david/src/geant4.10.07.p01/source/particles/bosons/include -I/home/david/src/geant4.10.07.p01/source/particles/hadrons/barions/include -I/home/david/src/geant4.10.07.p01/source/particles/hadrons/ions/include -I/home/david/src/geant4.10.07.p01/source/particles/hadrons/mesons/include -I/home/david/src/geant4.10.07.p01/source/particles/leptons/include -I/home/david/src/geant4.10.07.p01/source/particles/management/include -I/home/david/src/geant4.10.07.p01/source/particles/shortlived/include -I/home/david/src/geant4.10.07.p01/source/particles/utils/include -I/home/david/src/geant4.10.07.p01/source/track/include -I/home/david/src/geant4.10.07.p01/source/event/include -I/home/david/src/geant4.10.07.p01/source/processes/biasing/generic/include -I/home/david/src/geant4.10.07.p01/source/processes/biasing/importance/include -I/home/david/src/geant4.10.07.p01/source/processes/biasing/management/include -I/home/david/src/geant4.10.07.p01/source/processes/cuts/include -I/home/david/src/geant4.10.07.p01/source/processes/decay/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/adjoint/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/management/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/models/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/molecules/management/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/molecules/types/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/processes/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/dna/utils/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/highenergy/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/lowenergy/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/muons/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/pii/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/polarisation/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/standard/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/utils/include -I/home/david/src/geant4.10.07.p01/source/processes/electromagnetic/xrays/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/cross_sections/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/management/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/abla/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/abrasion/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/binary_cascade/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/cascade/cascade/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/coherent_elastic/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/ablation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/evaporation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/fermi_breakup/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/fission/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/gem_evaporation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/handler/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/management/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/multifragmentation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/photon_evaporation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/de_excitation/util/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/em_dissociation/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/fission/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/gamma_nuclear/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/im_r_matrix/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/inclxx/incl_physics/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/inclxx/interface/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/inclxx/utils/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/lend/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/lepto_nuclear/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/management/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/particle_hp/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/parton_string/diffraction/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/parton_string/hadronization/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/parton_string/management/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/parton_string/qgsm/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/pre_equilibrium/exciton_model/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/qmd/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/quasi_elastic/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/radioactive_decay/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/rpg/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/theo_high_energy/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/models/util/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/processes/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/stopping/include -I/home/david/src/geant4.10.07.p01/source/processes/hadronic/util/include -I/home/david/src/geant4.10.07.p01/source/processes/management/include -I/home/david/src/geant4.10.07.p01/source/processes/optical/include -I/home/david/src/geant4.10.07.p01/source/processes/parameterisation/include -I/home/david/src/geant4.10.07.p01/source/processes/scoring/include -I/home/david/src/geant4.10.07.p01/source/processes/solidstate/channeling/include -I/home/david/src/geant4.10.07.p01/source/processes/solidstate/phonon/include -I/home/david/src/geant4.10.07.p01/source/processes/transportation/include -I/home/david/src/geant4.10.07.p01/source/analysis/accumulables/include -I/home/david/src/geant4.10.07.p01/source/analysis/csv/include -I/home/david/src/geant4.10.07.p01/source/analysis/factory/include -I/home/david/src/geant4.10.07.p01/source/analysis/g4tools/include -I/home/david/src/geant4.10.07.p01/source/analysis/hntools/include -I/home/david/src/geant4.10.07.p01/source/analysis/management/include -I/home/david/src/geant4.10.07.p01/source/analysis/root/include -I/home/david/src/geant4.10.07.p01/source/analysis/xml/include -I/home/david/src/geant4.10.07.p01/source/tracking/include -I/home/david/src/geant4.10.07.p01/source/visualization/modeling/include -I/home/david/src/geant4.10.07.p01/source/run/include -I/home/david/src/geant4.10.07.p01/source/tasking/include -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -pthread -ftls-model=initial-exec -O3 -DNDEBUG -fno-trapping-math -ftree-vectorize -fno-math-errno -fPIC -MD -MT source/CMakeFiles/G4vis_management.dir/visualization/management/src/G4GraphicsSystemList.cc.o -MF CMakeFiles/G4vis_management.dir/visualization/management/src/G4GraphicsSystemList.cc.o.d -o CMakeFiles/G4vis_management.dir/visualization/management/src/G4GraphicsSystemList.cc.o -c /home/david/src/geant4.10.07.p01/source/visualization/management/src/G4GraphicsSystemList.cc
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:73:10: error: ambiguating new declaration of ‘G4double fsqrt(G4double)’
** 73 | G4double fsqrt(G4double arg) { return std::sqrt(arg); }**
| ^~~~~
In file included from /usr/include/c++/11/cmath:45,
from /usr/include/c++/11/complex:44,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Types.hh:74,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4ios.hh:35,
from /home/david/src/geant4.10.07.p01/source/global/management/include/globals.hh:35,
from /home/david/src/geant4.10.07.p01/source/global/management/include/G4ThreeVector.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:37,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:36:20: note: old declaration ‘float fsqrt(double)’
36 | __MATHCALL_NARROW (__MATHCALL_NAME (sqrt), __MATHCALL_REDIR_NAME2 (sqrt), 1);
| ^~~~~~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc: In member function ‘void G4tgrEvaluator::AddCommonFunctions()’:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:14: error: no matching function for call to ‘setFunction(const char [5], float (&)(double) noexcept)’
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~~
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:125:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char*, double (*)())’ (near match)
125 | void setFunction(const char * name, double (*fun)());
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:125:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()()’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float ()(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:135:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char
, double (*)(double))’ (near match)
135 | void setFunction(const char * name, double (*fun)(double));
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:135:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()(double)’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float ()(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:145:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char
, double (*)(double, double))’ (near match)
145 | void setFunction(const char * name, double (*fun)(double,double));
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:145:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()(double, double)’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float ()(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:155:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char
, double (*)(double, double, double))’ (near match)
155 | void setFunction(const char * name, double (*fun)(double,double,double));
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:155:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()(double, double, double)’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float ()(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:165:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char
, double (*)(double, double, double, double))’ (near match)
165 | void setFunction(const char * name,
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:165:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()(double, double, double, double)’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float ()(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4Evaluator.hh:33,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrEvaluator.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:31:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:176:8: note: candidate: ‘void HepTool::Evaluator::setFunction(const char
, double (*)(double, double, double, double, double))’ (near match)
176 | void setFunction(const char * name,
| ^~~~~~~~~~~
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Evaluator/Evaluator.h:176:8: note: conversion of argument 2 would be ill-formed:
/home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc:95:24: error: invalid conversion from ‘float ()(double) noexcept’ to ‘double ()(double, double, double, double, double)’ [-fpermissive]
95 | setFunction(“sqrt”, (*fsqrt));
| ~^~~~~~~
| |
| float (*)(double) noexcept
In file included from /home/david/src/geant4.10.07.p01/source/materials/include/G4Element.hh:89,
from /home/david/src/geant4.10.07.p01/source/materials/include/G4Material.hh:103,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrMaterial.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrVolumeMgr.hh:43,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrSolid.cc:39:
/home/david/src/geant4.10.07.p01/source/materials/include/G4Isotope.hh:81:31: warning: declaration of ‘m’ shadows a global declaration [-Wshadow]
81 | G4int m = 0); //isomer level
| ~~~~~~^
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4SystemOfUnits.hh:36,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrSolid.cc:36:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Units/SystemOfUnits.h:109:27: note: shadowed declaration is here
109 | static constexpr double m = meter;
| ^
In file included from /home/david/src/geant4.10.07.p01/source/materials/include/G4Element.hh:89,
from /home/david/src/geant4.10.07.p01/source/materials/include/G4Material.hh:103,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrMaterial.hh:38,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/include/G4tgrVolumeMgr.hh:43,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrVolumeDivision.cc:35:
/home/david/src/geant4.10.07.p01/source/materials/include/G4Isotope.hh:81:31: warning: declaration of ‘m’ shadows a global declaration [-Wshadow]
81 | G4int m = 0); //isomer level
| ~~~~~~^
In file included from /home/david/src/geant4.10.07.p01/source/global/management/include/G4SystemOfUnits.hh:36,
from /home/david/src/geant4.10.07.p01/source/persistency/ascii/src/G4tgrVolumeDivision.cc:33:
/home/david/src/geant4.10.07.p01/source/externals/clhep/include/CLHEP/Units/SystemOfUnits.h:109:27: note: shadowed declaration is here
109 | static constexpr double m = meter;
| ^
make[2]: *** [source/CMakeFiles/G4persistency.dir/build.make:398: source/CMakeFiles/G4persistency.dir/persistency/ascii/src/G4tgrEvaluator.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs…

Hi David, thanks for the detailed info - I had a search back through the release notes, and I think this problem is fixed from 10.7.3 - see the “Persistency” section in the patch release notes and the associated Bugzilla report. That bug is for Fedora, but looks identical.

If an earlier version than 10.7.3 is absolutely required, then the changes to persistency/ascii can be back ported at the developer’s own risk.

1 Like

Hi Benjamin,

Many thanks for your help. I can confirm that your suggestion works.

I have edited the /geant4.10.07.p01/source/persistency/ascii/src/G4tgrEvaluator.cc file and changed:

G4double sqrt(G4double arg) { return std::sqrt(arg); }
to:
G4double fltsqrt(G4double arg) { return std::sqrt(arg); }

and
setFunction(“sqrt”, (*sqrt));
to
setFunction(“sqrt”, (*fltsqrt));

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.