Compiling Geant4 11.1.0 beta failed on "Built target G4physicslist"s

Hello,

Per a researcher’s request, I attempt to build 11.1.0 beta source on HPC cluster, a RHEL7.9 platform.
I git clone the code from
geant4 / geant4 · GitLab

I used the following options for cmake in a build directory
cmake -DCMAKE_INSTALL_PREFIX=/risapps/rhel7/geant4/11.1.0
-DCMAKE_C_COMPILER=/risapps/rhel7/gcc/9.3.0/bin/gcc
-DCMAKE_CXX_COMPILER=/risapps/rhel7/gcc/9.3.0/bin/g++
-DXERCESC_ROOT_DIR=/risapps/rhel7/xerces-c/3.2.2
-DGEANT4_USE_GDML=ON
-DGEANT4_USE_QT=ON
-DGEANT4_USE_XM=OFF
-DGEANT4_USE_OPENGL_X11=ON
-DGEANT4_USE_RAYTRACER_X11=OFF
-DGEANT4_BUILD_MULTITHREADED=ON
-DGEANT4_USE_PYTHON=ON
-DGEANT4_USE_SMARTSTACK=ON
-DGEANT4_INSTALL_DATA=ON
-DGEANT4_BUILD_TLS_MODEL=global-dynamic
/risapps/build7/geant4-11.1.0/geant4 |tee cmake.log

cmake.log look fine. However, the output for “make j 6 | tee make.log” failed at

[ 97%] Building CXX object source/CMakeFiles/G4physicslists.dir/physics_lists/util/src/G4WarnPLStatus.cc.o
[ 97%] Linking CXX shared library …/BuildProducts/lib64/libG4physicslists.so
[ 97%] Built target G4physicslists
make: *** [all] Error 2

I also notice many similar errors
/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc:458:27: error: expected type-specifier
458 | auto material = new Qt3DExtras::QDiffuseSpecularMaterial();
| ^~~~~~~~~~
/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc: In member function ‘virtual void G4Qt3DSceneHandler::AddPrimitive(const G4Circle&)’:

May you please advise if anything I neglect? Thank you!

Rong

Hello Rong,
The error seems Qt related, which Qt did CMake find during configure?

If you don’t need visualization, or as a test, you could turn off the use of Qt.

Gunter

Hello Gunter,

Thank you for reply. The researcher wants to build geant4 with Qt on.

I reviewed cmake log file (the cmake with options outputs to this file), I only finds two lines related to Qt:
GEANT4_USE_QT: Build Geant4 with Qt5 support
GEANT4_USE_QT3D: Build Geant4 Qt3D driver

Maybe CMake did not find which Qt to use? Our system is RHEL7.9, command ‘rpm -qa | grep -i Qt’ returns
qt-settings-19-23.12.el7.noarch
qt-4.8.7-9.el7_9.x86_64
qt-x11-4.8.7-9.el7_9.x86_64
qt-devel-4.8.7-9.el7_9.x86_64
qt3-devel-3.3.8b-51.el7.x86_64
and many qt5-* rpms.
Would you please advise how to fix cmake option if this is the cause?

Thank you!
Rong

Could you run and post the output of

$ make VERBOSE=1

and post the full compile/link line of the failing step please?

Hello @bmorgan

In the existing build directory, I ran the command

 make VERBOSE=1 | tee make-verbose.log

If I understand what you meant, this is the step just before error starts:

[ 93%] Building CXX object source/CMakeFiles/G4visQt3D.dir/visualization/Qt3D/src/G4Qt3DSceneHandler.cc.o
cd /risapps/build7/geant4-11.1.0/11.1.0-build/source && /risapps/rhel7/gcc/9.3.0/bin/g++ -DG4LIB_BUILD_DLL -DG4VIS_BUILD_QT3D_DRIVER -DG4visQt3D_EXPORTS -DPTL_BUILD_DLL -DQT_3DCORE_LIB -DQT_3DEXTRAS_LIB -DQT_3DINPUT_LIB -DQT_3DLOGIC_LIB -DQT_3DRENDER_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/include -I/risapps/build7/geant4-11.1.0/11.1.0-build/source/geometry/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/biasing/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/divisions/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/magneticfield/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/navigation/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/solids/Boolean/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/solids/CSG/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/solids/specific/include -I/risapps/build7/geant4-11.1.0/geant4/source/geometry/volumes/include -I/risapps/build7/geant4-11.1.0/11.1.0-build/source/global/include -I/risapps/build7/geant4-11.1.0/geant4/source/global/HEPGeometry/include -I/risapps/build7/geant4-11.1.0/geant4/source/global/HEPNumerics/include -I/risapps/build7/geant4-11.1.0/geant4/source/global/HEPRandom/include -I/risapps/build7/geant4-11.1.0/geant4/source/global/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/externals/clhep/include -I/risapps/build7/geant4-11.1.0/geant4/source/externals/ptl/include -I/risapps/build7/geant4-11.1.0/11.1.0-build/source/externals/ptl/src -I/risapps/build7/geant4-11.1.0/geant4/source/graphics_reps/include -I/risapps/build7/geant4-11.1.0/geant4/source/intercoms/include -I/risapps/build7/geant4-11.1.0/geant4/source/interfaces/basic/include -I/risapps/build7/geant4-11.1.0/geant4/source/interfaces/common/include -I/risapps/build7/geant4-11.1.0/geant4/source/visualization/modeling/include -I/risapps/build7/geant4-11.1.0/geant4/source/digits_hits/detector/include -I/risapps/build7/geant4-11.1.0/geant4/source/digits_hits/digits/include -I/risapps/build7/geant4-11.1.0/geant4/source/digits_hits/hits/include -I/risapps/build7/geant4-11.1.0/geant4/source/digits_hits/scorer/include -I/risapps/build7/geant4-11.1.0/geant4/source/digits_hits/utils/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/adjoint/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/bosons/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/hadrons/barions/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/hadrons/ions/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/hadrons/mesons/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/leptons/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/shortlived/include -I/risapps/build7/geant4-11.1.0/geant4/source/particles/utils/include -I/risapps/build7/geant4-11.1.0/geant4/source/track/include -I/risapps/build7/geant4-11.1.0/geant4/source/materials/include -I/risapps/build7/geant4-11.1.0/geant4/source/tracking/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/biasing/generic/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/biasing/importance/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/biasing/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/cuts/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/decay/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/adjoint/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/models/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/molecules/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/molecules/types/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/processes/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/dna/utils/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/highenergy/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/lowenergy/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/muons/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/pii/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/polarisation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/standard/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/utils/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/electromagnetic/xrays/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/cross_sections/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/abla/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/abrasion/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/binary_cascade/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/cascade/cascade/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/coherent_elastic/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/ablation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/evaporation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/fermi_breakup/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/fission/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/gem_evaporation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/handler/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/multifragmentation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/photon_evaporation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/de_excitation/util/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/em_dissociation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/fission/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/gamma_nuclear/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/im_r_matrix/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/inclxx/incl_physics/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/inclxx/interface/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/inclxx/utils/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/lend/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/lepto_nuclear/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/particle_hp/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/parton_string/diffraction/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/parton_string/hadronization/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/parton_string/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/parton_string/qgsm/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/pre_equilibrium/exciton_model/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/qmd/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/quasi_elastic/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/radioactive_decay/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/models/theo_high_energy/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/processes/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/stopping/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/hadronic/util/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/optical/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/parameterisation/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/scoring/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/solidstate/channeling/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/solidstate/phonon/include -I/risapps/build7/geant4-11.1.0/geant4/source/processes/transportation/include -I/risapps/build7/geant4-11.1.0/geant4/source/visualization/management/include -I/risapps/build7/geant4-11.1.0/geant4/source/externals/g4tools/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/./mkspecs/linux-g++ -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/Qt3DCore -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/Qt3DExtras -isystem /usr/include/qt5/Qt3DRender -isystem /usr/include/qt5/Qt3DInput -isystem /usr/include/qt5/Qt3DLogic -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -pthread -ftls-model=global-dynamic -O3 -DNDEBUG -fno-trapping-math -ftree-vectorize -fno-math-errno -fPIC -pthread -fPIC -std=c++17 -MD -MT source/CMakeFiles/G4visQt3D.dir/visualization/Qt3D/src/G4Qt3DSceneHandler.cc.o -MF CMakeFiles/G4visQt3D.dir/visualization/Qt3D/src/G4Qt3DSceneHandler.cc.o.d -o CMakeFiles/G4visQt3D.dir/visualization/Qt3D/src/G4Qt3DSceneHandler.cc.o -c /risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc
/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc: In member function ‘virtual void G4Qt3DSceneHandler::AddPrimitive(const G4Polyline&)’:
/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc:306:65: error: no matching function for call to ‘Qt3DRender::QBuffer::QBuffer(Qt3DRender::QGeometry*&)’
306 | auto polylineBuffer = new Qt3DRender::QBuffer(polylineGeometry);
| ^
In file included from /usr/include/qt5/Qt3DRender/Qt3DRender:13,
from /usr/include/qt5/Qt3DExtras/Qt3DExtrasDepends:6,
from /usr/include/qt5/Qt3DExtras/Qt3DExtras:3,
from /risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/include/G4Qt3DViewer.hh:35,
from /risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc:49:
/usr/include/qt5/Qt3DRender/qbuffer.h:98:14: note: candidate: ‘Qt3DRender::QBuffer::QBuffer(Qt3DRender::QBuffer::BufferType, Qt3DCore::QNode*)’
98 | explicit QBuffer(BufferType ty = QBuffer::VertexBuffer, Qt3DCore::QNode parent = nullptr);
| ^~~~~~~
/usr/include/qt5/Qt3DRender/qbuffer.h:98:33: note: no known conversion for argument 1 from ‘Qt3DRender::QGeometry
’ to ‘Qt3DRender::QBuffer::BufferType’
98 | explicit QBuffer(BufferType ty = QBuffer::VertexBuffer, Qt3DCore::QNode *parent = nullptr);
| ~^~~~~~~~~~~~~~~~
/risapps/build7/geant4-11.1.0/geant4/source/visualization/Qt3D/src/G4Qt3DSceneHandler.cc:325:23: error: expected type-specifier
325 | auto material = new Qt3DExtras::QDiffuseSpecularMaterial();

followed by many similar errors for “…error: expected type-specifier”

Regards,
Rong

Thanks for the info @ryao-mdanderson! Could you confirm which version of Qt5 is installed via the rpms, and also what the output of the cmake step was please?

It looks like the Qt5 used when building is older than 5.15, but the build of the Qt3D driver should not have activated if this was the case.

Hi @bmorgan

Qt5 rpm on our system is 5.9.7. I also see two qt3 packages qt3-3.3.8b and qt3-devel-3.3.8b.

The camke output is as the following:
– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /risapps/rhel7/gcc/9.3.0/bin/gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /risapps/rhel7/gcc/9.3.0/bin/g++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
– Performing Test HAVE_TLS
– Performing Test HAVE_TLS - Success
– Found EXPAT: /usr/lib64/libexpat.so (found version “2.1.0”)
– Found XercesC: /risapps/rhel7/xerces-c/3.2.2/lib64/libxerces-c.so (found version “3.2.2”)
– Found OpenGL: /usr/lib64/libOpenGL.so
– Found X11: /usr/include
– Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
– Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/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
– Pre-configuring dataset G4NDL (4.7)
– Pre-configuring dataset G4EMLOW (8.1)
– Pre-configuring dataset PhotonEvaporation (5.7)
– Pre-configuring dataset RadioactiveDecay (5.6)
– Pre-configuring dataset G4PARTICLEXS (4.0)
– Pre-configuring dataset G4PII (1.3)
– Pre-configuring dataset RealSurface (2.2)
– Pre-configuring dataset G4SAIDDATA (2.0)
– Pre-configuring dataset G4ABLA (3.1)
– Pre-configuring dataset G4INCL (1.0)
– Pre-configuring dataset G4ENSDFSTATE (2.3)
– Looking for sys/types.h
– Looking for sys/types.h - found
– Looking for stdint.h
– Looking for stdint.h - found
– Looking for stddef.h
– Looking for stddef.h - found
– Check size of off64_t
– Check size of off64_t - done
– Looking for fseeko
– Looking for fseeko - found
– Looking for unistd.h
– Looking for unistd.h - found
– Building PTL with option BUILD_STATIC_LIBS - OFF
– Building PTL with option BUILD_SHARED_LIBS - ON
– Building PTL with option BUILD_OBJECT_LIBS -
– Building PTL with CMAKE_CXX_STANDARD - 17
– Building PTL with option PTL_USE_COVERAGE -
– Building PTL with option PTL_USE_SANITIZER -
– Building PTL with option PTL_USE_CLANG_TIDY -
– Building PTL with option PTL_USE_TBB - OFF
– Building PTL with option PTL_USE_LOCKS - OFF
– Building PTL with option PTL_INSTALL_HEADERS - ON
– Building PTL with option PTL_INSTALL_CONFIG - ON
– Looking for pthread.h
– Looking for pthread.h - found
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Check if compiler accepts -pthread
– Check if compiler accepts -pthread - yes
– Found Threads: TRUE
– Found PythonInterp: /risapps/rhel7/python/3.10.2/bin/python3 (found suitable version “3.10.2”, minimum required is “3.0”)
– Found PythonLibs: /risapps/rhel7/python/3.10.2/lib/libpython3.10.so (found version “3.10.2”)
– Found Boost: /risapps/rhel7/boost/1.78.0/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version “1.78.0”, minimum required is “1.65”) found components: python310
– The following Geant4 features are enabled:
CMAKE_CXX_STANDARD: Compiling against C++ Standard ‘17’
GEANT4_BUILD_MULTITHREADED: Build multithread enabled libraries
GEANT4_BUILD_TLS_MODEL: Building with TLS model ‘global-dynamic’
GEANT4_USE_SYSTEM_EXPAT: Using system EXPAT library
GEANT4_USE_GDML: Building Geant4 with GDML support
GEANT4_USE_SMARTSTACK: Use smart track stack
GEANT4_USE_OPENGL_X11: Build Geant4 OpenGL driver with X11 support
GEANT4_USE_QT: Build Geant4 with Qt5 support
GEANT4_USE_QT3D: Build Geant4 Qt3D driver
GEANT4_USE_PYTHON: Building bindings for Python 3.10

– Configuring done
– Generating done
– Build files have been written to: /risapps/build7/geant4-11.1.0/11.1.0-build

Please let me know if you need more information.

Thank you!
Rong

Thanks, that’s very helpful and allowed me to reproduce the issue on a CentOS7 machine with the same Qt rpms. It’s actually a bug in the check we do on the detected Qt version vs the minimum required to support Qt3D use. It was using a plain numerical check instead of a semantic version check. It’s a simple enough patch, which I’ve attached here and will also be applied upstream for the actual 11.1 release.

11.1.0.beta-qt_version.patch.txt (660 Bytes)

Hello @bmorgan

Thanks for the patch. Do you mean I should re-check out the github code and build again? I will test and keep you updated today.

Thank you!
Rong

Hi @ryao-mdanderson, no need to re-checkout, you should be able to cd into the directory where you already checked out, download the patch I attached above, and run

$ patch -p1 < 11.1.0.beta-qt_version.patch.txt

apply the fix. It is a one line change though, so feel free to modify manually as well using the info in that file!

@bmorgan

Thank you for the patch. This works. I appreciate.

Regards,
Rong

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