How to build libtorch for aarch64?

What is the right way to cross-compile libtorch for aarch64 target on an amd64 Linux host?

I’m currently using tools/, however, when I try to use this library to build my C++ code using, cmake -DCMAKE_PREFIX_PATH=/path/to/build_libtorch .., I get errors regarding missing header files and

Is there a script or a tutorial that would help organize the libtorch library similar to the structure released on the downloads page?


You might try to follow the route android takes, providing a CMAKE_TOOLCHAIN_FILE and you might need a host protobuf, see scripts/ for inspiration.
I will admit that I did not try but build natively on aarch64 for the time being…

Best regards