VS 16.9 + Intel 2020 Integration: llvm toolset error due to /permissive
EDIT: This turns out to be an incompatibility between VS 16.9+ and the Intel Compiler VS Integration in versions 2020 and below. See details below. The solution is one of:
- Uninstall Intel Compiler VS Integration from versions 2020 (19.1) and below, or
- Do not update VS 2019 past version 16.7.
Original Description
So I am trying to use VS with LLVM toolset (using the llvm19
extensions)
The problem I encounter is: CMake configure fails to identifier the C compiler due to (CMakeError.log):
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R)-Build-Engine, Version 16.9.0+57a23d249 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
Der Buildvorgang wurde am 16.03.2021 12:58:26 gestartet.
Projekt "E:\Repos\AllProjects\build\LLVM_VS2019_x64_VSPROJ\Debug\CMakeFiles\3.19.6\CompilerIdC\CompilerIdC.vcxproj" auf Knoten "1" (Standardziele).
PrepareForBuild:
Das Verzeichnis "Debug\" wird erstellt.
Das Verzeichnis "Debug\CompilerIdC.tlog\" wird erstellt.
InitializeBuildStatus:
"Debug\CompilerIdC.tlog\unsuccessfulbuild" wird erstellt, da "AlwaysCreate" angegeben wurde.
ClCompile:
C:\Program Files\LLVM\bin\clang-cl.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /EHsc /MDd /GS /permissive /Fo"Debug\\" /Gd /TC -m64 CMakeCCompilerId.c
clang-cl : error : no such file or directory: '/permissive'; did you mean '/permissive-'? [E:\Repos\AllProjects\build\LLVM_VS2019_x64_VSPROJ\Debug\CMakeFiles\3.19.6\CompilerIdC\CompilerIdC.vcxproj]
Die Erstellung des Projekts "E:\Repos\AllProjects\build\LLVM_VS2019_x64_VSPROJ\Debug\CMakeFiles\3.19.6\CompilerIdC\CompilerIdC.vcxproj" ist abgeschlossen (Standardziele) -- FEHLER.
Fehler beim Buildvorgang.
"E:\Repos\AllProjects\build\LLVM_VS2019_x64_VSPROJ\Debug\CMakeFiles\3.19.6\CompilerIdC\CompilerIdC.vcxproj" (Standardziel) (1) ->
(ClCompile Ziel) ->
clang-cl : error : no such file or directory: '/permissive'; did you mean '/permissive-'? [E:\Repos\AllProjects\build\LLVM_VS2019_x64_VSPROJ\Debug\CMakeFiles\3.19.6\CompilerIdC\CompilerIdC.vcxproj]
0 Warnung(en)
1 Fehler
Verstrichene Zeit 00:00:00.55
Apparently VS changed the default project settings to always pass /permissive
.
According to inspecting project files the field ConformanceMode
in ClCompile
controls the behavior of adding the flag:
It can have the following values
<ConformanceMode>true</ConformanceMode> # /permissive-
<ConformanceMode>false</ConformanceMode> # /permissive
<ConformanceMode>Default</ConformanceMode> # no flag added
Adding <ConformanceMode>Default</ConformanceMode>
to VS-10.vcxproj.in
in ClCompile
fixes the error!
Edited by Brad King