Skip to content

Support xcframework for mac catalyst builds.#19534

Merged
YUNQIUGUO merged 24 commits intomainfrom
yguo/maccatalyst-build-ios-package
Mar 20, 2024
Merged

Support xcframework for mac catalyst builds.#19534
YUNQIUGUO merged 24 commits intomainfrom
yguo/maccatalyst-build-ios-package

Conversation

@YUNQIUGUO
Copy link
Copy Markdown
Contributor

Description

Motivation and Context

MAUI on macOS uses mac-catalyst which requires a different native binary.

@YUNQIUGUO
Copy link
Copy Markdown
Contributor Author

YUNQIUGUO commented Feb 15, 2024

Still addressing a couple build failures and need to figure out a test for catalyst variant on the pipeline.

Comment thread tools/ci_build/build.py Fixed
Comment thread tools/ci_build/build.py Fixed
Comment thread tools/ci_build/build.py Fixed
Comment thread cmake/CMakeLists.txt Outdated
Comment thread cmake/onnxruntime.cmake
Comment thread cmake/onnxruntime_mlas.cmake Outdated
Comment thread tools/ci_build/build.py Outdated
Comment thread tools/ci_build/build.py Outdated
Comment thread tools/ci_build/build.py Outdated
Comment thread tools/ci_build/build.py Outdated
Comment thread tools/ci_build/build.py Fixed
Comment thread tools/ci_build/build.py Fixed
@YUNQIUGUO YUNQIUGUO marked this pull request as ready for review February 23, 2024 18:43
@YUNQIUGUO YUNQIUGUO requested a review from a team February 23, 2024 18:43
Comment thread tools/ci_build/build.py
Comment thread tools/ci_build/build.py Outdated
YUNQIUGUO and others added 2 commits February 27, 2024 11:02
Co-authored-by: Scott McKay <skottmckay@gmail.com>
skottmckay
skottmckay previously approved these changes Feb 28, 2024
@snnn
Copy link
Copy Markdown
Contributor

snnn commented Feb 28, 2024

/azp run Windows GPU TensorRT CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,iOS CI Pipeline,ONNX Runtime React Native CI Pipeline

@snnn
Copy link
Copy Markdown
Contributor

snnn commented Feb 28, 2024

/azp run Linux CPU Minimal Build E2E CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kosma
Copy link
Copy Markdown

kosma commented Mar 5, 2024

I know this is Work in Progress, but I'd love to get some usage instructions on how to compile this. I have managed to build a native framework, but I'm a bit lost on the invocations needed to build an ARM64 one, and also joining them together into a (preferably static) dual-architecture xcframework (which I assume is needed for building a Catalyst app).

PS. This branch/pull request alone saves us so much work it's hard to express in words. ❤️

Comment thread cmake/handle_duplicate_object_files.py Fixed
@YUNQIUGUO
Copy link
Copy Markdown
Contributor Author

I know this is Work in Progress, but I'd love to get some usage instructions on how to compile this. I have managed to build a native framework, but I'm a bit lost on the invocations needed to build an ARM64 one, and also joining them together into a (preferably static) dual-architecture xcframework (which I assume is needed for building a Catalyst app).

PS. This branch/pull request alone saves us so much work it's hard to express in words. ❤️

thanks for the feedback!

Regarding the question, if you would run the command as something like python3 tools/ci_build/github/apple/build_apple_framework.py \ --build_dir "$(Build.BinariesDirectory)/ios_framework" \ tools/ci_build/github/apple/default_full_ios_framework_build_settings.json AFAIK with the support of this PR, it would already be able to generate an xcframework artifact and its structure would look something like:

- onnxruntime.xcframework
  - Info.plist
  - ios-arm64/
    - ...
  - ios-arm64_x86_64_maccatalyst/
    - onnxruntime.framework/
      - Info.plist
      - Headers/
      - onnxruntime
  - ios-arm64_x86_64-simulator/
     - ...

And you can always adjust the build settings with the desired architectures (x86_64 or arm64)/ deployment target version via editing this config here: https://github.com/microsoft/onnxruntime/blob/bff4f8bf75562704720624fac63b149d10042ac8/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json

@kosma
Copy link
Copy Markdown

kosma commented Mar 7, 2024

I was about to submit a bug report about missing symbols but you fixed it already via 1629aa9. :)

Once again, thank you so so much - you removed a gigantic roadblock in our project. :)

Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
Comment thread cmake/handle_duplicate_object_files.py Fixed
@YUNQIUGUO
Copy link
Copy Markdown
Contributor Author

/azp run Windows GPU TensorRT CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,iOS CI Pipeline,ONNX Runtime React Native CI Pipeline

@YUNQIUGUO
Copy link
Copy Markdown
Contributor Author

/azp run Linux CPU Minimal Build E2E CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread cmake/handle_duplicate_object_files.py Outdated
Comment thread cmake/handle_duplicate_object_files.py Outdated
Comment thread cmake/onnxruntime.cmake
Comment thread cmake/onnxruntime.cmake Outdated
@YUNQIUGUO YUNQIUGUO merged commit 6b305f9 into main Mar 20, 2024
@YUNQIUGUO YUNQIUGUO deleted the yguo/maccatalyst-build-ios-package branch March 20, 2024 17:55
TedThemistokleous pushed a commit to TedThemistokleous/onnxruntime that referenced this pull request May 7, 2024
### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

MAUI on macOS uses mac-catalyst which requires a different native
binary.

---------

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants