olilarkin / ort-builder

ONNX Runtime static library builder
MIT License
48 stars 13 forks source link

Undefined symbols during linking the static lib with JUCE AU build #9

Closed 7sharp9 closed 11 months ago

7sharp9 commented 11 months ago

Im getting this error during linking, Ive looked to see if Ive missed anything but Im using all the includes and the static lib from the ./build_mac.sh

ld: Undefined symbols:
  onnx::propagateElemTypeFromInputToOutput(onnx::InferenceContext&, unsigned long, unsigned long), referenced from:
      onnxruntime::contrib::EmbedLayerNormalizationShapeInference(onnx::InferenceContext&) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::EmbedLayerNormalizationShapeInference(onnx::InferenceContext&) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::EmbedLayerNormalizationShapeInference(onnx::InferenceContext&) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::AttentionTypeAndShapeInference(onnx::InferenceContext&, int) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::AttentionTypeAndShapeInference(onnx::InferenceContext&, int) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::AttentionTypeAndShapeInference(onnx::InferenceContext&, int) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      onnxruntime::contrib::AttentionTypeAndShapeInference(onnx::InferenceContext&, int) in libonnxruntime.a[arm64][4](shape_inference_functions.cc.o)
      ...
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think its defined in onnx/defs/shape_inference.h but Im not that famialliar witht the onnx structure.

Any ideas?

olilarkin commented 11 months ago

i guess your model requires something that is not there

i suggest that you study https://onnxruntime.ai/docs/build/custom.html#minimal-build

try doing a full build, e.g. play around with these flags

  --minimal_build \
  --disable_ml_ops --disable_rtti \
  --include_ops_by_config "$ONNX_CONFIG" \
  --enable_reduced_operator_type_support \

more info: https://github.com/microsoft/onnxruntime/blob/main/docs/Reduced_Operator_Kernel_build.md

your on your own i'm afraid...