From ec36cb8d3d10a54e157635b63b328e8006e25100 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 10 Nov 2026 16:12:04 +0100 Subject: [PATCH] Build: configure stops with a clear message on GCC older than 11 GCC 8 (the RHEL/Rocky 8 system compiler) configured but failed minutes into the build with "CUB requires at least C++17". The configure now refuses it and names gcc-toolset-13. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- CMakeLists.txt | 8 ++++++++ docs/SOFTWARE.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e7e7f1fe..bceae25a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,14 @@ INCLUDE(GNUInstallDirs) SET(CMAKE_CXX_STANDARD 20) SET(CMAKE_CXX_STANDARD_REQUIRED True) +# GCC older than 11 accepts the configure but fails deep in the build (CUB, the C++20 headers), e.g. +# the system GCC 8 of RHEL/Rocky 8; stop here instead and say which compiler to use. +IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11) + MESSAGE(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old: GCC 11 or newer is required. " + "On RHEL/Rocky 8 install gcc-toolset-13 and run 'source /opt/rh/gcc-toolset-13/enable' " + "before cmake, in a fresh build directory.") +ENDIF() + # The Metal Bragg integration engine (image_analysis/bragg_integration) is Objective-C++. Enabled here, # above every target that links it, as enable_language asks. IF (APPLE) diff --git a/docs/SOFTWARE.md b/docs/SOFTWARE.md index 183b41846..3f5edfc91 100644 --- a/docs/SOFTWARE.md +++ b/docs/SOFTWARE.md @@ -22,7 +22,7 @@ CUDA requirements of each released package. ## Software dependencies Required: -* C++20 compiler and C++20 standard library; recommended GCC 11+ or clang 14+ (Intel OneAPI and AMD AOCC also work) +* C++20 compiler and C++20 standard library: GCC 11 or newer (checked at configure time; on RHEL/Rocky 8 use gcc-toolset-13), or clang 14+ (Intel OneAPI and AMD AOCC also work) * CMake version 3.26 or newer + a build tool (GNU make or Ninja) HDF5, libtiff, zlib and Eigen used to be required system packages; they are now