Hi,
I’m trying to include PyTorch library in my CPP project.
I’m using ndk21 and C++14, torch version 1.5.0 for CPU.
I get the following compilation errors, all from csrc/jit/ir/ir.h and regarding c10 namespace:
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:67:17: error: no
namespace named ‘prim’ in namespace ‘c10’; did you mean simply ‘prim’?
using namespace ::c10::prim;
^~~~~~~~~~~
prim
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:66:11: note: namespace
‘prim’ defined here
namespace prim {
^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:70:17: error: no
namespace named ‘attr’ in namespace ‘c10’; did you mean simply ‘attr’?
using namespace ::c10::attr;
^~~~~~~~~~~
attr
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:69:11: note: namespace
‘attr’ defined here
namespace attr {
^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:73:17: error: no
namespace named ‘aten’ in namespace ‘c10’; did you mean simply ‘aten’?
using namespace ::c10::aten;
^~~~~~~~~~~
aten
C:\REPOSCPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:72:11: note: namespace
‘aten’ defined here
namespace aten {
^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:1309:34: error: no
member named ‘prim’ in namespace ‘c10’; did you mean simply ‘prim’?
static constexpr Symbol Kind = ::c10::prim::profile;
^~~~~~~~~~~
prim
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:66:11: note: ‘prim’
declared here
namespace prim {
^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:1309:47: error: no
member named ‘profile’ in namespace ‘torch::jit::prim’
static constexpr Symbol Kind = ::c10::prim::profile;
~~~~^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:1311:21: error: no
member named ‘prim’ in namespace ‘c10’; did you mean simply ‘prim’?
: Node(graph, ::c10::prim::profile), callback_(callback) {}
^
prim
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:66:11: note: ‘prim’
declared here
namespace prim {
^
C:\REPOS\CPU\libtorch-shared-with-deps-latest\libtorch/include\torch/csrc/jit/ir/ir.h:1311:34: error: no
member named ‘profile’ in namespace ‘torch::jit::prim’
: Node(graph, ::c10::prim::profile), callback_(callback) {}
Can someone please help me to overcome this?
Thanks.