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

[Build] MAC static library 1.17.0 : very big in size #19513

Closed
sarojlo opened this issue Feb 13, 2024 · 5 comments
Closed

[Build] MAC static library 1.17.0 : very big in size #19513

sarojlo opened this issue Feb 13, 2024 · 5 comments
Labels
build build issues; typically submitted using template release:1.17.0

Comments

@sarojlo
Copy link

sarojlo commented Feb 13, 2024

Describe the issue

  • Compiled the code for MAC arm64/x64 , need static library , buildType minSizeRel
  • Used libtool to stich all libraries
    a. libtool -static -o libabsl.a libabsl_*.a
    b. libtool -static -o libonnxruntime_static.a libclog.a libcpuinfo.a libonnxruntime_optimizer.a libonnxruntime_util.a libonnxruntime_common.a libonnxruntime_flatbuffers.a libonnxruntime_framework.a libonnxruntime_graph.a libonnxruntime_mlas.a libonnxruntime_providers.a libflatbuffers.a libonnx.a libonnxruntime_session.a libonnx_proto.a libprotobuf-lite.a libre2.a libnsync_cpp.a libabsl.a
  1. Resulted library is 1+GB

Urgency

No response

Target platform

MAC

Build script

python3 $(Build.SourcesDirectory)/onnxruntime/tools/ci_build/build.py --config MinSizeRel --skip_tests --build_dir MacOS --osx_arch $(platform) --use_xcode --parallel --apple_deploy_target 11.0

Error / output

Built library are big

Visual Studio Version

No response

GCC / Compiler Version

No response

@sarojlo sarojlo added the build build issues; typically submitted using template label Feb 13, 2024
@sarojlo
Copy link
Author

sarojlo commented Feb 14, 2024

image

i see liboonxruntime_providers is causing most of it

@skottmckay
Copy link
Contributor

Guessing all the debug symbols are still there and you might need to use strip to remove them.

@sarojlo
Copy link
Author

sarojlo commented Feb 14, 2024

let me try that , but still overall size were not that big without striping in 1.14

@skottmckay
Copy link
Contributor

You could use bloaty to investigate further (requires the symbols though).

@skottmckay
Copy link
Contributor

Assuming it was due to debug symbols. Re-open if further investigation is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template release:1.17.0
Projects
None yet
Development

No branches or pull requests

3 participants