Skip to content

Reinvestigate minimum required CMake version for different architectures. #1965

Description

@kennyweiss

We recently updated Axom's C++ language requirement to c++20, which has some potential implications on the CMake requirements on various supported architectures. Let's reinvestigate the minimum required CMake versions for our supported CPU and GPU architectures.

Among other concerns, this potential impacts:

  • our stated version in the cmake_minimum_required call, which impacts our available CMake policies and their defaults

    axom/src/CMakeLists.txt

    Lines 10 to 20 in 97f1e49

    if (ENABLE_HIP OR AXOM_ENABLE_HIP)
    cmake_minimum_required(VERSION 3.21)
    else()
    # Do not bump this over 3.14 due to it changing CMake policies and breaking
    # the CUDA build. We check the required version specifically for this below
    cmake_minimum_required(VERSION 3.14)
    endif()
    # Default unset third-party CMP0074 handling to NEW so imported packages honor
    # <PackageName>_ROOT hints without emitting developer warnings.
    set(CMAKE_POLICY_DEFAULT_CMP0074 NEW CACHE STRING "")
  • our version checks for CUDA platforms

    axom/src/CMakeLists.txt

    Lines 134 to 137 in 97f1e49

    # Check for minimum CMake version required w/o changing policies like cmake_minimum_required
    if(AXOM_ENABLE_CUDA AND ${CMAKE_VERSION} VERSION_LESS 3.18.0)
    message(FATAL_ERROR "Axom requires CMake version 3.18.0+ when CUDA is enabled.")
    endif()
  • our "getting started" documentation
    Basic requirements:
    ~~~~~~~~~~~~~~~~~~~
    * C++ compiler with C++17 support at a minimum
    * CMake with a minimum required version of 3.14 for CPU-only and CUDA builds,
    and a minimum version of 3.21 when building with HIP support
    * Fortran Compiler (optional)
    * Python 3.8 at a minimum for python bindings (optional)

    (note that we are updating this section for C++20 in Some touchups to reflect that C++20 is now required for Axom #1957)

This might also be affected by a BLT PR to improve CUDA support: llnl/blt#769

See also, the discussion on a recent docs update PR: #1957 (comment)
In particular, @white238 wrote:

CMake 3.18 + CUDA + c++20 actually is a failure due to CMake not knowing that CUDA supports C++20 that early in CMake. It was set to this because many moons ago we noticed that it was changing cmake policies based on the cmake_minimum_required and this caused failures. We should reevaluate this at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Build systemIssues related to Axom's build systemDocumentationIssues related to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions