mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
Build fixes for Windows ARM32 desktop build (#18752)
### Description Fix a link error: ``` onnxruntime_common.lib(cpuid_info.obj) : error LNK2019: unresolved external symbol __imp_RegGetValueA referenced in function "privat e: void __cdecl onnxruntime::CPUIDInfo::ArmWindowsInit(void)" (?ArmWindowsInit@CPUIDInfo@onnxruntime@@AAAXXZ) [C:\Users\snnn\src\on nxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] onnxruntime_common.lib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventRegister referenced in function "pub lic: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QAA@XZ) [C:\Users\snnn\src\on nxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] onnxruntime_common.lib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventUnregister referenced in function "p ublic: virtual __cdecl onnxruntime::WindowsTelemetry::~WindowsTelemetry(void)" (??1WindowsTelemetry@onnxruntime@@UAA@XZ) [C:\Users\y ilyu\src\onnxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] onnxruntime_common.lib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventSetInformation referenced in functio n "public: __cdecl onnxruntime::WindowsTelemetry::WindowsTelemetry(void)" (??0WindowsTelemetry@onnxruntime@@QAA@XZ) [C:\Users\snnn\ src\onnxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] onnxruntime_common.lib(telemetry.cc.obj) : error LNK2019: unresolved external symbol __imp_EventWriteTransfer referenced in function _tlgWriteTransfer_EventWriteTransfer [C:\Users\snnn\src\onnxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] C:\Users\snnn\src\onnxruntime\build\ARM32\RelWithDebInfo\RelWithDebInfo\onnx_test_runner.exe : fatal error LNK1120: 5 unresolved ex ternals [C:\Users\snnn\src\onnxruntime\build\ARM32\RelWithDebInfo\onnx_test_runner.vcxproj] ```
This commit is contained in:
parent
44b5843740
commit
c7799d7058
2 changed files with 12 additions and 1 deletions
|
|
@ -1587,6 +1587,13 @@ set(VERSION_STRING "Internal Build" CACHE STRING "String representation of
|
|||
if (WIN32)
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${SYS_PATH_LIB})
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES debug Dbghelp)
|
||||
# In a onecore build the umbrella libs already contains references to the APIs in advapi32, so in onecore build we do not need to link to advapi32
|
||||
# In a non-onecore build, usually we also do not need to link to advapi32 because VC++ by default should have provide everything we need, except when the build target is Windows ARM32.
|
||||
# In the future we will add a build option to allow users disabling all API uses from advapi32 because some Windows environments do not have these APIs. For example, some Windows do not have
|
||||
# Windows Registry so we cannot query Registry values.
|
||||
if(onnxruntime_target_platform STREQUAL "ARM" AND CMAKE_CXX_STANDARD_LIBRARIES MATCHES kernel32.lib)
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES advapi32)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES nsync::nsync_cpp)
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES ${ICONV_LIB} ${CMAKE_DL_LIBS} Threads::Threads)
|
||||
|
|
|
|||
|
|
@ -183,7 +183,8 @@ void CPUIDInfo::ArmLinuxInit() {
|
|||
#elif defined(_WIN32)
|
||||
|
||||
void CPUIDInfo::ArmWindowsInit() {
|
||||
|
||||
// ARM32 certainly doesn't have fp16, so we will skip the logic to avoid using RegGetValueA Windows API
|
||||
#ifndef _M_ARM
|
||||
#pragma region Application Family or OneCore Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
|
||||
// Read MIDR from windows registry
|
||||
|
|
@ -270,6 +271,9 @@ void CPUIDInfo::ArmWindowsInit() {
|
|||
#endif /* Application Family or OneCore Family */
|
||||
|
||||
has_arm_neon_dot_ = (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) != 0);
|
||||
#else
|
||||
has_arm_neon_dot_ = false;
|
||||
#endif
|
||||
has_fp16_ |= has_arm_neon_dot_;
|
||||
/* TODO: implement them when hw+sw is available for testing these features */
|
||||
has_arm_neon_i8mm_ = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue