pykeio / ort

Fast ML inference & training for Rust with ONNX Runtime
https://ort.pyke.io/
Apache License 2.0
786 stars 91 forks source link

Linking with `link.exe` failed #240

Closed Chiranmb closed 1 month ago

Chiranmb commented 1 month ago

I am on windows machine:

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-pc-windows-msvc
release: 1.79.0
LLVM version: 18.1.7

I am able to run other rust code fine. When i try to load onnx model using ort, I get very large error message:

error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\chiran\\AppData\\Local\\Temp\\2\\rustcvMaEGp\\symbols.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.13egghp7bt18x9en.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.17d4krqtiqqu5ffe.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.2299tzm047oghhbw.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.27cto22k7twfwvza.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.29bp9ca36rodyz83.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.2l3rxlnlqr2gpyg2.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.2lgmsawn5v97qpb9.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.2oc9d7kgrmcuibfz.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.2ual4penfjyb697r.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.37tcok89gmwyba98.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3br47tqzeb1jq6u8.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3bw4066pfpdxnars.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3f6tsflunyytxyoj.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3fymdkyflxxbz5hm.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3k41fhom5ij3hc9h.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3ko5okheah95e1f9.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3tejwlw8aw9m5nsy.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3vbya0gvz4fv9o3.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3vgj1a2scn2iatoq.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.3z43qp0vz4gaf486.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.425jrgr0rxcgnhdj.rcgu.o"
"C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.46yecmegfbj6c4rg.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4853mgyv7cg456gp.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.49mufvlreq35zdre.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4a4kvpx5jb9u2q1r.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4fgwsr4qqlc1ppeh.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4g58statkm0gwm5o.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4nqk38wmkfay9etm.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4nyfx7t32xgyr1w8.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4sh3s3g6kbxt3zs0.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.4vnbg4ymm8k5xe06.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.51sussnnb171oc89.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.55di7s15qjy5pel.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.59m8xeyur032ja96.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.60thiv759zcbiea.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.a6jx9ebgxyjz8i5.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.c7r5ncbx5rjn5eo.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.eegn4y1jp347e03.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.lhnadxtmxuwaryl.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.oxpjfzjtkkpg352.rcgu.o" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.14hdc5i3isrloxhw.rcgu.o" "/LIBPATH:C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps" "/LIBPATH:C:\\Users\\chiran\\AppData\\Local\\ort.pyke.io\\dfbin\\x86_64-pc-windows-msvc\\EB2BCD1778C5934437D4C5B17F67DEAF5F67D2E3C18C7298973EACD41113DC01\\onnxruntime\\lib" "/LIBPATH:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libort-ff2d39f0ac2919dc.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libhalf-a3a9280da22c8b61.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libcfg_if-70fa9859a6a2c7d0.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libndarray-a8b64f95662c0c59.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libmatrixmultiply-45cf025e21542843.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libnum_complex-17d8c1686ae2dffc.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libnum_integer-100201d6a7be5632.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libnum_traits-3d5eeda49960ee77.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\librawpointer-5919990d153de207.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libthiserror-204f0a99d357021e.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libtracing-167117e64d96f847.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libpin_project_lite-355f64bac4dbc3be.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libtracing_core-eaca450cbf28358a.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libonce_cell-e68825091208ed3d.rlib" "C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\libort_sys-f5ffb0bd00bfeab5.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-3f3d3458f17b6f6c.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-abeae64c6d03c880.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-3e121b6b11e11352.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-e2e5cc9326100cbd.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-69a32640c1d25dc0.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-f21c671d69976121.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-e2cf21c27cba2cec.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-bc730a99dc830cc7.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-9e9cd975a713105d.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-8dee4f8da48c4bc1.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-f028abb8ba1671f1.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-d1841cbd6e8b84a0.rlib" "C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-eb4525b43981c490.rlib" "dxguid.lib" "DXCORE.lib" "DXGI.lib" "D3D12.lib" "DirectML.lib" "kernel32.lib" "advapi32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "ws2_32.lib" "kernel32.lib" "msvcrt.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\chiran\\Desktop\\ort-test\\target\\debug\\deps\\ort_test.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\chiran\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
          libort_sys-f5ffb0bd00bfeab5.rlib(quantization_defs.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(node_unit.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(utils.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(utils.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(ort_optimizer_api_impl.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(old.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(old.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(defs.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(quick_gelu_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(shape_input_merge.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(skip_layer_norm_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(onnx_transpose_optimization.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(matmul_bn_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(pad_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(nchwc_transformer.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(qdq_propagation.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(label_encoder_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(matmul_activation_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(matmul_add_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(matmul_transpose_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(gemm_sum_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(gemm_transpose_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(identity_elimination.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(layer_norm_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(div_mul_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(double_qdq_pairs_remover.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(fast_gelu_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(gemm_activation_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(constant_sharing.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(conv_add_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(conv_bn_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(conv_mul_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(graph_utils.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(qdq_final_cleanup.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(bias_dropout_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(bias_gelu_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(ExecutionProvider.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(reduction_ops.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(pad.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(allocation_planner.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(fallback_cpu_capability.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(insert_cast_transformer.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(ensure_unique_dq_for_node_unit.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(transformer_memcpy.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(graph.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(kernel_def_builder.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(graph_viewer.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(kernel_registry.obj) : error LNK2001: unresolved external symbol __std_find_trivial_8
          libort_sys-f5ffb0bd00bfeab5.rlib(gather_fusion.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(defs.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(stringpiece.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(inference_session.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(ExecutionProvider.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(einsum.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(op_identifier_utils.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1
          libort_sys-f5ffb0bd00bfeab5.rlib(selector_action_transformer.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(GraphDescBuilder.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(MLOperatorAuthorImpl.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(OperatorHelper.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(utils.cc.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(inference_session.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(execution_frame.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(graph_utils.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(avx2_weight_s8_to_u8.obj) : error LNK2001: unresolved external symbol __std_find_trivial_4
          libort_sys-f5ffb0bd00bfeab5.rlib(re2.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(dfa.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(regexp.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(inference_session.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(arenastring.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(message_lite.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(environment.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
          libort_sys-f5ffb0bd00bfeab5.rlib(path.obj) : error LNK2019: unresolved external symbol __std_find_trivial_2 referenced in function "wchar_t const * __cdecl std::__std_find_trivial<wchar_t const ,wchar_t>(wchar_t const * const,wchar_t const * const,wchar_t)" (??$__std_find_trivial@$$CB_W_W@std@@YAPEB_WQEB_W0_W@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2001: unresolved external symbol __std_find_trivial_2
          libort_sys-f5ffb0bd00bfeab5.rlib(deep_cpu_gru.obj) : error LNK2019: unresolved external symbol __std_min_element_4 referenced in function "int const * __cdecl std::__std_min_element<int const >(int const * const,int const * const)" (??$__std_min_element@$$CBH@std@@YAPEBHQEBH0@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(uni_dir_attn_lstm.obj) : error LNK2001: unresolved external symbol __std_min_element_4
          libort_sys-f5ffb0bd00bfeab5.rlib(uni_dir_attn_lstm.obj) : error LNK2019: unresolved external symbol __std_max_element_4 referenced in function "public: __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> ><char *,0>(char *,char *,class std::allocator<char> const &)" (??$?0PEAD$0A@@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEAD0AEBV?$allocator@D@1@@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(deep_cpu_gru.obj) : error LNK2001: unresolved external symbol __std_max_element_4
          libort_sys-f5ffb0bd00bfeab5.rlib(bias_softmax_fusion.obj) : error LNK2001: unresolved external symbol __std_max_element_4
          libort_sys-f5ffb0bd00bfeab5.rlib(deep_cpu_attn_lstm.obj) : error LNK2001: unresolved external symbol __std_max_element_4
          libort_sys-f5ffb0bd00bfeab5.rlib(lstm_base.obj) : error LNK2001: unresolved external symbol __std_max_element_4
          libort_sys-f5ffb0bd00bfeab5.rlib(DmlOperatorScatter.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(PooledUploadHeap.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(defs.cc.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(resize.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(DmlOperatorGather.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(upsample.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(tfidfvectorizer.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(resize.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(svmclassifier.obj) : error LNK2001: unresolved external symbol __std_max_element_8
          libort_sys-f5ffb0bd00bfeab5.rlib(svmclassifier.obj) : error LNK2019: unresolved external symbol __std_max_element_f referenced in function "float * __cdecl std::__std_max_element<float>(float * const,float * const)" (??$__std_max_element@M@std@@YAPEAMQEAM0@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(logits_processor.obj) : error LNK2001: unresolved external symbol __std_max_element_f
          libort_sys-f5ffb0bd00bfeab5.rlib(beam_search_scorer.obj) : error LNK2001: unresolved external symbol __std_max_element_f
          libort_sys-f5ffb0bd00bfeab5.rlib(bias_softmax_fusion.obj) : error LNK2019: unresolved external symbol __std_max_4i referenced in function "auto __cdecl std::__std_max<int const >(int const
* const,int const * const)" (??$__std_max@$$CBH@std@@YA?A_PQEBH0@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ort_optimizer_api_impl.obj) : error LNK2019: unresolved external symbol __std_count_trivial_8 referenced in function "unsigned __int64 __cdecl std::__std_count_trivial<class onnxruntime::NodeArg *,class onnxruntime::NodeArg *>(class onnxruntime::NodeArg * * const,class onnxruntime::NodeArg * * const,class onnxruntime::NodeArg * const)" (??$__std_count_trivial@PEAVNodeArg@onnxruntime@@PEAV12@@std@@YA_KQEAPEAVNodeArg@onnxruntime@@0QEAV12@@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(PooledUploadHeap.obj) : error LNK2019: unresolved external symbol __std_max_8u referenced in function "auto __cdecl std::__std_max<unsigned __int64 const >(unsigned __int64 const * const,unsigned __int64 const * const)" (??$__std_max@$$CB_K@std@@YA?A_PQEB_K0@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(DmlOperatorGather.obj) : error LNK2001: unresolved external symbol __std_max_8u
          libort_sys-f5ffb0bd00bfeab5.rlib(DmlOperatorScatter.obj) : error LNK2001: unresolved external symbol __std_max_8u
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "unsigned __int64 const (* std::__DOUBLE_POW5_INV_SPLIT)[2]" (?__DOUBLE_POW5_INV_SPLIT@std@@3QAY01$$CB_KA) referenced in function "struct std::__floating_decimal_64 __cdecl std::__d2d(unsigned __int64,unsigned int)" (?__d2d@std@@YA?AU__floating_decimal_64@1@_KI@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "unsigned __int64 const (* std::__DOUBLE_POW5_SPLIT)[2]" (?__DOUBLE_POW5_SPLIT@std@@3QAY01$$CB_KA) referenced in function "struct std::__floating_decimal_64 __cdecl std::__d2d(unsigned __int64,unsigned int)" (?__d2d@std@@YA?AU__floating_decimal_64@1@_KI@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "unsigned __int64 const (* std::__POW10_SPLIT)[3]" (?__POW10_SPLIT@std@@3QAY02$$CB_KA) referenced in function "struct std::pair<char *,enum std::errc> __cdecl std::__d2fixed_buffered_n<char>(char *,char * const,double,unsigned int)" (??$__d2fixed_buffered_n@D@std@@YA?AU?$pair@PEADW4errc@std@@@0@PEADQEADNI@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "unsigned __int64 const (* std::__POW10_SPLIT_2)[3]" (?__POW10_SPLIT_2@std@@3QAY02$$CB_KA) referenced in function "struct std::pair<char *,enum std::errc> __cdecl std::__d2fixed_buffered_n<char>(char *,char * const,double,unsigned int)" (??$__d2fixed_buffered_n@D@std@@YA?AU?$pair@PEADW4errc@std@@@0@PEADQEADNI@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "public: static unsigned int const * const std::_General_precision_tables_2<float>::_Special_X_table" (?_Special_X_table@?$_General_precision_tables_2@M@std@@2QBIB) referenced in function "struct std::to_chars_result __cdecl std::_Floating_to_chars_general_precision<float>(char *,char * const,float,int)" (??$_Floating_to_chars_general_precision@M@std@@YA?AUto_chars_result@0@PEADQEADMH@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "public: static unsigned int const * const std::_General_precision_tables_2<float>::_Ordinary_X_table" (?_Ordinary_X_table@?$_General_precision_tables_2@M@std@@2QBIB) referenced in function "struct std::to_chars_result __cdecl std::_Floating_to_chars_general_precision<float>(char *,char * const,float,int)" (??$_Floating_to_chars_general_precision@M@std@@YA?AUto_chars_result@0@PEADQEADMH@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "public: static unsigned __int64 const * const std::_General_precision_tables_2<double>::_Special_X_table" (?_Special_X_table@?$_General_precision_tables_2@N@std@@2QB_KB) referenced in function "struct std::to_chars_result __cdecl std::_Floating_to_chars_general_precision<double>(char *,char
* const,double,int)" (??$_Floating_to_chars_general_precision@N@std@@YA?AUto_chars_result@0@PEADQEADNH@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(ostream_sink.obj) : error LNK2019: unresolved external symbol "public: static unsigned __int64 const * const std::_General_precision_tables_2<double>::_Ordinary_X_table" (?_Ordinary_X_table@?$_General_precision_tables_2@N@std@@2QB_KB) referenced in function "struct std::to_chars_result __cdecl std::_Floating_to_chars_general_precision<double>(char *,char * const,double,int)" (??$_Floating_to_chars_general_precision@N@std@@YA?AUto_chars_result@0@PEADQEADNH@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(qlinear_softmax.obj) : error LNK2019: unresolved external symbol __std_max_element_1 referenced in function "signed char const * __cdecl std::__std_max_element<signed char const >(signed char const * const,signed char const * const)" (??$__std_max_element@$$CBC@std@@YAPEBCQEBC0@Z)
          libort_sys-f5ffb0bd00bfeab5.rlib(uni_directional_lstm.obj) : error LNK2019: unresolved external symbol __std_minmax_element_4 referenced in function "private: void __cdecl onnxruntime::lstm::UniDirectionalLstm<float>::ComputeImpl<unsigned char>(class gsl::span<float const ,-1> const &,class gsl::span<int const ,-1> const &,int,struct onnxruntime::rnn::detail::GemmWeights<unsigned char> const &,struct onnxruntime::rnn::detail::GemmWeights<unsigned char> const &,class gsl::span<float,-1> &,class gsl::span<float,-1> &,class gsl::span<float,-1> &,class gsl::span<float,-1> &,class gsl::span<float,-1> &)" (??$ComputeImpl@E@?$UniDirectionalLstm@M@lstm@onnxruntime@@AEAAXAEBV?$span@$$CBM$0?0@gsl@@AEBV?$span@$$CBH$0?0@4@HAEBU?$GemmWeights@E@detail@rnn@2@2AEAV?$span@M$0?0@4@3333@Z)
          C:\Users\chiran\Desktop\ort-test\target\debug\deps\ort_test.exe : fatal error LNK1120: 22 unresolved externals

warning: `ort-test` (bin "ort-test") generated 1 warning
error: could not compile `ort-test` (bin "ort-test") due to 1 previous error; 1 warning emitted

Is this due to Visual Studio? Do I need to build from source?

This is my Rust code for reference:

use ort::{GraphOptimizationLevel, Session};
fn main() {
    let model = Session::builder().unwrap()
        .with_optimization_level(GraphOptimizationLevel::Level3).unwrap()
        .with_intra_threads(4).unwrap()
        .commit_from_file("model_registry/onnx_plus_model_uint8.onnx").unwrap();
}

Any help is much appreciated, thank you very much

EDIT: I have tried the suggested solution from here but to no avail. My other Rust repos works fine, only this ORT one has some problem.

decahedron1 commented 1 month ago

Is this due to Visual Studio? Do I need to build from source?

Yes, the default binaries are compiled with Visual Studio 2022 and thus must be linked with Visual Studio 2022.

You'll have to compile ONNX Runtime for Visual Studio 2019: https://onnxruntime.ai/docs/build/inferencing.html#windows & instructions for linking ort to a custom build of ONNX Runtime: https://ort.pyke.io/setup/linking

Chiranmb commented 1 month ago

Hello, thanks for your reply. If its not too much trouble, could you give me some advise on the following?

From the ort documentation page on linking (https://ort.pyke.io/setup/platforms) it shows that Windows x86-64 is "Supported. Dynamic & static binaries provided by pyke." with the disclaimer that "A recent version of Windows 10/11 & Visual Studio 2022 are required for pyke binaries."

I am on windows 10, on a x86-64 device, and I have Visual Studio 2022 installed.

The page also states that "Almost no setup will be required to get ort up and running." if my device is one of those marked with the green circle.

However, if I simply add ort as part of my dependencies

[dependencies]
ort = "2.0.0-rc.4"

I get the linking error again.

Although I am currently in the midst of compiling ONNX runtime for windows from the microsoft github and going to try to do the linking later, it seems strange that the website says that almost no setup is necessary for my device.

My follow up question:

I have a Rust app built in Tauri that uses ORT. My end users are on Windows. We can assume they will be on x86-64 devices. Do I then need to perform this linking for all my end users? Preferably having the dependency as part of the Cargo.toml would suffice as per the ORT platform support page.

Thank you very much for your assistance.

decahedron1 commented 1 month ago

I get the linking error again.

How recent is your VS2022 install? >=17.10 is required.

I have a Rust app built in Tauri that uses ORT. My end users are on Windows. We can assume they will be on x86-64 devices. Do I then need to perform this linking for all my end users? Preferably having the dependency as part of the Cargo.toml would suffice as per the ORT platform support page.

If by end users you mean users receiving compiled binaries (not building from source), no. If you use dynamic linking (which, by default, is only the case if you've enabled the CUDA/TensorRT EP features), some additional configuration may be required on your end, but your users won't have to do anything.

Chiranmb commented 1 month ago