AICamera icon indicating copy to clipboard operation
AICamera copied to clipboard

new version compile failed

Open bandabouse opened this issue 7 years ago • 2 comments

Thanks for propose a caffe2 android demo, But it can't pass the build and compile step when this project passed to new verison. It always has a link problem. So I ask for the previous version which includes the build and compile step in android studio by source code, and I had tested it, it works. If it has a link or something to go to the old version, thank you.@bwasti

bandabouse avatar May 18 '17 13:05 bandabouse

would you mind pasting the output of the build error?

The goal here is to use caffe2 as a prebuilt dependency. Try downloading caffe2 and running ./scripts/build_android.sh

bwasti avatar May 21 '17 23:05 bwasti

@bwasti Here is the prompt FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:externalNativeBuildDebug'.

Build command failed. Error while executing process /home//Android/Sdk/cmake/3.6.3155560/bin/cmake with arguments {--build /home/AICamera/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target native-lib} [1/1] Linkin/gh oCmXeX/ sswhaanrge/dA nldirboriadr/yS d.k.//c.m.a/k.e.//3...6/.b3u15556i0l/db/iinn/tcemramkeediat: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/Android/Sdk/cmake/3.6.3155560/bin/cmake) /home/Android/Sdk/cmake/3.6.3155560/bin/cmake: /lib64/libssl.so.1.0.0: no version information available (required by /home/Android/Sdk/cmake/3.6.3155560/bin/cmake) /home/Android/Sdk/cmake/3.6.3155560/bin/cmake: /lib64/libssl.so.1.0.0: no version information available (required by /home/Android/Sdk/cmake/3.6.3155560/bin/cmake) es/cmake/debug/obj/armeabi-v7a/libnative-lib.so FAILED: : && /user/home/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/user//home/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/user/home/Android/Sdk/ndk-bundle/platforms/android-18/arch-arm -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -frtti -fexceptions -std=c++11 -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so CMakeFiles/native-lib.dir/src/main/jni/native-lib.cpp.o -Wl,--whole-archive ../../../../src/main/jniLibs/armeabi-v7a/libcaffe2.a -Wl,--no-whole-archive ../../../../src/main/jniLibs/armeabi-v7a/libNNPACK.a ../../../../src/main/jniLibs/armeabi-v7a/libglog.so ../../../../src/main/jniLibs/armeabi-v7a/libprotobuf.a libcpufeatures.a /home/Android/Sdk/ndk-bundle/platforms/android-18/arch-arm/usr/lib/liblog.so /home/Android/Sdk/ndk-bundle/platforms/android-18/arch-arm/usr/lib/libandroid.so -ldl -lm "/home/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" && : ../../../../src/main/jniLibs/armeabi-v7a/libcaffe2.a(flags.cc.o):flags.cc:function bool caffe2::Caffe2FlagParser::Parse(std::string const&, double*): error: undefined reference to 'atof' ../../../../src/main/jniLibs/armeabi-v7a/libcaffe2.a(text_file_reader.cc.o):text_file_reader.cc:function caffe2::TextFileReaderReadOp::RunOnDevice(): error: undefined reference to 'strtof' ../../../../src/main/jniLibs/armeabi-v7a/libcaffe2.a(signal_handler.cc.o):signal_handler.cc:function (anonymous namespace)::HookupHandler(): error: undefined reference to 'sigfillset' ../../../../src/main/jniLibs/armeabi-v7a/libcaffe2.a(signal_handler.cc.o):signal_handler.cc:function (anonymous namespace)::UnhookHandler(): error: undefined reference to 'sigfillset' ../../../../src/main/jniLibs/armeabi-v7a/libprotobuf.a(strutil.cc.o):strutil.cc:function google::protobuf::MathLimits::IsNaN(float): error: undefined reference to '__isnanf' ../../../../src/main/jniLibs/armeabi-v7a/libprotobuf.a(strutil.cc.o):strutil.cc:function google::protobuf::safe_strtof(char const*, float*): error: undefined reference to 'strtof' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

I have tried ./scritps/build_android.sh and integrated by android.mk in my app, But it seems the same problem, the undefined reference 'atof' ... The only version that run well is the previous one who do the compile and build in gradle. I can't understand what happened. By the way, I use android 18.

bandabouse avatar May 22 '17 08:05 bandabouse