POWER : Fix build failure due to unsupported cpuinfo on ppc64le#27120
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a build failure on ppc64le (PowerPC 64-bit Little Endian) architecture by conditionally excluding the cpuinfo library from linking when building the onnxruntime_runtime_path_test_shared_library test target. The cpuinfo library does not support ppc64le, leading to linker errors.
Changes:
- Added ppc64le architecture detection in CMake to skip linking cpuinfo on this platform
- Preserved existing behavior for other architectures where cpuinfo is supported
- Follows similar pattern already established for AIX platform
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description Conditionally disable linking of cpuinfo for onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported. Motivation and Context Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo). Solution Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.
1cd9909 to
7219df3
Compare
|
I have addressed the copilot's review comments. |
|
can you review this patch @hariharans29 |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else() | ||
| target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE | ||
| onnxruntime_common cpuinfo ${CMAKE_DL_LIBS}) | ||
| if (CPUINFO_SUPPORTED) |
There was a problem hiding this comment.
The cpuinfo guard should include an Emscripten exclusion to be consistent with similar patterns elsewhere in this file. Most other cpuinfo linking checks use the pattern if (CPUINFO_SUPPORTED AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") (see lines 1359, 1567, 1699, 1892). This is necessary because CPUINFO_SUPPORTED can be TRUE on Emscripten when XNNPACK is enabled, but cpuinfo should not be linked in ORT code for that configuration (see cmake/external/onnxruntime_external_deps.cmake lines 351-356).
|
Merge didn't happen because the Required checks are failing @hariharans29 |
|
Please wait for this and rebase: #27206 |
Thanks |
Description Conditionally disable linking of cpuinfo for onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported. Motivation and Context Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo). Solution Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.
#27021: [Disable matmul 1d tests on DML](1afc8bc) #27206: [[CUDA] Run FlashAttention regression test only when FlashAttention is…](4d95d97) #27120: [POWER : Fix build failure due to unsupported cpuinfo on ppc64le](2843ec0) --------- Co-authored-by: Ti-Tai Wang <titaiwang@microsoft.com> Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: BODAPATIMAHESH <148746454+BODAPATIMAHESH@users.noreply.github.com>
…osoft#27120) Description Conditionally disable linking of cpuinfo for onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported. Motivation and Context Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo). Solution Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.
Description
Conditionally disable linking of cpuinfo for
onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported.
Motivation and Context
Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo).
Solution
Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.