with undefined reference to c10::Error::Error
https://github.com/pytorch/pytorch/issues/15138
I managed to successfully compile it on Jetson TX2 following these steps:
1.Build PyTorch from source. python3 setup.py build
2.No need to download LibTorch from the official website, which is the x86_64 build.
3.build the example-cpp using compiled tmp_install directory: cmake -DCMAKE_PREFIX_PATH=/absolute/path/to/pytorch/torch/lib/tmp_install ..
You might be building libtorch with a compiler that is incompatible with the compiler building your final app.
For example, you built libtorch with gcc 4.9.2 and your final app with gcc 5.1, and the C++ ABI between both of them is not the same, so you are seeing linker errors like these
在Jetson TX2上成功编译PyTorch时遇到链接错误'undefined reference to c10::Error::Error'。通过从源代码构建PyTorch,避免使用官方的x86_64 LibTorch,并使用与编译最终应用相同的编译器来构建example-cpp项目,可以解决此问题。链接错误可能由于编译器ABI不兼容导致。
1万+

被折叠的 条评论
为什么被折叠?



