Skip to content

Conversation

teekenl
Copy link
Contributor

@teekenl teekenl commented Aug 24, 2025

Purpose

When building source on MacOS (CPU), encountered compilation error: 'constexpr' is not a type, that because clang is defaulting to old c++ standard that seem not able to compile specific syntax properly.

Test Plan

Test Result

(Optional) Documentation Update

Add troubleshotting solution on docs/getting_started/installation/cpu/apple.inc.md


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

@teekenl teekenl requested a review from hmellor as a code owner August 24, 2025 06:28
@teekenl teekenl changed the title (Misc): set cmake c++ compatible standard when building source on macos CPU. (Misc): set cmake c++ compatible standard when building on MacOS CPU. Aug 24, 2025
@mergify mergify bot added the documentation Improvements or additions to documentation label Aug 24, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for a workaround to a build issue on macOS related to the C++ standard. While adding this troubleshooting guide is helpful for users who might encounter this, a more robust solution would be to address the root cause in the build configuration itself. I recommend updating cmake/cpu_extension.cmake to enforce the required C++ standard, for instance by adding set(CMAKE_CXX_STANDARD 17). This would prevent the issue from occurring in the first place and provide a smoother experience for developers building on macOS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

On macOS, the system compiler is typically Clang, not GCC. Mentioning "old GCC standard" could be misleading for users on this platform. To improve clarity and accuracy, I recommend referring to the C++ standard more generally.

For example:

    **Solution**: Your compiler might be using an older C++ standard. Edit `cmake/cpu_extension.cmake` and add `set(CMAKE_CXX_STANDARD 17)` before `set(CMAKE_CXX_STANDARD_REQUIRED ON)`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea! updated now

Signed-off-by: teekenl <teekenlau@gmail.com>
@teekenl teekenl force-pushed the update-apple-cpu-cmake branch from 4019b59 to 475eebc Compare August 24, 2025 06:49
@teekenl teekenl changed the title (Misc): set cmake c++ compatible standard when building on MacOS CPU. (doc): set cmake c++ compatible standard when building on MacOS CPU. Aug 24, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding this troubleshooting tip!

@vllm-bot vllm-bot merged commit e4f0b4c into vllm-project:main Sep 16, 2025
13 of 15 checks passed
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
…llm-project#23483)

Signed-off-by: teekenl <teekenlau@gmail.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants