ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
2.86k stars 778 forks source link

Fail to build 32bit example for android #121

Closed samsun639 closed 7 years ago

samsun639 commented 7 years ago

Run below two steps and got errors 1)CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a 2)arm-linux-androideabi-clang++ examples/neon_convolution.cpp test_helpers/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -Lbuild/arm_compute -o neon_convolution_arm -static-libstdc++ -pie

Got error: src/runtime/CPP/CPPScheduler.cpp:92: error: undefined reference to 'std::exception_ptr::exception_ptr::~exception_ptr()' src/runtime/CPP/CPPScheduler.cpp:134: error: undefined reference to 'std::exception_ptr::exception_ptr::~exception_ptr()' src/runtime/CPP/CPPScheduler.cpp:148: error: undefined reference to 'std::current_exception()' src/runtime/CPP/CPPScheduler.cpp:148: error: undefined reference to 'std::exception_ptr::exception_ptr::~exception_ptr()' src/runtime/CPP/CPPScheduler.cpp:108: error: undefined reference to 'std::exception_ptr::exception_ptr::~exception_ptr()' src/runtime/CPP/CPPScheduler.cpp:126: error: undefined reference to 'std::exception_ptr::exception_ptr::exception_ptr(std::__exception_ptr::exception_ptr const&)' src/runtime/CPP/CPPScheduler.cpp:126: error: undefined reference to 'std::rethrow_exception(std::exception_ptr::exception_ptr)' /root/android-ndk-r12b/mytoolchains/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../include/c++/4.9.x/bits/exception_ptr.h:118: error: undefined reference to 'std::exception_ptr::exception_ptr::swap(std::exception_ptr::exception_ptr&)' clang38++: error: linker command failed with exit code 1 (use -v to see invocation)

Please help.

BTW, succeed for 64bit example for android. 1)CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=arm64-v8a 2)aarch64-linux-android-g++ examples/neon_convolution.cpp test_helpers/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -Lbuild/arm_compute -o neon_convolution_aarch64 -static-libstdc++ -pie

AnthonyBarbier commented 7 years ago

The problem comes from the toolchain, not the library. You need to use NDK r14 (Older versions of the NDK are broken), feel free to report toolchain issues directly to Google here

samsun639 commented 7 years ago

worked on ndk r14. thanks