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

Add MacOS platform support to onnxruntime-c pod #18334

Closed
wants to merge 161 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
c4460c5
add macos to build xcframework and other minor changes
Nov 7, 2023
e008e56
add more changes for configuring optional macos build in pod framework
Nov 7, 2023
3544456
enable in ios packaging pipeline and check artifacts
Nov 8, 2023
9dfbfae
fix input argument
Nov 8, 2023
46e44c6
fix
Nov 8, 2023
cf27c8d
adjust build settings json file for ios/macos framework
Nov 8, 2023
2c01018
adjust ios packaging pipeline
Nov 8, 2023
ad013e2
add back ios archs
Nov 8, 2023
af3209f
update c.podsepc.template
Nov 8, 2023
013b520
update framework_info.json.template
Nov 8, 2023
74a8b35
fix
Nov 8, 2023
85e9a69
remove two framework_info.json changes
Nov 8, 2023
2c69e12
minor updates
Nov 8, 2023
700a40d
add changes for build.py script to add optional --macosx behavior
Nov 8, 2023
3cfaaf7
minor update
Nov 8, 2023
b65bfab
Merge branch 'main' of https://github.com/microsoft/onnxruntime into …
Nov 9, 2023
4dc6369
Add FlattenAndUnpad Op (#17845)
guyang3532 Nov 9, 2023
7a3da45
add bfloat16 support for CUDA Neg kernel (#18306)
prathikr Nov 9, 2023
55c19d6
[QNN EP] Enable option to set QNN context priority (#18315)
HectorSVC Nov 9, 2023
55efb83
add softmax op support-coreml
Nov 9, 2023
b0a0588
Merge branch 'main' of https://github.com/microsoft/onnxruntime into …
Nov 9, 2023
01e746b
update
Nov 9, 2023
8d50313
[Migraphx EP] Static int8 QDQ support (#17931)
TedThemistokleous Nov 9, 2023
2c22b49
Fix rust compile issues and add GH action to run build validations an…
devigned Nov 9, 2023
25fbc2b
fix fused relu activation (#18303)
guschmue Nov 9, 2023
bafb0b6
comment unused params
Nov 9, 2023
f237b0b
[QNN EP/Quantization] Add MinimumRealRange extra option to quantizati…
adrianlizarraga Nov 9, 2023
829d802
[js/webgpu] Support uniform for softmax (#18345)
axinging Nov 9, 2023
1ff8948
Bump actions/stale from 4.1.1 to 8.0.0 (#18149)
dependabot[bot] Nov 9, 2023
59262df
Add cuda context headers to zip (#18330)
RandySheriffH Nov 9, 2023
d955885
Update stale.yml to fix start-date bug (#18376)
sophies927 Nov 10, 2023
3e32fc5
add split op support
Nov 10, 2023
74705ca
updates
Nov 10, 2023
8f2fc30
minor change
Nov 10, 2023
dd1bb76
[js/webgpu] Fix scalar uniform (#18318)
axinging Nov 10, 2023
87744e5
fix reference to Microsoft.GSL::GSL in CMake build scripts when enabl…
bverhagen Nov 10, 2023
2d23b4e
Update min macos version (#18251)
snnn Nov 10, 2023
a6f8ec6
refine and fix the split op builder logic
Nov 10, 2023
28c23ae
[js/webgpu] Fix conv2d with activation (#18388)
qjia7 Nov 10, 2023
64c91d7
Fix ability to use patch on Windows CI machines (#18356)
skottmckay Nov 10, 2023
8dba6ef
[js/webgpu] Add uniforms support to concat op (#18238)
axinging Nov 10, 2023
aee52cb
minor update
Nov 10, 2023
eb3518b
minor update
Nov 10, 2023
6b0c97b
[js/web] fix typescript type check (#18343)
fs-eire Nov 11, 2023
0c8c001
[js/webgpu] Use builtin num_workgroups to fix shader key conflict (#1…
axinging Nov 11, 2023
d87d480
Remove deprecated vscode settings (#18349)
justinchuby Nov 11, 2023
646f77a
Align context virtuals (#18396)
RandySheriffH Nov 11, 2023
a46c79d
fix llama2-70b bug, add document (#18398)
frank-dong-ms Nov 11, 2023
8d298f6
Fix xnnpack compile error on arm32 (#18291)
skottmckay Nov 11, 2023
cd4b487
add support for softmax 13- cases
Nov 11, 2023
af462fe
unit test
Nov 11, 2023
f375d83
update
Nov 12, 2023
5dba904
update
Nov 12, 2023
cbf0cf0
[WebNN EP] Disable clamp fusion for WebNN GPU (#18386)
Honry Nov 12, 2023
73ed34a
[WebNN EP] Support numThreads option for WebNN CPU device (#18054)
Honry Nov 13, 2023
4a82030
[ORTModule] Symbolic Shape Support for Triton Codegen (#18317)
centwang Nov 13, 2023
949ac4b
[js/webgpu] Support uniforms for gather (#18312)
axinging Nov 13, 2023
0d22d64
Update SDXL demo and documents (#18395)
tianleiwu Nov 13, 2023
4f2bd38
[QNN EP] Ensure QDQ Split input/output quant params are equal (#18332)
adrianlizarraga Nov 13, 2023
c3b5479
Remove extra CUDA version flag (#18397)
snnn Nov 13, 2023
a62a500
[ROCm] Update CK version (#17628)
PeixuanZuo Nov 13, 2023
f19c673
If Branch Constant Folding (#18105)
yuslepukhin Nov 14, 2023
888ef95
updates
Nov 14, 2023
37d8bed
[ROCm] add migraphx into onnxruntime-training-rocm package (#18339)
PeixuanZuo Nov 14, 2023
8ff41ae
Fix 4 more bad delegates missing the attribute that cause iOS AOT err…
skottmckay Nov 14, 2023
897c1c1
Set DML package name correctly in CI (#18405)
skottmckay Nov 14, 2023
0b16185
build wasm with linux (#18106)
mszhanyi Nov 14, 2023
a09099f
Remove XNNPack from web pipelines (#18419)
snnn Nov 14, 2023
3e1cf71
[TensorRT EP] Fix bug for handling outer scope values in GetCapabilit…
chilo-ms Nov 14, 2023
5aeed62
Bump axios from 1.3.4 to 1.6.1 in /js/node (#18400)
dependabot[bot] Nov 14, 2023
c9d5345
[QNN EP] Clean-up todo for OnnxInputInfo (#18416)
adrianlizarraga Nov 14, 2023
a6b515f
[QNN EP] Update Where Op UT to include the issue relate to data layou…
HectorSVC Nov 14, 2023
cbde30c
update build.py args
Nov 14, 2023
d22b1af
[js/web] add CI steps to log info for test failure investigating (#18…
fs-eire Nov 14, 2023
27d0685
Remove Node.js tool installer task from web ci pipeline (#18434)
snnn Nov 14, 2023
2e55138
update objc pod script
Nov 14, 2023
fc7926a
update framework_info path for ios/macos to make it consistent
Nov 14, 2023
d30ffb4
add arm64 arch in config
Nov 15, 2023
47ff783
modify c.podspec template
Nov 15, 2023
f9af940
onboard MoE (#18279)
wangyems Nov 15, 2023
05526b3
Adding new yaml file for downloading cuda, and trt from azure blob (#…
jchen351 Nov 15, 2023
d738ff1
SDXL demo: consistent opt shape and seed (#18445)
tianleiwu Nov 15, 2023
b0699d9
Support Graph Input and Initializer for GatherToSplit Fusion (#18412)
centwang Nov 15, 2023
ed89ca5
[ORTModule] Support User Config for Triton Codegen, Bugfix for Reduce…
centwang Nov 15, 2023
586f06f
[js/web] set noUnusedParameters to true and fix a few bugs (#18404)
fs-eire Nov 15, 2023
0a4d76d
MLAS AArch64 quantized int4 Gemm kernel (#18031)
edgchen1 Nov 15, 2023
83dcadd
updates config
Nov 15, 2023
b653bd6
update
Nov 15, 2023
3e79055
fix split op logic and enable tests
Nov 15, 2023
cc840c5
Fix a bug in SaveInputOutputNamesToNodeMapping function (#18456)
snnn Nov 15, 2023
6f863ae
Allow optional axes tensor to be null and ignore it as optional (#18423)
yuslepukhin Nov 16, 2023
6f9f653
[wasm] increase test max memory from 2G to 4G (#18459)
fs-eire Nov 16, 2023
18a3675
[TensorRT EP] Only instantiate TRT builder once (#18100)
chilo-ms Nov 16, 2023
751aa8d
fix axis of layernorm for UpstreamReshape (#18425)
guyang3532 Nov 16, 2023
16d7f55
lora conv1d replacement (#16643)
zhijxu-MS Nov 16, 2023
e31fe55
fix softmax handling
Nov 16, 2023
119e86e
SDXL demo: Add Option to disable refiner (#18455)
tianleiwu Nov 16, 2023
999752a
[WebNN EP] Support GreaterOrEqual and LessOrEqual ops (#18411)
Honry Nov 16, 2023
b291b20
[JS/Web]Added uniforms support to Slice op. (#18422)
satyajandhyala Nov 16, 2023
3588fba
[TensorRT EP] Fix memory leak for cudnn/cublas (#18467)
chilo-ms Nov 16, 2023
b6b9aff
Allow empty shapes and do not validate them for inputs/outputs (#18442)
yuslepukhin Nov 16, 2023
e7a524f
Update to allow large models to be checked for mobile support. (#18357)
skottmckay Nov 16, 2023
6a4e448
[QNN EP] Support Qnn MatMul with 2 dynamic inputs which are uint16 qu…
HectorSVC Nov 16, 2023
adb56df
Aciddelgado/gqa local (#18375)
aciddelgado Nov 16, 2023
2273c98
merge nested framework_info.json
Nov 16, 2023
f1cb9e1
update naming
Nov 16, 2023
1448f36
update json templates
Nov 17, 2023
d8dd54b
simplier impl with softmaxnd
Nov 17, 2023
f17b6af
[TensorRT EP] Fix bug for no nodes in subgraph at GetCapability (#18449)
chilo-ms Nov 17, 2023
1f1119f
minor updates
Nov 17, 2023
d73073d
remove full protobuf requirement for tensorrt ep (#18413)
jywu-msft Nov 17, 2023
5eb5056
Always run emsdk_env.sh before build.py, even when ccache is disabled…
snnn Nov 17, 2023
1a29460
rope support 4D input tensor (#18454)
kailums Nov 17, 2023
a5537f2
[WebNN Ep] Slice's axes and steps inputs should be constant initializ…
Honry Nov 17, 2023
fac3e33
[js/web] JSEP Attention & MultiHeadAttention (#17742)
dakenf Nov 17, 2023
3a68692
build only mac arch for testing on packaging pipeline temp
Nov 17, 2023
06418c6
test config
Nov 17, 2023
41f9379
Update NDK version to 26.1.10909125 (#18493)
snnn Nov 17, 2023
e4acd53
expand time out
Nov 17, 2023
0bd59d6
address pr comments
Nov 18, 2023
2e89ac4
fix
Nov 18, 2023
0d96ebe
update
Nov 18, 2023
cbb85b4
[CoreML] Adapt to `MLMultiArray.dataPointer` deprecation (#17726)
NickLucche Nov 18, 2023
0233329
Removed all the deprecated python training code and related tests and…
askhade Nov 18, 2023
34c5424
[js] update a few packages (#18499)
fs-eire Nov 18, 2023
53ea59d
add macos test package target in the test app
Nov 18, 2023
9364c05
Update web-ci.yml: remove depth=1 (#18500)
snnn Nov 18, 2023
20cf553
update license comments
Nov 18, 2023
84be6eb
podfile.template
Nov 18, 2023
172ab19
enable macos package test in script
Nov 18, 2023
53917a3
Move up members in Lite Custom Op hierarchy for possible memleaks. (#…
RandySheriffH Nov 18, 2023
97cc40d
Add fusion patterns for conformer-transducer model (#18461)
apsonawane Nov 19, 2023
dc9ab4f
Update setup.py: replace libcudart.so.12.0 with libcudart.so.12 (#18501)
snnn Nov 20, 2023
3bcc137
Tiny change to trigger the update of DORT's CI image (#18507)
wschin Nov 20, 2023
d97fc18
Create a new Python Package pipeline for CUDA 12 (#18348)
jchen351 Nov 20, 2023
1af0681
Bfloat16 support for MatMulBnb4, Training support bitsandbytes>=0.41.…
jambayk Nov 20, 2023
1dd9bf5
Remove setup_env_azure.bat (#18482)
jchen351 Nov 20, 2023
247ce21
[js] optimize eslint config (#18460)
fs-eire Nov 20, 2023
65356e6
configure optional exclude macos target for not pod onnxruntime-c
Nov 20, 2023
cc54202
Create edges with arg positons correctly accounting for non-existing …
yuslepukhin Nov 20, 2023
abdf8b7
[js/webgpu] Optimize broadcast binary. (#18185)
qjia7 Nov 21, 2023
9630aa7
run pod deintegrater
Nov 21, 2023
33f5010
rename the test project
Nov 21, 2023
0e5c660
rename folder to apple_package_test
Nov 21, 2023
e306561
modify path names/xcworkspace name in pipelines, etc.
Nov 21, 2023
5634893
address pr comments
Nov 21, 2023
c7fd930
[js/web] unify resolve rules for "Clip" (#18527)
fs-eire Nov 21, 2023
d8d5b29
address pr comments
Nov 21, 2023
a608c00
fix past-kv in general LLM exporter (#18529)
wejoncy Nov 21, 2023
29a409a
Add missing flags DISABLE_FLOAT8_TYPES in GemmFloat8 custom operator …
xadupre Nov 21, 2023
2a01622
Hide NPU Adapter selection behind macro (#18515)
smk2007 Nov 21, 2023
bfa68b2
minor updates and fix ci
Nov 21, 2023
680a526
Training packaging pipeline for cuda12 (#18524)
ajindal1 Nov 21, 2023
81a763a
Make TensorShapeVector to use InlinedVector<Int64_t> to reduce on tem…
yuslepukhin Nov 21, 2023
ac8598a
[js/webgpu] enable f16 for concat (#18528)
qjia7 Nov 21, 2023
7497316
update file names
Nov 21, 2023
8a3e2dc
address pr comments
Nov 22, 2023
a86fbbd
Merge branch 'yguo/coreml-softmax-op-support' of https://github.com/m…
YUNQIUGUO Nov 22, 2023
0a69346
linting
YUNQIUGUO Nov 22, 2023
bc30357
Merge branch 'yguo/macos-pod-support' of https://github.com/microsoft…
YUNQIUGUO Nov 22, 2023
b7ab82e
linting
YUNQIUGUO Nov 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ elseif(onnxruntime_BUILD_APPLE_FRAMEWORK)
endif()
set(INFO_PLIST_PATH "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
configure_file(${REPO_ROOT}/cmake/Info.plist.in ${INFO_PLIST_PATH})
configure_file(
${REPO_ROOT}/tools/ci_build/github/apple/framework_info.json.template
${CMAKE_CURRENT_BINARY_DIR}/framework_info.json)
if (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
configure_file(
${REPO_ROOT}/tools/ci_build/github/apple/framework_info_ios.json.template
${CMAKE_CURRENT_BINARY_DIR}/framework_info.json)
else() #macos
configure_file(
${REPO_ROOT}/tools/ci_build/github/apple/framework_info_macos.json.template
${CMAKE_CURRENT_BINARY_DIR}/framework_info_macos.json)
endif()
set_target_properties(onnxruntime PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A
Expand Down
7 changes: 6 additions & 1 deletion tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,12 @@ def run_ios_tests(args, source_dir, config, cwd):

if args.build_apple_framework:
package_test_py = os.path.join(source_dir, "tools", "ci_build", "github", "apple", "test_ios_packages.py")
framework_info_file = os.path.join(cwd, "framework_info.json")
framework_info_file_path = os.path.join(cwd, "framework_info.json")
framework_info_file = ""
if os.path.exists(framework_info_file_path):
framework_info_file = os.path.join(cwd, "framework_info.json")
else:
framework_info_file = os.path.join(cwd, "framework_info_macos.json")
dynamic_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot)
static_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot, "static_framework")
# test dynamic framework
Expand Down
7 changes: 7 additions & 0 deletions tools/ci_build/github/apple/build_and_assemble_ios_pods.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general: "ios" in the script file names (and perhaps other names) is not accurate anymore. maybe we can get rid of it or replace it with "apple".

Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def parse_args():
)

build_framework_group.add_argument("--include-ops-by-config")
build_framework_group.add_argument("--build-for-macosx")
build_framework_group.add_argument(
"--build-settings-file", required=True, help="The positional argument of build_ios_framework.py."
)
Expand Down Expand Up @@ -114,6 +115,11 @@ def main():
if args.include_ops_by_config is not None:
build_ios_framework_args += ["--include_ops_by_config", args.include_ops_by_config]

framework_info_macos_file = None
if args.build_for_macosx:
framework_info_macos_file = build_dir / "framework_info_macos.json"
build_ios_framework_args += ["--build_for_macosx"]

build_ios_framework_args += ["--build_dir", str(build_dir), args.build_settings_file]

run(build_ios_framework_args)
Expand Down Expand Up @@ -148,6 +154,7 @@ def main():
framework_dir=build_dir / "framework_out" / "onnxruntime.xcframework",
public_headers_dir=build_dir / "framework_out" / "Headers",
package_variant=package_variant,
framework_info_macos_file=framework_info_macos_file,
)

if args.test:
Expand Down
50 changes: 39 additions & 11 deletions tools/ci_build/github/apple/build_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@
else:
raise ValueError("build_params is required in the build config file")

build_params_for_macos = []
if "macosx" in build_settings["build_osx_archs"]:
if "build_params_for_macos" in build_settings_data:
build_params_for_macos += build_settings_data["build_params_for_macos"]
else:
raise ValueError("build_params_for_macos is required when macosx arch is specified in the build config")

build_settings["build_params"] = build_params
build_settings["build_params_for_macos"] = build_params_for_macos

return build_settings


Expand All @@ -63,20 +72,31 @@
subprocess.run(build_command, shell=False, check=True, cwd=REPO_DIR)

# get the compiled lib path
framework_dir = os.path.join(
build_dir_current_arch,
build_config,
build_config + "-" + sysroot,
"onnxruntime.framework"
if build_dynamic_framework
else os.path.join("static_framework", "onnxruntime.framework"),
)
framework_dir = pathlib.Path("")
Fixed Show fixed Hide fixed
if sysroot == "macosx":
framework_dir = os.path.join(
build_dir_current_arch,
build_config,
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
"onnxruntime.framework"
if build_dynamic_framework
else os.path.join("static_framework", "onnxruntime.framework"),
)
else:
framework_dir = os.path.join(
build_dir_current_arch,
build_config,
build_config + "-" + sysroot,
"onnxruntime.framework"
if build_dynamic_framework
else os.path.join("static_framework", "onnxruntime.framework"),
)
ort_libs.append(os.path.join(framework_dir, "onnxruntime"))

# We only need to copy Info.plist, framework_info.json, and headers once since they are the same
framework_info_json_file_name = "framework_info_macos.json" if sysroot == "macosx" else "framework_info.json"
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
if not info_plist_path:
info_plist_path = os.path.join(build_dir_current_arch, build_config, "Info.plist")
framework_info_path = os.path.join(build_dir_current_arch, build_config, "framework_info.json")
framework_info_path = os.path.join(build_dir_current_arch, build_config, framework_info_json_file_name)
headers = glob.glob(os.path.join(framework_dir, "Headers", "*.h"))

# manually create the fat framework
Expand Down Expand Up @@ -110,7 +130,12 @@
# Temp dirs to hold building results
intermediates_dir = os.path.join(build_dir, "intermediates")
build_config = args.config
base_build_command = [sys.executable, BUILD_PY] + build_settings["build_params"] + ["--config=" + build_config]

base_build_command = []
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
if args.build_for_macosx:
base_build_command += [sys.executable, BUILD_PY] + build_settings["build_params_for_macos"] + ["--config=" + build_config]
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
else:
base_build_command += [sys.executable, BUILD_PY] + build_settings["build_params"] + ["--config=" + build_config]

if args.include_ops_by_config is not None:
base_build_command += ["--include_ops_by_config=" + str(args.include_ops_by_config.resolve())]
Expand All @@ -134,7 +159,8 @@
framework_dirs.append(framework_dir)
# podspec and headers for each sysroot are the same, pick one of them
if not framework_info_path:
framework_info_path = os.path.join(os.path.dirname(framework_dir), "framework_info.json")
framework_info_json_file_name = "framework_info_macos.json" if sysroot == "macosx" else "framework_info.json"
framework_info_path = os.path.join(os.path.dirname(framework_dir), framework_info_json_file_name)
public_headers_path = os.path.join(os.path.dirname(framework_dir), "onnxruntime.framework", "Headers")

# create the folder for xcframework and copy the LICENSE and podspec file
Expand Down Expand Up @@ -201,6 +227,8 @@

parser.add_argument("--path_to_protoc_exe", type=pathlib.Path, help="Path to protoc exe.")

parser.add_argument("--build_for_macosx", action="store_true", help="Enable macos build in pods.")

args = parser.parse_args()

if not args.build_settings_file.resolve().is_file():
Expand Down
16 changes: 16 additions & 0 deletions tools/ci_build/github/apple/c/assemble_c_pod_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def assemble_c_pod_package(
public_headers_dir: pathlib.Path,
framework_dir: pathlib.Path,
package_variant: PackageVariant,
framework_info_macos_file=None,
):
"""
Assembles the files for the C/C++ pod package in a staging directory.
Expand All @@ -53,6 +54,7 @@ def assemble_c_pod_package(
:param public_headers_dir Path to the public headers directory to include in the pod.
:param framework_dir Path to the onnxruntime framework directory to include in the pod.
:param package_variant The pod package variant.
:param Optional framework_info_macos_file Path to the framework_info_macos.json file containing additional values for the podspec.
:return Tuple of (package name, path to the podspec file).
"""
staging_dir = staging_dir.resolve()
Expand All @@ -61,6 +63,11 @@ def assemble_c_pod_package(
framework_dir = framework_dir.resolve(strict=True)

framework_info = load_json_config(framework_info_file)
framework_info_macos = None
if framework_info_macos_file is not None:
framework_info_macos_file = framework_info_macos_file.resolve(strict=True)
framework_info_macos = load_json_config(framework_info_macos_file)

pod_config = load_json_config(get_pod_config_file(package_variant))

pod_name = pod_config["name"]
Expand All @@ -78,6 +85,7 @@ def assemble_c_pod_package(
variable_substitutions = {
"DESCRIPTION": pod_config["description"],
"IOS_DEPLOYMENT_TARGET": framework_info["IOS_DEPLOYMENT_TARGET"],
"MACOSX_DEPLOYMENT_TARGET": framework_info_macos["MACOSX_DEPLOYMENT_TARGET"] if framework_info_macos is not None else "",
"LICENSE_FILE": "LICENSE",
"NAME": pod_name,
"ORT_C_FRAMEWORK": framework_dir.name,
Expand Down Expand Up @@ -132,6 +140,13 @@ def parse_args():
parser.add_argument(
"--variant", choices=PackageVariant.all_variant_names(), required=True, help="Pod package variant."
)
parser.add_argument(
"--framework-info-macos-file",
type=pathlib.Path,
required=False,
help="Path to the framework_info_macos.json file containing additional values for the podspec.(Optional) "
"This file should be generated by CMake in the build directory.",
)

return parser.parse_args()

Expand All @@ -146,6 +161,7 @@ def main():
public_headers_dir=args.public_headers_dir,
framework_dir=args.framework_dir,
package_variant=PackageVariant[args.variant],
framework_info_macos_file=args.framework_info_macos_file if args.framework_info_macos_file is not None else None,
)

return 0
Expand Down
2 changes: 1 addition & 1 deletion tools/ci_build/github/apple/c/c.podspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |spec|
spec.homepage = "https://github.com/microsoft/onnxruntime"
spec.source = { :http => "file:///http_source_placeholder" }
spec.summary = "@SUMMARY@"
spec.platform = :ios, "@IOS_DEPLOYMENT_TARGET@"
spec.platform = { :ios => "@IOS_DEPLOYMENT_TARGET@", :osx => "@MACOSX_DEPLOYMENT_TARGET@" }
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
spec.vendored_frameworks = "@ORT_C_FRAMEWORK@"
spec.static_framework = true
spec.weak_framework = [ @WEAK_FRAMEWORK@ ]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"build_osx_archs": {
"macosx": [
"x86_64"
]
},
"build_params_for_macos": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
"--apple_deploy_target=10.14"
YUNQIUGUO marked this conversation as resolved.
Show resolved Hide resolved
],
"build_params": [
"--ios",
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--use_coreml",
"--use_xnnpack",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF",
"--apple_deploy_target=12.0"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MACOSX_DEPLOYMENT_TARGET": "@CMAKE_OSX_DEPLOYMENT_TARGET@",
"WEAK_FRAMEWORK": "@APPLE_WEAK_FRAMEWORK@"
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,16 @@ stages:
# create and test mobile pods
- script: |
python tools/ci_build/github/apple/build_and_assemble_ios_pods.py \
--build-dir "$(Build.BinariesDirectory)/ios_framework" \
--build-dir "$(Build.BinariesDirectory)/macos_ios_framework" \
--staging-dir "$(Build.BinariesDirectory)/staging" \
--pod-version "$(ortPodVersion)" \
--test \
--variant ${{ parameters.packageVariant }} \
--build-settings-file "${{ variables.buildSettingsFile }}" \
--build-for-macosx \
${{ variables.optionalIncludeOpsByConfigOption }} \
-b="--path_to_protoc_exe=$(Build.BinariesDirectory)/protobuf_install/bin/protoc"
displayName: "Build iOS framework and assemble pod package files"
displayName: "Build macOS/iOS framework and assemble pod package files"

- script: |
python tools/ci_build/github/apple/test_ios_packages.py \
Expand Down
Loading