Is it necessary compiling the onnx module for the libtorch?

I just want use the old version of the mingw32 to compile the libtorch,however there’s a problem that only support the c++17 upside.If reduced the onnx module from the lib,it may work.So is it necessary to compile the onnx module?