Include C++ header files after building pytorch from source

Hello,

I’m working on a Jetson TX2 and as it’s a aarch64 architectur this doens’t work: https://pytorch.org/tutorials/advanced/cpp_frontend.html
I don’t know how to include the torch header files to my c++ code.

So I successfully built Pytorch from source with Ubuntu 16.04 und Cuda 9.0.
Now I want to copy the header files for the C++ API to the standard include directory: /usr/local/include.
Is this possible? Which directories do I have to copy?

And if I don’t copy it what would be the -DCMAKE_PREFIX_PATH=/path/to/libtorch path?
Because just the pytorch directory doesn’t work.

I’m new to cmake and also to pytorch, so if you need any further information please let me know.
Thanks in advance for all your help.

Best regards,
Johannes

1 Like

After the Python build, the headers will be in torch/include. For libtorch builds, I needed to make sure to call cmake with --target install to get the headers.

Best regards

Thomas

2 Likes