-
Notifications
You must be signed in to change notification settings - Fork 3
facing build issue with build_android.sh #4
Copy link
Copy link
Open
Description
I am using android ndk-19 version for building the demo.
I am getting the following error while building for arm64-v8a:
-f may not be used without -shared
When I add the -shared flag in build_android/CMakeFiles/Predictor.dir/link.txt file, it gives the following new issue:
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `(anonymous namespace)::loadModel(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)':
/home/anussark/pytorch-android-cpp-demo/predictor.cpp:26: undefined reference to `torch::jit::load(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, c10::optional<c10::Device>)'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `torch::jit::Module::eval()':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/module.h:184: undefined reference to `torch::jit::Module::train(bool)'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `~GraphOptimizerEnabledGuard':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:123: undefined reference to `torch::jit::setGraphExecutorOptimize(bool)'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:123: undefined reference to `torch::jit::setGraphExecutorOptimize(bool)'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:123: undefined reference to `torch::jit::setGraphExecutorOptimize(bool)'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:123: undefined reference to `torch::jit::setGraphExecutorOptimize(bool)'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `GraphOptimizerEnabledGuard':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:118: undefined reference to `torch::jit::getGraphExecutorOptimize()'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/runtime/graph_executor.h:119: undefined reference to `torch::jit::setGraphExecutorOptimize(bool)'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `torch::jit::Module::forward(std::__ndk1::vector<c10::IValue, std::__ndk1::allocator<c10::IValue> >)':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/module.h:114: undefined reference to `torch::jit::Method::operator()(std::__ndk1::vector<c10::IValue, std::__ndk1::allocator<c10::IValue> >, std::__ndk1::unordered_map<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, c10::IValue, std::__ndk1::hash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::equal_to<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, c10::IValue> > > const&) const'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `~Method':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `torch::jit::Object::get_method(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/object.h:102: undefined reference to `torch::jit::Object::find_method(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `Method':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
CMakeFiles/Predictor.dir/predictor.cpp.o: In function `~Method':
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
/home/anussark/pytorch/build_android/install/include/torch/csrc/jit/api/method.h:22: undefined reference to `vtable for torch::jit::Method'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels