IntelLLVM: IPO fails on Linux
When Intel LLVM compiler is supplied with absolute paths, CMake fails to detect the IPO support.
CMakeLists.txt:
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
project(test_project)
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_OUTPUT)
if(IPO_SUPPORTED)
message(STATUS "Compiler supports IPO")
else()
message(STATUS "Compiler does not support IPO: ${IPO_CHECK_OUTPUT}")
endif()
Example:
cmake -DCMAKE_C_COMPILER=/opt/intel/oneapi/compiler/latest/linux/bin/icx -DCMAKE_CXX_COMPILER=/opt/intel/oneapi/compiler/latest/linux/bin/icpx ..
-- The C compiler identification is IntelLLVM 2022.0.0
-- The CXX compiler identification is IntelLLVM 2022.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/latest/linux/bin/icx - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/latest/linux/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiler does not support IPO: CXX compiler doesn't support IPO
-- Configuring done
-- Generating done
Versions:
$ cmake --version
cmake version 3.22.1
icpx --version
Intel(R) oneAPI DPC++/C++ Compiler 2022.0.0 (2022.0.0.20211123)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.0.1/linux/bin-llvm
Tested also with icpx versions 2021.3 and 2021.4.
Edited by Brad King