Skip to content

SPM that uses onnxruntime-spm #27

Description

@iOSDevD

With we have a SPM that imports onnxruntime-spm like below.

Project
-> SPMLibraryName (Is using onnxruntime-spm)

We get the following error.

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: warning: Could not parse or use implicit file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_ORTCheckpoint", referenced from:
        in <SPMLibraryName>.o
"_OBJC_CLASS_$_ORTTrainingSession", referenced from:
        in <SPMLibraryName>.o
ld: symbol(s) not found for architecture arm64

The SPM that I have has the following configuration.

products: [
....
dependencies: [
        .package(url: "https://github.com/microsoft/onnxruntime-swift-package-manager.git", exact: "1.20.0"),
    ],
....
targets: 
[
.target(name: "SPMLibraryName",
dependencies: [.product(name: "onnxruntime", package: "onnxruntime-swift-package-manager"),
                           .product(name: "onnxruntime_extensions", package: "onnxruntime-swift-package-manager")]),)
]
]

How to fix the undefined symbols issue.

Xcode version: 16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions