PennyLaneAI / PennyLaneAI/catalyst

Document and add a cmake guard for minimum compiler versions

Open
#2,732 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

CI/Build housecleaning
Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

We use c++20 across the board.
However, the clang compiler only has partial support for c++20 in some older versions.

We should clearly document the minimum clang and gcc version required to build catalyst from source.

We should also add a guard for it in cmake, to terminate the build at config time if minimum compiler versions are not met on the system.
For how to do it in cmake, see https://stackoverflow.com/questions/14933172/how-can-i-add-a-minimum-compiler-version-requisite

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    # require at least gcc 4.8
    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
        message(FATAL_ERROR "GCC version must be at least 4.8!")
    endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    # require at least clang 3.2
    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2)
        message(FATAL_ERROR "Clang version must be at least 3.2!")
    endif()
else()
    message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the repository's CMake configuration and build documentation, then confirm the minimum GCC and Clang versions to enforce. Add configuration-time failure checks for unsupported minimum versions and document those requirements; verify the build configuration reports the intended errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, compilers, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.