Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

CMake generation with Visual Studio 2019 and Intel Compiler 2019 u4 broken

AndrewC
New Contributor III
3,472 Views

Referring to the problem in this thread regarding the use of "Default"

https://software.intel.com/en-us/forums/intel-c-compiler/topic/811512

This issue breaks CMake generation for CMake 3.15.1 Visual Studio 2019 using the Intel Compiler 2019 u4 toolset

The error shows in CMake as

$ cmake ../ -G"Visual Studio 16 2019" -T"Intel C++ Compiler 19.0"
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.

Works fine for Visual Studio 2017

$ cmake ../ -G"Visual Studio 15 2017" -T"Intel C++ Compiler 19.0"
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The C compiler identification is Intel 19.0.4.20190417
-- The CXX compiler identification is Intel 19.0.4.20190417

Digging deeper shows the cause of the error

 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 19.0\Toolset.targets(350,5): error : Element <LanguageStandard> has an invalid value of "Default".

   

 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 19.0\Toolset.targets(350,5): error MSB6011: Invalid parameters passed to the Intel.Build.ICLTasks.ICL task.

 

0 Kudos
1 Reply
AndrewC
New Contributor III
3,472 Views

There is a workaround for this issue

Edit the file C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.Cl.Common.props

Find the LanguageStandard tag and change the value from "Default" to something like "stdcpp17"

0 Kudos
Reply