llnl / llnl/blt

SetupCompilerOptions erroneously classifies "CrayClang" as "Clang"

Open Beginner friendly
#699 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
296
Forks
66
Avg merge
1h 3m
Merged PRs (30d)
1

Description

CMake provides "CrayClang" as a compiler ID for the C and CXX Cray compilers based on Clang:

https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html

SetupCompilerOptions uses `matches` for Clang to match both Clang and AppleClang:

https://github.com/LLNL/blt/blob/45494b6968553806ac90822d1bc0ed8e2df6db1f/cmake/SetupCompilerOptions.cmake#L33

This causes BLT to erroneously classify CrayClang C and CrayClang CXX as Clang mainline rather than CrayClang.

This results in situations like this:

```
-- The Fortran compiler identification is Cray 18.0.0
-- The C compiler identification is Clang 18.1.6
-- The CXX compiler identification is Clang 18.1.6
```

When specifying the cray clang compilers in cmake for CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.

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 in cmake/SetupCompilerOptions.cmake at the Clang matching logic referenced by the issue, then compare it with CMake's compiler ID documentation. Verify that CrayClang is no longer classified as mainline Clang while Clang and AppleClang retain their intended handling; the issue does not name a test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.