llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Visual Studio] Add support for Parallel Custom Build Tools

Open RKSimon opened this issue 7 years ago • 8 comments
trafficstars

Bugzilla Link 39035
Version trunk
OS Windows NT
Blocks llvm/llvm-project#28596
CC @adibiagio,@llvm-beanz,@filcab,@gregbedwell,@rnk

Extended Description

Visual Studio 2017 15.8 adds opt-in support for parallelised building of custom tools stages in a project:

https://blogs.msdn.microsoft.com/vcblog/2018/09/18/parallel-custom-build-tools-in-visual-studio-2017/

This will considerably help speed up llvm-tblgen builds if we can enable this as soon as any necessary cmake changes have been made.

RKSimon avatar Sep 21 '18 11:09 RKSimon

There doesn't seem to be any movement on this on the upstream cmake project.

The vcxproj setting is:

<CustomBuild>
  <BuildInParallel>true</BuildInParallel>
</CustomBuild>

Do you thing it would it be feasible for us to always emit this directly in the *CommonTableGen.vcxproj files for at least VS2019+ builds?

RKSimon avatar Jan 23 '20 10:01 RKSimon

Thanks Chris, I've made an upstream cmake feature request here:

https://gitlab.kitware.com/cmake/cmake/issues/18405

I'll try using cmake directly at some point as well

RKSimon avatar Sep 26 '18 13:09 RKSimon

Assuming CMake adds support for this, I see no reason not to fix it. However, with Visual Studio 17 I think the current best way to get fast builds is to use the built-in CMake support:

https://blogs.msdn.microsoft.com/vcblog/2016/10/05/cmake-support-in-visual-studio/

This uses ninja for the underlying build and gets much better build performance.

llvm-beanz avatar Sep 24 '18 15:09 llvm-beanz

Thanks Chris, I've made an upstream cmake feature request here:

gitlab.kitware.com/cmake/cmake/issues/18405

It has been implemented in CMake 3.27 but is opt-in via policy https://cmake.org/cmake/help/latest/policy/CMP0147.html.

Kojoley avatar Mar 16 '24 03:03 Kojoley

@Kojoley So can we enable it when building with cmake >= 3.27?

RKSimon avatar Mar 20 '24 10:03 RKSimon

@Kojoley So can we enable it when building with cmake >= 3.27?

IIUC yes, I don't know where to put it though, seems to be in https://github.com/llvm/llvm-project/blob/main/cmake/Modules/CMakePolicy.cmake?

Kojoley avatar Mar 20 '24 14:03 Kojoley

Maybe HandleLLVMOptions.cmake?

RKSimon avatar Mar 20 '24 14:03 RKSimon

Maybe HandleLLVMOptions.cmake?

Looking at 88d7508dc479210f07abccb17f0194b66264b125 previously policies were in llvm/CMakeLists.txt and the commit moved them to cmake/Modules/CMakePolicy.cmake.

Kojoley avatar Mar 20 '24 15:03 Kojoley

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
  2. In the comments of this issue, request for it to be assigned to you, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

llvmbot avatar Apr 05 '24 10:04 llvmbot

@llvm/issue-subscribers-good-first-issue

Author: Simon Pilgrim (RKSimon)

| | | | --- | --- | | Bugzilla Link | [39035](https://llvm.org/bz39035) | | Version | trunk | | OS | Windows NT | | Blocks | llvm/llvm-project#28596 | | CC | @adibiagio,@llvm-beanz,@filcab,@gregbedwell,@rnk |

Extended Description

Visual Studio 2017 15.8 adds opt-in support for parallelised building of custom tools stages in a project:

https://blogs.msdn.microsoft.com/vcblog/2018/09/18/parallel-custom-build-tools-in-visual-studio-2017/

This will considerably help speed up llvm-tblgen builds if we can enable this as soon as any necessary cmake changes have been made.

llvmbot avatar Apr 05 '24 10:04 llvmbot

Good first issue for somebody working on windows + visualstudio and knows a little cmake

RKSimon avatar Apr 05 '24 10:04 RKSimon