Comments (11)
Hi @phamyphen, please could you try using:
-DCMAKE_SYSTEM_NAME=Android
when you run Cmake, not -DCMAKE_SYSTEM_NAME=Linux
.
You will need to delete CmakeCache.txt before running Cmake again.
It appears that this could be an error in our documentation.
from armnn.
I did a try by changing DCMAKE_SYSTEM_NAME from Linux to Android. Below is the errors. Do I need some additional changes?
~/armnn-devenv/armnn/build$ CXX=aarch64-linux-android-clang++ \
CC=aarch64-linux-android-clang
CXX_FLAGS="-fPIE -fPIC"
cmake ..
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_EXE_LINKER_FLAGS=-pie
-DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary/
-DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build
-DBOOST_ROOT=$HOME/armnn-devenv/boost/install/
-DARMCOMPUTENEON=1 -DARMCOMPUTECL=1
-DTF_GENERATED_SOURCES=$HOME/armnn-devenv/google/tf_pb/ -DBUILD_TF_PARSER=1
-DPROTOBUF_ROOT=$HOME/armnn-devenv/google/arm64_pb_install/
CMake Error at /usr/local/share/cmake-3.9/Modules/Platform/Android-Determine.cmake:135 (message):
Android: Neither the NDK or a standalone toolchain was found.
Call Stack (most recent call first):
/usr/local/share/cmake-3.9/Modules/CMakeDetermineSystem.cmake:130 (include)
CMakeLists.txt:2 (project)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
from armnn.
got the same error...
from armnn.
Hi @phamyphen and @lukaszs-appdate
It seems to me that the Android toolchain wasn't created successfully. Could you please try the steps for Downloading the Android NDK and making the toolchain again as mentioned in https://github.com/ARM-software/armnn/blob/master/BuildGuideAndroidNDK.md and see if they are successful.
I hope this solves your problem.
Surabhi
from armnn.
@Surmeh ,
How do you confirm that Android NDK(I am using r17b) was created successfully? I tried it again. Same issues.
BTW, the above compiler setting issues happened only after changing DCMAKE_SYSTEM_NAME from Linux to Android.
Any other suggestions?
Best,
phamyphen
from armnn.
Hi @phamyphen and @lukaszs-appdate,
Try changing
DCMAKE_EXE_LINKER_FLAGS=-pie
to
DCMAKE_EXE_LINKER_FLAGS="-pie -llog"
in your cmake configuration. That should link also against Android's log library. You also will need to delete CMakeCache.txt before running cmake again.
That could be an error in our documentation.
from armnn.
Hi,
After fixing the linker error wrt liblog (using -llog linker flag), I get the following linker error. I'm following the complete build instructions from here, on a Ubuntu 16.04 machine.
Only difference is that I'm using Android NDK r17 with --api 24 for my toolchain. However, I beleive that should be a problem
Could someone let me know what I'm missing here? Seems something going wrong withthe standard c++ libs and/or STL.
[100%] Linking CXX executable UnitTests
libarmnn.so: undefined reference to std::locale::id::_M_id() const' libarmnn.so: undefined reference to
std::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream(std::string const&, std::_Ios_Openmode)'
libarmnn.so: undefined reference to vtable for std::basic_streambuf<char, std::char_traits<char> >' libarmnn.so: undefined reference to
std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const'
libarmnn.so: undefined reference to __once_proxy' libarmnn.so: undefined reference to
std::string::insert(unsigned long, char const*, unsigned long)'
libarmnn.so: undefined reference to std::thread::hardware_concurrency()' libarmnn.so: undefined reference to
std::string::swap(std::string&)'
libarmnn.so: undefined reference to std::string::assign(std::string const&)' libarmnn.so: undefined reference to
std::locale::~locale()'
libarmnn.so: undefined reference to std::basic_ifstream<char, std::char_traits<char> >::~basic_ifstream()' libarmnn.so: undefined reference to
std::istream& std::istream::_M_extract(long&)'
libarmnn.so: undefined reference to std::locale::locale(std::locale const&)' libarmnn.so: undefined reference to
typeinfo for std::locale::facet'
libarmnn.so: undefined reference to VTT for std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >' libarmnn.so: undefined reference to
std::basic_ios<char, std::char_traits >::copyfmt(std::basic_ios<char, std::char_traits > const&)'
libarmnn.so: undefined reference to std::__get_once_mutex()' libarmnn.so: undefined reference to
typeinfo for std::ios_base::failure'
libarmnn.so: undefined reference to std::__throw_bad_cast()' libarmnn.so: undefined reference to
std::__throw_bad_function_call()'
libarmnn.so: undefined reference to std::ostream::flush()' libarmnn.so: undefined reference to
std::istream::seekg(long, std::_Ios_Seekdir)'
libarmnn.so: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(unsigned long, char, std::allocator<char> const&)' libarmnn.so: undefined reference to
std::string::compare(char const*) const'
libarmnn.so: undefined reference to arm_compute::CLFullyConnectedLayer::CLFullyConnectedLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)' libarmnn.so: undefined reference to
std::cerr'
libarmnn.so: undefined reference to arm_compute::CLTuner::save_to_file(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const' libarmnn.so: undefined reference to
std::ios_base::Init::Init()'
libarmnn.so: undefined reference to std::string::assign(char const*, unsigned long)' libarmnn.so: undefined reference to
std::basic_ifstream<char, std::char_traits >::basic_ifstream()'
libarmnn.so: undefined reference to std::_Rb_tree_increment(std::_Rb_tree_node_base*)' libarmnn.so: undefined reference to
std::string::find(char const*, unsigned long, unsigned long) const'
libarmnn.so: undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' libarmnn.so: undefined reference to
std::__throw_system_error(int)'
libarmnn.so: undefined reference to std::thread::join()' libarmnn.so: undefined reference to
std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)'
libarmnn.so: undefined reference to std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)' libarmnn.so: undefined reference to
std::condition_variable::condition_variable()'
libarmnn.so: undefined reference to std::ctype<char>::id' libarmnn.so: undefined reference to
std::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream(std::_Ios_Openmode)'
libarmnn.so: undefined reference to std::string::_Rep::_M_destroy(std::allocator<char> const&)' libarmnn.so: undefined reference to
std::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
libarmnn.so: undefined reference to std::collate<char> const& std::use_facet<std::collate<char> >(std::locale const&)' libarmnn.so: undefined reference to
arm_compute::NENormalizationLayer::NENormalizationLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)'
libarmnn.so: undefined reference to std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::basic_istringstream(std::string const&, std::_Ios_Openmode)' libarmnn.so: undefined reference to
std::basic_filebuf<char, std::char_traits >::open(char const*, std::_Ios_Openmode)'
libarmnn.so: undefined reference to std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long)' libarmnn.so: undefined reference to
std::__throw_out_of_range_fmt(char const*, ...)'
libarmnn.so: undefined reference to std::string::append(std::string const&)' libarmnn.so: undefined reference to
std::string::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)'
libarmnn.so: undefined reference to std::__exception_ptr::exception_ptr::swap(std::__exception_ptr::exception_ptr&)' libarmnn.so: undefined reference to
typeinfo for std::ctype'
libarmnn.so: undefined reference to arm_compute::CLSoftmaxLayer::CLSoftmaxLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)' libarmnn.so: undefined reference to
arm_compute::MemoryManagerOnDemand::MemoryManagerOnDemand(std::__ndk1::shared_ptr<arm_compute::ILifetimeManager>, std::__ndk1::shared_ptr<arm_compute::IPoolManager>)'
libarmnn.so: undefined reference to std::chrono::_V2::system_clock::now()' libarmnn.so: undefined reference to
std::ctype const& std::use_facet<std::ctype >(std::locale const&)'
libarmnn.so: undefined reference to std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)' libarmnn.so: undefined reference to
std::ostream& std::ostream::_M_insert(double)'
libarmnn.so: undefined reference to std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()' libarmnn.so: undefined reference to
std::string::_M_leak_hard()'
libarmnn.so: undefined reference to std::ios_base::Init::~Init()' libarmnn.so: undefined reference to
std::ostream& std::ostream::_M_insert(long)'
libarmnn.so: undefined reference to std::__detail::_List_node_base::_M_unhook()' libarmnn.so: undefined reference to
arm_compute::CLTuner::load_from_file(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&)'
libarmnn.so: undefined reference to std::cout' libarmnn.so: undefined reference to
std::string::append(char const*, unsigned long)'
libarmnn.so: undefined reference to std::istream::tellg()' libarmnn.so: undefined reference to
std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
libarmnn.so: undefined reference to std::condition_variable::wait(std::unique_lock<std::mutex>&)' libarmnn.so: undefined reference to
std::ostream::put(char)'
libarmnn.so: undefined reference to std::string::_M_mutate(unsigned long, unsigned long, unsigned long)' libarmnn.so: undefined reference to
arm_compute::NEConvolutionLayer::NEConvolutionLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)'
libarmnn.so: undefined reference to VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' libarmnn.so: undefined reference to
std::basic_stringbuf<char, std::char_traits, std::allocator >::str() const'
libarmnn.so: undefined reference to std::ctype<char>::_M_widen_init() const' libarmnn.so: undefined reference to
std::string::reserve(unsigned long)'
libarmnn.so: undefined reference to std::ios_base::~ios_base()' libarmnn.so: undefined reference to
std::__exception_ptr::exception_ptr::exception_ptr(std::__exception_ptr::exception_ptr const&)'
libarmnn.so: undefined reference to std::istream::operator>>(int&)' libarmnn.so: undefined reference to
std::basic_istream<char, std::char_traits >& std::getline<char, std::char_traits, std::allocator >(std::basic_istream<char, std::char_traits >&, std::basic_string<char, std::char_traits, std::allocator >&, char)'
libarmnn.so: undefined reference to std::_Rb_tree_decrement(std::_Rb_tree_node_base*)' libarmnn.so: undefined reference to
std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&)'
libarmnn.so: undefined reference to std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)' libarmnn.so: undefined reference to
std::__set_once_functor_lock_ptr(std::unique_lockstd::mutex)'
libarmnn.so: undefined reference to std::ostream::operator<<(int)' libarmnn.so: undefined reference to
std::_Rb_tree_increment(std::_Rb_tree_node_base const)'
libarmnn.so: undefined reference to typeinfo for std::system_error' libarmnn.so: undefined reference to
arm_compute::NEDirectConvolutionLayer::NEDirectConvolutionLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)'
libarmnn.so: undefined reference to arm_compute::NESoftmaxLayer::NESoftmaxLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)' libarmnn.so: undefined reference to
std::__throw_length_error(char const*)'
libarmnn.so: undefined reference to VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >' libarmnn.so: undefined reference to
std::__once_functor'
libarmnn.so: undefined reference to std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream()' libarmnn.so: undefined reference to
std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)'
libarmnn.so: undefined reference to std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)' libarmnn.so: undefined reference to
std::__exception_ptr::exception_ptr::~exception_ptr()'
libarmnn.so: undefined reference to std::basic_filebuf<char, std::char_traits<char> >::close()' libarmnn.so: undefined reference to
std::runtime_error::runtime_error(std::string const&)'
libarmnn.so: undefined reference to std::__throw_logic_error(char const*)' libarmnn.so: undefined reference to
std::condition_variable::~condition_variable()'
libarmnn.so: undefined reference to arm_compute::CLConvolutionLayer::CLConvolutionLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)' libarmnn.so: undefined reference to
std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string const&)'
libarmnn.so: undefined reference to std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const' libarmnn.so: undefined reference to
std::ostream& std::ostream::_M_insert(unsigned long)'
libarmnn.so: undefined reference to std::condition_variable::notify_one()' libarmnn.so: undefined reference to
std::locale::locale()'
libarmnn.so: undefined reference to std::_Hash_bytes(void const*, unsigned long, unsigned long)' libarmnn.so: undefined reference to
vtable for std::basic_stringbuf<char, std::char_traits, std::allocator >'
libarmnn.so: undefined reference to std::__throw_regex_error(std::regex_constants::error_type)' libarmnn.so: undefined reference to
std::__basic_file::is_open() const'
libarmnn.so: undefined reference to std::rethrow_exception(std::__exception_ptr::exception_ptr)' libarmnn.so: undefined reference to
arm_compute::NEFullyConnectedLayer::NEFullyConnectedLayer(std::__ndk1::shared_ptr<arm_compute::IMemoryManager>)'
libarmnn.so: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
clang60++: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/UnitTests.dir/build.make:1199: recipe for target 'UnitTests' failed
make[2]: *** [UnitTests] Error 1
CMakeFiles/Makefile2:106: recipe for target 'CMakeFiles/UnitTests.dir/all' failed
make[1]: *** [CMakeFiles/UnitTests.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
from armnn.
This could be due to the ACL docs recommending a different version of stl than ArmNN (#44), if two separated toolchains are used for building ACL and ArmNN.
I'd suggest using a single toolchain for both components, as indicated at https://github.com/ARM-software/armnn/blob/master/BuildGuideAndroidNDK.md#download-the-android-ndk-and-make-a-standalone-toolchain.
from armnn.
@santo4ul, alternatively try building both toolchains with "--stl=libc++" and see if that solves the linker errors (if you need to keep the toolchains separated).
from armnn.
I'm able to fix the above linker error.
Looks like the problem was mixing STL in ACL and ARMNN. ACL recommends "--stl=gnustl", while ARMNN uses "--stl=libc++" for toolchains.
I recompiled ACL using the same toolchain I used for ARMNN (with --stl=libc++) and it helped fixing the linker error. However, I'm not sure what runtime errors would comeup.
I've raised this as a separate issue here
Hope we get a resolution on this.
Thanks,
San
from armnn.
Hi @santo4ul,
Great to hear you've managed to fix your problem. Please get in touch if you have any more problems.
Thanks,
Surabhi
from armnn.
Related Issues (20)
- Gather operator dimension check error HOT 10
- Armnn insert reshape node before fullyconnected HOT 4
- I want config the gpu core number for armnn HOT 3
- Explicit padding for Transpose Convolution fails HOT 8
- opencv failed to call opencl HOT 1
- ScatterND not support HOT 3
- Building ARM NN via Docker approach with specific GLIBC , GLIBCXX versions ... HOT 3
- Gather(ND) dim error HOT 1
- Link error on older Android devices HOT 8
- BUG: using delegate with transformer | AttributeError: 'NoneType' object has no attribute 'c_void_p' HOT 22
- About the configuration setting of externalMemoryManagementEnabled HOT 1
- The mali gpu computation capability is only used no more than 15% when inference resnet50 with ArmNN HOT 1
- onnx deployment fail HOT 7
- Another error on another model and by now it's two out of three :( HOT 22
- Unsupported Operation "Transpose" in armNN::OnnxParser while loading the onnx model file (in the goal to run inference) HOT 8
- Build Issues -Werrors on armbian 24 HOT 1
- nvalid attempt to construct ConstTensor from non-constant TensorInfo HOT 1
- Profiler service warnings seen in ArmNN v24.02 HOT 3
- Does ExecuteNetwork support "GpuAcc" runtime ? HOT 7
- Running YOLOv5 ONNX model with onnx parser of armnn fails with unsupported operation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from armnn.