Hello I am building libtorch has static library. But now I am struggling to have a binary code running properly.
So I try few stuff:


Just linking my main.cpp with all the static library from libtorch
–> Result : abort libc++aby.dylib: terminating with uncaught exception of type c10::bad_optionnal_access


I was suspecting it could be because I need to use whole_archive, I put all the library with whole_archive but few issue:
–> undefined reference of onnxifi_loader
2.1) I copy the missing libonnxifi_loader.a
–> exec format error: my_torch_sample


I am not sure what should I do next, any suggestion how to use Libtorch as a static library ?
Thanks