CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake

I’m trying to install Geant4 11.0 and I’m running into an issue running CMake

Starting build with cmake...
-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
-- Configuring download of missing dataset G4NDL (4.6)
-- Configuring download of missing dataset G4EMLOW (8.0)
-- Configuring download of missing dataset PhotonEvaporation (5.7)
-- Configuring download of missing dataset RadioactiveDecay (5.6)
-- Configuring download of missing dataset G4PARTICLEXS (4.0)
-- Configuring download of missing dataset G4PII (1.3)
-- Configuring download of missing dataset RealSurface (2.2)
-- Configuring download of missing dataset G4SAIDDATA (2.0)
-- Configuring download of missing dataset G4ABLA (3.1)
-- Configuring download of missing dataset G4INCL (1.0)
-- Configuring download of missing dataset G4ENSDFSTATE (2.3)
CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:567 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:682 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:758 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:568 (_g4tc_prepend_path):
  _g4tc_prepend_path Function invoked with incorrect arguments for function
  named: _g4tc_prepend_path
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:682 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:758 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:567 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:682 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:758 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:568 (_g4tc_prepend_path):
  _g4tc_prepend_path Function invoked with incorrect arguments for function
  named: _g4tc_prepend_path
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:682 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:758 (_g4tc_configure_build_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:567 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:703 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:826 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:568 (_g4tc_prepend_path):
  _g4tc_prepend_path Function invoked with incorrect arguments for function
  named: _g4tc_prepend_path
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:703 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:826 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:567 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:703 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:826 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


CMake Error at cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:568 (_g4tc_prepend_path):
  _g4tc_prepend_path Function invoked with incorrect arguments for function
  named: _g4tc_prepend_path
Call Stack (most recent call first):
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:703 (_g4tc_configure_tc_variables)
  cmake/Modules/G4ConfigureGNUMakeHelpers.cmake:826 (_g4tc_configure_install_tree_scripts)
  cmake/Modules/G4CMakeMain.cmake:98 (include)
  CMakeLists.txt:50 (include)


-- 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_GDML: Building Geant4 with GDML support
GEANT4_USE_OPENGL_X11: Build Geant4 OpenGL driver with X11 support
GEANT4_USE_RAYTRACER_X11: Build RayTracer driver with X11 support
GEANT4_USE_PYTHON: Building bindings for Python 3.11

-- Configuring incomplete, errors occurred!

I am using the following configuration:

export OPENGL_X11="ON"
export RAYTRACER_X11="ON"
export USE_QT="OFF"
export MULTITHREADED="ON"
export INSTALL_DATA="ON"
export USE_SYSTEM_EXPAT="OFF"
export STATIC_LIBS="OFF"
export G4PYINSTALL="ON"
export XERCESCPATH=/home/glicka/xerces-c-3.2.5/
export XercesIncludeDir=/opt/xerces-c/include/
export XercesRootDir=/opt/xerces-c/
export XercesCLIBRARIES=/opt/xerces-c/lib/
export XercesVersion=3.2.5

and running

cmake  -DGEANT4_USE_OPENGL_X11=$OPENGL_X11        \
      -DGEANT4_USE_RAYTRACER_X11=$RAYTRACER_X11   \
      -DGEANT4_USE_QT=$USE_QT                     \
      -DBUILD_STATIC_LIBS=$STATIC_LIBS            \
      -DGEANT4_BUILD_MULTITHREADED=$MULTITHREADED \
      -DGEANT4_USE_SYSTEM_EXPAT=$USE_SYSTEM_EXPAT \
      -DGEANT4_INSTALL_DATADIR=$data_dir          \
      -DGEANT4_INSTALL_DATA=$INSTALL_DATA         \
      -DCMAKE_INSTALL_PREFIX=$install_dir         \
      -DCMAKE_INSTALL_PYTHONDIR=$pyinstallDir     \
      -DGEANT4_USE_PYTHON=$G4PYINSTALL            \
      -DGEANT4_BUILD_TLS_MODEL=global-dynamic     \
      -DCMAKE_PREFIX_PATH=$XERCESCPATH            \
      -DXercesC_INCLUDE_DIR=$XercesIncludeDir      \
      -DXERCESC_ROOT_DIR=$XercesRootDir            \
      -DXercesC_LIBRARY=$XercesCLIBRARIES          \
      -DXercesC_VERSION=$XercesVersion             \
      -DGEANT4_USE_GDML=ON                        \
      ../geant4-source

Can you please help me figure out what the problem is with the G4ConfigureGNUMakeHelpers.cmake file?

Geant4 Version: 11.0
Operating System: Linux Mint
Compiler/Version: 9.4.0
CMake Version: 3.16.3


The offending line reported in the outputs:

      get_filename_component(_xercesc_libdir ${XercesC_LIBRARY_RELEASE} DIRECTORY)

so it’s probably the value of the CMake variable XercesC_LIBRARY_RELEASE. Could you check in the CMakeCache.txt file what the values of the XercesC_... variables are and post them here please?

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