CMake cannot generate Ninja build rules for asm for IntelLLVM compiler since 3.20.x

CMake cannot generate Ninja build rules for asm for IntelLLVM compiler since 3.20.
When I using ninja to generate build rules, it cannot generate the build rules for asm files (.s file) based on IntelLLVM compiler since 3.20.x or later , it works in 3.19.x cmake or previous version.

Just to check the release notes, found IntelLLVM is supported in 3.2x. But in 3.1x the compiler id been detected as Clang, which can generate ASM build rules successfully by ninja.

Also, it works ok if switch compiler to others for same code in 3.2x version cmake

Compiler info:

      Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
      Target: x86_64-unknown-linux-gnu
      Thread model: posix
      and  CMAKE_ASM_COMPILER_ID:  "IntelLLVM"

generator: ninja
CMAKE_ASM_COMPILER has been set
enable_language asm added in cmake root file

Summary:

  • cmake version: <=3.19.x + clang/icx compiler + ninja; CMAKE_ASM_COMPILER_ID = CLANG, ASM build rules works well.

  • cmake version: <=3.19.x + gcc compiler + ninja; CMAKE_ASM_COMPILER_ID= GNU, ASM build rules works well.

  • cmake version: >=3.20.x + clang/icx compiler + ninja; CMAKE_ASM_COMPILER_ID= IntelLLVM, ASM build rules cannot generated by ninja.

  • cmake version: >=3.20.x + gcc compiler + ninja; CMAKE_ASM_COMPILER_ID = GNU, ASM build rules works well.
    Could you help to check the cmake implementation, and help to support to generate Ninja build rules for asm for IntelLLVM . Thanks.

got CmakeError.log info


Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is Clang using "--version" did not match "(clang version)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is AppleClang using "--version" did not match "(Apple LLVM version)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is ARMClang using "--version" did not match "armclang":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is HP using "-V" did not match "HP C":
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version dev.x.0 Mainline Build x
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

Checking whether the ASM compiler is Intel using "--version" did not match "(ICC)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is SunPro using "-V" did not match "Sun C":
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version dev.x.0 Mainline Build x
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

Checking whether the ASM compiler is XL using "-qversion" did not match "XL C":
icx: error: unknown argument '-qversion'; did you mean '--version'?
icx: error: no input files
Checking whether the ASM compiler is MSVC using "-?" did not match "Microsoft":
icx: error: unknown argument: '-?'
icx: error: no input files
Checking whether the ASM compiler is TI using "-h" did not match "Texas Instruments":
icx: error: unknown argument: '-h'
icx: error: no input files
Checking whether the ASM compiler is IAR using "" did not match "IAR Assembler":
icx: error: no input files
Checking whether the ASM compiler is ARMCC using "" did not match "(ARM Compiler)|(ARM Assembler)":
icx: error: no input files
Checking whether the ASM compiler is NASM using "-v" did not match "(NASM version)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Checking whether the ASM compiler is YASM using "--version" did not match "(yasm)":
Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.x.0.YYYYMMDD)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin-llvm
Configuration file: /home/yanyan/share/mywork/xxx/tools/oneapi/linux/icx-xisa-lin64/bin/icx.cfg
Checking whether the ASM compiler is ADSP using "-version" did not match "Analog Devices":
icx: error: unknown argument '-version'; did you mean '--version'?
icx: error: no input files
Checking whether the ASM compiler is QCC using "-V" did not match "gcc_nto":
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version dev.x.0 Mainline Build x
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

@yanyanli15 that may be an oversight in the IntelLLVM support. Please open an issue for it.

@brad.king Thanks for the response, can I know how to open an issue for it? have any link or BKM?

The issue tracker is here: https://gitlab.kitware.com/cmake/cmake/-/issues

If you can include a CMakeLists.txt and source files that demonstrate the problem as well as the cmake command line used to configure and build, that would help in reproducing the problem.

@yanyanli15 I found that we do have nightly testing of ASM language support on many versions of both the IntelLLVM (oneAPI) and Intel (Classic) compilers. In general it is expected to work already. Please try CMake 3.24 and/or 3.25 to be sure. If those don’t work then we’ll need to figure out why it doesn’t work in your case. For that, please include the details that @williamr requested when you open an issue.