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] libonnxruntime_providers_shared.so statically linked? #23355

Open
zeng-xiao opened this issue Jan 14, 2025 · 0 comments
Open

[Build] libonnxruntime_providers_shared.so statically linked? #23355

zeng-xiao opened this issue Jan 14, 2025 · 0 comments
Labels
build build issues; typically submitted using template

Comments

@zeng-xiao
Copy link

Describe the issue

I used the following compilation parameters to generate libonnxruntime_providers_shared.so:
python3 tools/ci_build/build.py
--build_dir $buildDir
--cmake_generator Ninja
--config Debug
--skip_submodule_sync
--skip_tests
--allow_running_as_root \
--build_shared_lib
--update
--compile_no_warning_as_error
--cmake_extra_defines CMAKE_INSTALL_PREFIX=$installDir
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF
--cmake_extra_defines onnxruntime_BUILD_BENCHMARKS=OFF
--cmake_extra_defines CMAKE_VERBOSE_MAKEFILE=ON \
--cmake_extra_defines ONNX_BUILD_SHARED_LIBS=ON \
--build 2>&1 | tee make.log

Then I got the following information:
:/onnxruntime.git.upstream.github.noasan/build/Debug$ file libonnxruntime_providers_shared.so
libonnxruntime_providers_shared.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c05678b91a1c454abbd3779d337570a0e48561f6, with debug_info, not stripped
:
/onnxruntime.git.upstream.github.noasan/build/Debug$ ldd libonnxruntime_providers_shared.so
statically linked

However, in the community-released package, I saw the following information:
/onnxruntime-linux-x64/onnxruntime-linux-x64-1.20.1/lib$ ldd libonnxruntime_providers_shared.so
linux-vdso.so.1 (0x00007fff44faf000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa567800000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa567b18000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa567aea000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa567400000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa567c1c000)
:
/onnxruntime-linux-x64/onnxruntime-linux-x64-1.20.1/lib$ file libonnxruntime_providers_shared.so
libonnxruntime_providers_shared.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5fd3c27badfc98ce8ba513ea37a6e8938b2917ac, stripped

The following is my working platform:
~/onnxruntime-linux-x64/onnxruntime-linux-x64-1.20.1/lib$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

Urgency

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

Target platform

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble

Build script

python3 tools/ci_build/build.py
--build_dir $buildDir
--cmake_generator Ninja
--config Debug
--skip_submodule_sync
--skip_tests
--allow_running_as_root \
--build_shared_lib
--update
--compile_no_warning_as_error
--cmake_extra_defines CMAKE_INSTALL_PREFIX=$installDir
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF
--cmake_extra_defines onnxruntime_BUILD_BENCHMARKS=OFF
--cmake_extra_defines CMAKE_VERBOSE_MAKEFILE=ON \
--cmake_extra_defines ONNX_BUILD_SHARED_LIBS=ON \
--build 2>&1 | tee make.log

Error / output

:/onnxruntime.git.upstream.github.noasan/build/Debug$ file libonnxruntime_providers_shared.so
libonnxruntime_providers_shared.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c05678b91a1c454abbd3779d337570a0e48561f6, with debug_info, not stripped
:
/onnxruntime.git.upstream.github.noasan/build/Debug$ ldd libonnxruntime_providers_shared.so
statically linked

Visual Studio Version

No response

GCC / Compiler Version

gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

@zeng-xiao zeng-xiao added the build build issues; typically submitted using template label Jan 14, 2025
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
Projects
None yet
Development

No branches or pull requests

1 participant