Skip to content

[BUG]: IPO isn't detected properly with IntelLLVM #4080

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

Closed
2 of 3 tasks
mablanchard opened this issue Jul 18, 2022 · 1 comment · Fixed by #4402
Closed
2 of 3 tasks

[BUG]: IPO isn't detected properly with IntelLLVM #4080

mablanchard opened this issue Jul 18, 2022 · 1 comment · Fixed by #4402
Labels

Comments

@mablanchard
Copy link
Contributor

mablanchard commented Jul 18, 2022

Required prerequisites

Problem description

Running CMake find_package(pybind11) on Windows + Intel new ICX compiler (a.k.a. IntelLLVM) gives:

-- Performing Test HAS_INTEL_IPO
-- Performing Test HAS_INTEL_IPO - Failed

From the CMakeError.log file:

clang-cl: warning: unknown argument ignored in clang-cl '-ipo'; did you mean '-Qipo'? [-Wunknown-argument]

Indeed, pybind11Common.cmake doesn't seem to handle the ICX compiler correctly and misinterpret its CMAKE_CXX_COMPILER_ID (being IntelLLVM for new ICX) for the Intel Classic compiler (being Intel for old ICC/ICL).

I believe the ICX compiler expects -ipo on UNIX but -Qipo on WIN32.

Reproducible example code

cmake_minimum_required(
  VERSION 3.23.0)

set(CMAKE_C_COMPILER "icx")
set(CMAKE_CXX_COMPILER "icx")

enable_language(C CXX)

project(CMake-IntelLLVM-WIN32)

find_package(pybind11 CONFIG)

add_executable(cmake-intelllvm-win32 main.cpp)

Ran like:

cmake -G Ninja -B build\ -Dpybind11_ROOT:PATH=[...] .

Gives:

-- The C compiler identification is IntelLLVM 2022.1.0 with MSVC-like command-line
-- The CXX compiler identification is IntelLLVM 2022.1.0 with MSVC-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - 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: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/apps/Python310/python.exe (found version "3.10.4")
-- Found PythonLibs: C:/apps/Python310/libs/python310.lib
-- Performing Test HAS_INTEL_IPO
-- Performing Test HAS_INTEL_IPO - Failed
-- Found pybind11: D:/... (found version "2.9.2")
-- Configuring done
-- Generating done
-- Build files have been written to: D:/...
@mablanchard mablanchard added the triage New bug, unverified label Jul 18, 2022
@Skylion007 Skylion007 added build system and removed triage New bug, unverified labels Jul 19, 2022
@Skylion007
Copy link
Collaborator

@mablanchard We would welcome a PR that fixes this and adds testing of the IntelLLVM compiler to our CI. Feel free to open one.

@Skylion007 Skylion007 added the compiler: intel Related to the Intel compilers label Jul 19, 2022
mablanchard added a commit to mablanchard/pybind11 that referenced this issue Dec 12, 2022
rwgk added a commit that referenced this issue Dec 16, 2022
* IPO/LTO support for ICX (IntelLLVM) compiler

#4080

* style: pre-commit fixes

* Add WARNING/HELP WANTED comment.

Co-authored-by: Martin Blanchard <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>
rwgk added a commit to rwgk/pybind11clif that referenced this issue Jan 2, 2023
s 89c3561 Fix multi-context new Python linking mode (google#4401)
s ece1206 ci: set `env: VERBOSE: 1` (google#4405)
s 09db644 IPO/LTO support for ICX (IntelLLVM) compiler (google#4402)
s a97c4d2 fix(cmake): support Windows ARM cross-compilation (google#4406)
s ee4b9f5 Fix ODR violations in our Eigen Tensor tests (google#4412)
s 3fd1520 docs: changelog for next version (google#4413)
s 0694ec6 chore: preapre for 2.10.2 release (google#4414)
s a6b1913 Tracking ci.yml changes from master.

Fix multi-context new Python linking mode (google#4401)

Allow CMake find_package() from multiple directories.

pybind/pybind11#4400

Co-authored-by: Martin Blanchard <[email protected]>

ci: set `env: VERBOSE: 1` (google#4405)

* Revert "Systematically add `-DCMAKE_VERBOSE_MAKEFILE=ON` to obtain full command lines related to `-Wodr` (google#4398)"

This reverts commit ff42f52.

* Set `env: VERBOSE: 1` as suggested by @henryiii

* Set `env: VERBOSE: 1` also in all other .yml files using cmake

IPO/LTO support for ICX (IntelLLVM) compiler (google#4402)

* IPO/LTO support for ICX (IntelLLVM) compiler

pybind/pybind11#4080

* style: pre-commit fixes

* Add WARNING/HELP WANTED comment.

Co-authored-by: Martin Blanchard <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>

fix(cmake): support Windows ARM cross-compilation (google#4406)

Signed-off-by: Henry Schreiner <[email protected]>

Signed-off-by: Henry Schreiner <[email protected]>

Fix ODR violations in our Eigen Tensor tests (google#4412)

* First

* Fix centos 7 again :(

* Fix minor nits

docs: changelog for next version (google#4413)

* docs: changelog for next version

Signed-off-by: Henry Schreiner <[email protected]>

* docs: address feedback

Signed-off-by: Henry Schreiner <[email protected]>

Signed-off-by: Henry Schreiner <[email protected]>

chore: preapre for 2.10.2 release (google#4414)

Signed-off-by: Henry Schreiner <[email protected]>

Signed-off-by: Henry Schreiner <[email protected]>

Tracking ci.yml changes from master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants