Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
713 views
in Technique[技术] by (71.8m points)

xcode - Build static framework fro Tensorflow Lite on iOS

I am trying to cross compile Tensorflow Lite (2.5, nightly build) for iOS. I would like to build a static framework. Here is the build command I used:

bazel build --config=ios_arm64 -c opt //tensorflow/lite/ios:TensorFlowLiteC_framework

The TensorFlowLiteC_framework target is defined in tensorflow/tensorflow/lite/ios/BUILD.apple as

tflite_ios_static_framework(
    name = "TensorFlowLiteC_framework",
    hdrs = [
        ":c_api.h",
        ":common.h",
        ":xnnpack_delegate.h",
        "//tensorflow/lite/c:c_api_types.h",
    ],
    allowlist_symbols_file = ":allowlist_TensorFlowLiteC.txt",
    bundle_name = "TensorFlowLiteC",
    minimum_os_version = TFL_MINIMUM_OS_VERSION,
    deps = [
        ":tensorflow_lite_c",
    ],
)

I had expected the resulting framework to be a static framework, but it appears to be a dynamic framework instead. Inside the TensorFlowLiteC.framework folder, there is a binary file TensorFlowLiteC. If I do file TensorFlowLiteC, I get:

TensorFlowLiteC: Mach-O universal binary with 1 architecture: [arm64:Mach-O 64-bit object arm64]
TensorFlowLiteC (for architecture arm64):   Mach-O 64-bit object arm64

This appears to be a dynamic lib file to me. As far as I know, if this was a static archive, I should have gotten: current ar archive.

Is there a way to actually build Tensorflow Lite into an actual static framework for iOS?

question from:https://stackoverflow.com/questions/65894135/build-static-framework-fro-tensorflow-lite-on-ios

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...