Have the build requirements changed from 11.3 to 11.4?

Geant4 Version: 11.3.2, 11.4.0
Operating System: CentOS 7.9
Compiler/Version: gcc-11.2
CMake Version: 3.17


Hello,

I am on an old and unsupported system, CentOS 7. However despite that, up through 11.3 I was able to build geant just fine using the RedHat devtoolset-11. Trying to upgrade to 11.4 produces errors during cmake:

CMake Error at cmake/Modules/G4DeveloperAPI.cmake:1358 (add_library):
add_library INTERFACE library requires no source arguments.
Call Stack (most recent call first):
cmake/Modules/G4DeveloperAPI.cmake:1081 (__geant4_add_library)
source/CMakeLists.txt:45 (geant4_compose_targets)

CMake Error at cmake/Modules/G4DeveloperAPI.cmake:1097 (install):
install TARGETS given target “G4processes” which does not exist.
Call Stack (most recent call first):
source/CMakeLists.txt:45 (geant4_compose_targets)

According to the install documentation, the requirements are gcc11 and cmake 3.16. I notice that the “officially supported” RHEL 9 bumped from 11.2 to 11.5, so I guess I am probably out of luck. But it seems strange that a minor gcc version difference would cause errors during cmake (I would not expect gcc errors to happen until compiling.)

I recognize that the solution to my problem is to use an OS from this decade. But I hope maybe there’s something else going on here. If there is a strict requirement for gcc >= 11.5 and not just 11, I humbly request that the system build requirements documentation be updated to reflect that in case it saves someone else the trouble.

Hello,

I can confirm this is not really a gcc issue. The problem comes from the cmake version.

On centos7 with devtoolset-11 I also tried configuring Geant4 11.4 using cmake-3.17.5 and the configuration fails with the same errors you reported:

•	add_library INTERFACE library requires no source arguments

•	target “G4processes” does not exist

When I tested with a newer cmake-3.27.9, the configuration works correctly. So it looks like geant4 11.4 requires a more recent cmake than the current minimum listed in the documentation.

Best regards, Dmitri

That helped narrow it down. The add_library signature that accepts source arguments was added in 3.19 add_library — CMake 4.2.3 Documentation . I tested and it does build with cmake-3.19.

To quickly cross-post here - this is a bug and reported here (thanks!): 2700 – cmake_minimum_version is incorrect

A patch is in testing to keep support for 3.16 and will be posted on that ticket once passed and integrated. This will also be in the upcoming 11.4.1 patch release in a few weeks.

1 Like