-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Hardware][Mac] Fix the installation fail for Apple Silicon (CPU) #23565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 correctly identifies and fixes a build failure on Apple Silicon by enforcing the C++17 standard for CPU builds. The use of std::optional
in the C++ source code makes this change necessary. The proposed fix is effective. I have one suggestion regarding CMake best practices to improve the long-term maintainability of the build configuration.
cmake/cpu_extension.cmake
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While setting CMAKE_CXX_STANDARD
is a valid way to enable C++17 and fixes the build, it's a directory-level setting. A more modern and maintainable approach in CMake is to specify C++ standard requirements on a per-target basis using target_compile_features
. This improves modularity and makes the build configuration easier to maintain, as target requirements are co-located with the target definition.
For example:
# After the target is defined around line 300
target_compile_features(_C PRIVATE cxx_std_17)
This would make the target's requirements explicit. Since this change works and its scope is limited to CPU builds, this is a suggestion for better long-term maintenance of the build system.
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run You ask your reviewers to trigger select CI tests on top of Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
Signed-off-by: oye93 <[email protected]>
92687fb
to
209e463
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: tc-mb <[email protected]>
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Signed-off-by: Xiao Yu <[email protected]>
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
…lm-project#23565) Signed-off-by: oye93 <[email protected]> Co-authored-by: Li, Jiang <[email protected]>
Purpose
To fix the Installation for Apple Silicon (CPU), when following the doc, I met the error like
After some checking, the cause could be that
std::optional
is a C++17 feature. So in this PR, just changed to force the C++17 compilation in the.cmake
file.Test Plan
Test Result
After
(Optional) Documentation Update
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.