Skip to content

[Mobile] cross compiling on xcode26 to bulid onnxruntime #26904

@fangjinfeng

Description

@fangjinfeng

Describe the issue

The.a library I compiled using the relevant compilation commands of onnxruntime includes libonnxruntime_mlas.a, libonnxruntime_session.a, libonnxruntime_framework.a, etc., but the onnxruntime.a library was not found. If these.a libraries are combined into a libonnxruntime.a library and integrated into the project, many symbol undefined errors will occur.
cmake ./cmake
-G Xcode
-DCMAKE_BUILD_TYPE=Release
-Donnxruntime_BUILD_SHARED_LIB=OFF
-Donnxruntime_BUILD_STATIC_LIB=ON
-Donnxruntime_USE_OPENMP=OFF
-Donnxruntime_USE_MKLML=OFF
-Donnxruntime_USE_COREML=ON
-Donnxruntime_USE_DNNL=OFF
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
-Donnxruntime_ENABLE_PYTHON=OFF
-Donnxruntime_USE_RTTI=ON
-DCMAKE_TOOLCHAIN_FILE=/Users/fangjinfeng/Documents/NewOnnxRuntime/onnxruntimesecond/onnxruntime/ios-cmake-4.5.0/ios.toolchain.cmake
-DPLATFORM=OS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_SKIP_INSTALL_RULES=ON

Image

To reproduce

cmake ./cmake
-G Xcode
-DCMAKE_BUILD_TYPE=Release
-Donnxruntime_BUILD_SHARED_LIB=OFF
-Donnxruntime_BUILD_STATIC_LIB=ON
-Donnxruntime_USE_OPENMP=OFF
-Donnxruntime_USE_MKLML=OFF
-Donnxruntime_USE_COREML=ON
-Donnxruntime_USE_DNNL=OFF
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
-Donnxruntime_ENABLE_PYTHON=OFF
-Donnxruntime_USE_RTTI=ON
-DCMAKE_TOOLCHAIN_FILE=/Users/fangjinfeng/Documents/NewOnnxRuntime/onnxruntimesecond/onnxruntime/ios-cmake-4.5.0/ios.toolchain.cmake
-DPLATFORM=OS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_SKIP_INSTALL_RULES=ON

Urgency

No response

Platform

iOS

OS Version

26.1

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

xcode 26.1.1

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

1.22.1

ONNX Runtime API

C++/C

Architecture

ARM64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:mobileissues related to ONNX Runtime mobile; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions