Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support xcframework for mac catalyst builds. #19534

Merged
merged 24 commits into from
Mar 20, 2024

Conversation

YUNQIUGUO
Copy link
Contributor

Description

Motivation and Context

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

@YUNQIUGUO
Copy link
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.

tools/ci_build/build.py Fixed Show fixed Hide fixed
tools/ci_build/build.py Fixed Show fixed Hide fixed
tools/ci_build/build.py Fixed Show fixed Hide fixed
cmake/CMakeLists.txt Outdated Show resolved Hide resolved
cmake/onnxruntime.cmake Show resolved Hide resolved
cmake/onnxruntime_mlas.cmake Outdated Show resolved Hide resolved
tools/ci_build/build.py Outdated Show resolved Hide resolved
tools/ci_build/build.py Outdated Show resolved Hide resolved
tools/ci_build/build.py Outdated Show resolved Hide resolved
tools/ci_build/build.py Outdated Show resolved Hide resolved
tools/ci_build/build.py Fixed Show fixed Hide fixed
tools/ci_build/build.py Fixed Show fixed Hide fixed
@YUNQIUGUO YUNQIUGUO marked this pull request as ready for review February 23, 2024 18:43
@YUNQIUGUO YUNQIUGUO requested a review from a team as a code owner February 23, 2024 18:43
tools/ci_build/build.py Outdated Show resolved Hide resolved
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
Member

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
Member

snnn commented Feb 28, 2024

/azp run Linux CPU Minimal Build E2E CI Pipeline

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kosma
Copy link

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. ❤️

@YUNQIUGUO
Copy link
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

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. :)

cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
cmake/handle_duplicate_object_files.py Fixed Show fixed Hide fixed
@YUNQIUGUO
Copy link
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
Contributor Author

/azp run Linux CPU Minimal Build E2E CI Pipeline

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

cmake/handle_duplicate_object_files.py Outdated Show resolved Hide resolved
cmake/handle_duplicate_object_files.py Outdated Show resolved Hide resolved
cmake/onnxruntime.cmake Outdated Show resolved Hide resolved
cmake/onnxruntime.cmake Outdated Show resolved Hide resolved
@YUNQIUGUO YUNQIUGUO merged commit 6b305f9 into main Mar 20, 2024
138 of 144 checks passed
@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.

4 participants