i am currently trying to use Pytorch in my C++ program by including & linking libtorch into the project. Build system is meson where i have the following top-level meson.build file torch_dep = dependency('torch')
which then is used in my sub-level meson.build:
main = executable(
name,
[
'PytorchModel.cpp',
],
include_directories : [
project_incdir,
]
install : true,
dependencies : [
torch_dep,
]
When building i get the error:
meson.build:12:0: ERROR: Dependency "torch" not found, tried pkgconfig and cmake
I also checked pkg-config list and libtorch is not in there. How can i make this link?
Another thing i tried is to download/unzip libtorch manually and move it to /usr/include/. Still it is not recognized.
Also tried build_rpath : "/usr/include/libtorch"
in the executable to use the manual path. Still not working.
My goal in the end is to use #include <torch/script.h>
in my .cpp file.
I am very unexperienced with meson, so any help is appreciated.