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

[Build] Unable to specify msvc_toolset during Windows build #18014

Closed
toothache opened this issue Oct 18, 2023 · 5 comments
Closed

[Build] Unable to specify msvc_toolset during Windows build #18014

toothache opened this issue Oct 18, 2023 · 5 comments
Labels
build build issues; typically submitted using template platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot

Comments

@toothache
Copy link
Member

Describe the issue

I have installed VS2022 with both v143 (14.37) and v142 (14.29). However, CMake config will fail when passing --msvc_toolset to specify v142 toolset.

Urgency

No response

Target platform

Windows

Build script

.\build.bat --msvc_toolset 14.29

Error / output

....
-- Detecting C compiler ABI info
CMake Error at D:/source/cognition/onnxruntime/build/Windows/Debug/CMakeFiles/CMakeScratch/TryCompile-farpjc/CMakeLists.txt:4 (project):
Generator

Visual Studio 17 2022

given toolset and version specification

v143,version=14.29

contains an invalid version specification.

Visual Studio Version

2022

GCC / Compiler Version

No response

@toothache toothache added the build build issues; typically submitted using template label Oct 18, 2023
@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Oct 18, 2023
@skottmckay
Copy link
Contributor

I tried with --msvc_toolset 14.37 which is a version I have installed and it worked fine with cmake 3.26.4.
Also tested with a --msvc_toolset 14.33 which I do not have installed and got the expected error about it not being installed. It had no issue with the version specification.

  given toolset and version specification

    v143,version=14.33

  does not seem to be installed at

    C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/14.33/Microsoft.VCToolsVersion.14.33.props

Alternatively you should be able to set the toolset in the environment using the vcvars_ver parameter of vcvarsall.bat prior to running build.bat.

"%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat"
[ERROR:vcvarsall.bat] Error in script usage. The correct usage is:
Syntax:
    vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version] [-vcvars_spectre_libs=spectre_mode]
where :
    [arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
    [platform_type]: {empty} | store | uwp
    [winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
    [vc_version] : {none} for latest installed VC++ compiler toolset |
                   "14.0" for VC++ 2015 Compiler Toolset |
                   "14.xx" for the latest 14.xx.yyyyy toolset installed (e.g. "14.11") |
                   "14.xx.yyyyy" for a specific full version number (e.g. "14.11.25503")
    [spectre_mode] : {none} for libraries without spectre mitigations |
                     "spectre" for libraries with spectre mitigations

e.g.
https://github.com/microsoft/onnxruntime/blob/0d9030e79888d1d5828730b254fedc53c7b640c1/build.amd64.1411.bat#L8C1-L9C76

@toothache
Copy link
Member Author

Both 14.37 and 14.33 belong to v143. The error happens if you specify a toolset version, e.g., 14.29, which does not belong to v143.

image

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Nov 18, 2023
Copy link
Contributor

github-actions bot commented Jan 6, 2024

This issue has been automatically closed due to inactivity. Please reactivate if further support is needed.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2024
@snnn
Copy link
Member

snnn commented Jun 11, 2024

Now I know, it is a compatibility issue between cmake and VS.

See #20993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants