-
Notifications
You must be signed in to change notification settings - Fork 537
Linking errors when trying to use pre built executorch binaries for running lowered resnet50 in executorch runtime. #8196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not sure what's going on. Assuming the installed ExecuTorch has everything, i.e. Can you try |
Thanks for getting back on this. However if build the executorch with my current project using
Thanks for all your help! |
@sidharthkumar10500 the headers live inside
|
@sidharthkumar10500 for your build error
I think you want to link against Check your ExecuTorch installation and see if this can be found: If so I think you should be able to use the following:
|
🚀 The feature, motivation and pitch
I am trying to use executorch without building it everytime I build my project.
Everything works when I compile executorch by adding
add_subdirectory(/home/sidharth/executorch /home/sidharth/executorch_build)
This line to my cmakelists.txt.
However when I try to install the required targets and files to another folder, I keep getting the following error.
/usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
executorch::extension::make_tensor_impl_ptr(std::vector<int, std::allocator >, void*, std::vector<unsigned char, std::allocator >, std::vector<int, std::allocator >, executorch::runtime::etensor::ScalarType, executorch::runtime::TensorShapeDynamism, std::function<void (void*)>)':/home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:65: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:65: undefined reference to
executorch::runtime::runtime_abort()'/usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:68: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:68: undefined reference to
executorch::runtime::runtime_abort()'/usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:84: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:84: undefined reference to
executorch::runtime::runtime_abort()'/usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:87: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:87: undefined reference to
executorch::runtime::runtime_abort()'/usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
executorch::extension::make_tensor_impl_ptr(std::vector<int, std::allocator<int> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<unsigned char, std::allocator<unsigned char> >, std::vector<int, std::allocator<int> >, executorch::runtime::etensor::ScalarType, executorch::runtime::TensorShapeDynamism)': /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:138: undefined reference to
executorch::runtime::etensor::compute_numel(int const*, long)'/usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:138: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch/extension/tensor/tensor_impl_ptr.cpp:138: undefined reference to
executorch::runtime::runtime_abort()'/usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
executorch::runtime::internal::logf(executorch::runtime::LogLevel, unsigned long, char const*, char const*, unsigned long, char const*, ...)': /home/sidharth/executorch/extension/tensor/../../../executorch/runtime/platform/log.h:131: undefined reference to
executorch::runtime::internal::vlogf(executorch::runtime::LogLevel, unsigned long, char const*, char const*, unsigned long, char const*, __va_list_tag*)'/usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
executorch::runtime::elementSize(executorch::runtime::etensor::ScalarType)': /home/sidharth/executorch/extension/tensor/../../../executorch/runtime/core/exec_aten/util/scalar_type_util.h:402: undefined reference to
executorch::runtime::internal::get_log_timestamp()'/usr/bin/ld: /home/sidharth/executorch/extension/tensor/../../../executorch/runtime/core/exec_aten/util/scalar_type_util.h:402: undefined reference to
executorch::runtime::runtime_abort()' /usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
executorch::runtime::Error executorch::runtime::dim_order_to_stride<int, unsigned char, int>(int const*, unsigned char const*, unsigned long, int*)':/home/sidharth/executorch/extension/tensor/../../../executorch/runtime/core/exec_aten/util/dim_order_util.h:146: undefined reference to
executorch::runtime::internal::get_log_timestamp()' /usr/bin/ld: /home/sidharth/executorch_examples/tota/lib/libextension_tensor.a(tensor_impl_ptr.cpp.o): in function
std::__detail::_MakeUniqexecutorch::runtime::etensor::TensorImpl::__single_object std::make_unique<executorch::runtime::etensor::TensorImpl, executorch::runtime::etensor::ScalarType&, unsigned long const&, int*, void*&, unsigned char*, int*, executorch::runtime::TensorShapeDynamism>(executorch::runtime::etensor::ScalarType&, unsigned long const&, int*&&, void*&, unsigned char*&&, int*&&, executorch::runtime::TensorShapeDynamism&&)':/usr/include/c++/12/bits/unique_ptr.h:1065: undefined reference to
executorch::runtime::etensor::TensorImpl::TensorImpl(executorch::runtime::etensor::ScalarType, long, int*, void*, unsigned char*, int*, executorch::runtime::TensorShapeDynamism)' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/executorch_demo.dir/build.make:115: executorch_demo] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/executorch_demo.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2
I have added the include and lib folders in the cmakelists.txt as required but still getting this linking error.
`
target_include_directories(executorch_demo PUBLIC /home/sidharth/executorch_examples/tota/include/)
target_link_directories(executorch_demo PUBLIC /home/sidharth/executorch_examples/tota/lib/)
target_link_libraries(
executorch_demo
PRIVATE executorch
extension_module_static # Provides the Module class
extension_tensor # Provides the TensorPtr class
optimized_native_cpu_ops_lib # Provides baseline cross-platform
xnnpack_backend
PUBLIC ${OpenCV_LIBS}
)`
Can you please help me in sorting this issue?
Alternatives
No response
Additional context
No response
RFC (Optional)
No response
cc @larryliu0820 @mergennachin @byjlw
The text was updated successfully, but these errors were encountered: