Skip to content

[bug] ort-sys Find dependency issues #497

@smagical

Description

@smagical

Compile static using commands onnxruntime
build.bat --config Release --parallel --compile_no_warning_as_error --skip_tests --update --build --use_full_protobuf --enable_msvc_static_runtime --use_vcpkg
I used vcpkg, but the compiled folder does not include _deps.
The compiler searches for statically compiled libraries in build.rs, and skips this directory if it doesn't exist.
if lib_dir.join(platform_format_lib("onnxruntime_common")).exists() && external_lib_dir.exists()
external_lib_dir is a folder named _deps, The dependencies for using vcpkg are located in the vcpkg_installed directory.
let vcpkg_target = match env::var("TARGET").as_deref() { Ok("i686-pc-windows-msvc") => Some("x86-windows"), Ok("x86_64-pc-windows-msvc") => Some("x64-windows"), Ok("x86_64-uwp-windows-msvc") => Some("x64-uwp"), Ok("aarch64-pc-windows-msvc") => Some("arm64-windows"), Ok("aarch64-uwp-windows-msvc") => Some("arm64-uwp"), Ok("aarch64-apple-darwin") => Some("arm64-osx"), Ok("x86_64-apple-darwin") => Some("x64-osx"), Ok("x86_64-unknown-linux-gnu") => Some("x64-linux"), Ok("armv7-linux-androideabi") => Some("arm-neon-android"), Ok("x86_64-linux-android") => Some("x64-android"), Ok("aarch64-linux-android") => Some("arm64-android"), _ => None };
The target x86_64-pc-windows-msvc is set to x64-windows-static under static compilation, and it seems there's also a version under x64-windows.this will cause the dependency search to be missing. I'm not very familiar with this aspect.

Sorry, English is not my native language, so my expression may be a little unclear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions