Use C++20 for Windows MSVC builds (PyTorch header requirement) - #40
Open
rwfsmith wants to merge 1 commit into
Open
Use C++20 for Windows MSVC builds (PyTorch header requirement)#40rwfsmith wants to merge 1 commit into
rwfsmith wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps the existing Windows MSVC/nvcc flags in
setup.pyfrom C++17 to C++20 so the extension compiles against current PyTorch headers.Why
setup.pyalready has a Windows branch that sets/std:c++17for MSVC and-std=c++17(plus-Xcompiler=/std:c++17) for nvcc. Recent PyTorch releases require C++20 in their headers, so that block no longer compiles — building against PyTorch 2.13 with MSVC fails until the standard is raised.Change
Three flags in the existing
IS_WINDOWSblock:/std:c++17→/std:c++20-std=c++17→-std=c++20-Xcompiler=/std:c++17→-Xcompiler=/std:c++20Windows-only — the Linux flags are untouched, so there's no effect on existing builds.
Verification
Builds and runs on Windows 11 / Python 3.13 / CUDA 13.0 / MSVC (VS2022) / PyTorch 2.13, driving TRELLIS.2's remeshing and GLB export path.
Note
If you'd prefer to keep C++17 for older PyTorch, this could be made conditional on the detected
torch.__version__instead. Happy to rework it that way — I went with the straight bump since the Windows block is already separate from Linux and PyTorch itself has moved on.Independent of #39, which fixes an unrelated out-of-bounds read in the dual contouring kernel. Either can merge first.