Skip to content
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

MSVC but not Clang: /MP #2824

Merged
merged 1 commit into from
Feb 8, 2021
Merged

MSVC but not Clang: /MP #2824

merged 1 commit into from
Feb 8, 2021

Conversation

ax3l
Copy link
Collaborator

@ax3l ax3l commented Jan 27, 2021

Description

On Windows, clang-cl does not understand /MP.

clang-cl: warning: argument unused during compilation: '/MP' [-Wunused-command-line-argument]

with Clang 10.0.0 and Ninja.

Suggested changelog entry:

Clang on Windows: do not pass /MP (ignored flag)

@henryiii
Copy link
Collaborator

Needs a pre-commit run -a :)

APPEND
PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:$<$<COMPILE_LANGUAGE:CXX>:/MP>>)
# /MP enables multithreaded builds (relevant when there are many files) for MSVC
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # no Clang no Intel
Copy link

Choose a reason for hiding this comment

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

Or to check whether CMAKE_CXX_COMPILER_FRONTEND_VARIANT is empty https://github.com/Kitware/CMake/blob/master/Modules/CMakeDetermineCXXCompiler.cmake#L129-L143

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be checked to make sure it is valid for all versions we support - CMake has a bad habit of not adding those the first round. If so, then it seems more elegant. :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

CMAKE_CXX_COMPILER_FRONTEND_VARIANT wasn't there in 3.11, which is where this block of code starts taking effect.

On Windows, clang-cl does not understand /MP.
```
clang-cl: warning: argument unused during compilation: '/MP' [-Wunused-command-line-argument]
```
with Clang 10.0.0
@henryiii
Copy link
Collaborator

henryiii commented Feb 5, 2021

Thats odd, test_recarray has a random nan in it for CentOS 7.

@henryiii
Copy link
Collaborator

henryiii commented Feb 5, 2021

Quite sure that has nothing to do with this PR.

@bstaletic
Copy link
Collaborator

@henryiii Same error surprised @YannickJadoul in #2846 .

@henryiii henryiii merged commit c78dfb6 into pybind:master Feb 8, 2021
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Feb 8, 2021
@ax3l ax3l deleted the topic-nonMSVCwinMP branch February 10, 2021 05:47
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants