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