Skip to content
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

Unable to run .build.py $(NDK_PATH) #1

Closed
nikogamulin opened this issue Feb 2, 2015 · 2 comments
Closed

Unable to run .build.py $(NDK_PATH) #1

nikogamulin opened this issue Feb 2, 2015 · 2 comments

Comments

@nikogamulin
Copy link

I tried to clone the Caffe-Android-Lib code and build it. Running git clone --recursive

Anyway, lately I noticed that included Boost-for-Android does not support NDK version 10d - 64bit. Therefore I added the version from the repository https://github.com/MysticTreeGames/Boost-for-Android.

When running ./build.py $(NDK_PATH), I first got an error and fixed it by running make all in folder caffe-android-lib/caffe-mobile/jni/caffe/ and then copying the following files:

cp -r caffe-android-lib/caffe-mobile/jni/caffe/.build_release/src/caffe/proto/* caffe-android-lib/caffe-mobile/jni/caffe/src/caffe/proto/

Then, after running ./build.py $(NDK_PATH) I got the following error:

Android NDK: WARNING:/usr/local/caffe-android-lib/caffe-mobile/jni/Android.mk:caffe: non-system libraries in linker flags: -lboost_random-gcc-mt-1_55 -lboost_math_tr1-gcc-mt-1_55 -lboost_system-gcc-mt-1_55 -lboost_thread-gcc-mt-1_55
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK:     current module
[armeabi-v7a] Compile++ arm  : caffe <= blob.cpp
In file included from /usr/local/caffe-android-lib/caffe-mobile/jni/caffe/include/caffe/blob.hpp:4:0,
                 from /usr/local/caffe-android-lib/caffe-mobile/jni/caffe/src/caffe/blob.cpp:1:
/usr/local/caffe-android-lib/caffe-mobile/jni/caffe/include/caffe/common.hpp:5:27: fatal error: gflags/gflags.h: No such file or directory
 #include <gflags/gflags.h>
                           ^
compilation terminated.
make: *** [/usr/local/caffe-android-lib/caffe-mobile/obj/local/armeabi-v7a/objs/caffe/caffe/src/caffe/blob.o] 

I tried to fix the error by running the following:

wget https://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make 
sudo make install

Unfortunately, I haven't managed to come any further and haven't figured out the cause of the problem.

As I couldnt build the model with modified caffe version (Caffe-Android-Lib), I built the model with official caffe version and uploaded the files to sd card:

adb shell mkdir -p /sdcard/caffe_mobile/
adb push caffe/data/ilsvrc12/imagenet_mean.binaryproto /sdcard/caffe_mobile/
adb push caffe/models/bvlc_reference_caffenet/ /sdcard/caffe_mobile/bvlc_reference_caffenet/

When I tried to run caffe-android-demo, the app crashed with the following error:

com.sh1r0.caffe_android_demo A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1250 (AsyncTask #1)

I would appreciate if anyone could help out finding the cause of the problem and solve it.

@sh1r0
Copy link
Owner

sh1r0 commented Feb 3, 2015

Hi @nikogamulin ,
I just updated the remote urls of the submodules, and also my Boost-for-Android to the lastest version for supporting android-ndk-r10d. So now, it should be okay to run ./build.py $(NDK_PATH) without toolchain issues. (You can cleanly clone agian. I tested the updates by using android-ndk-r10d-linux-x86_64.bin.)

The errors about proto files and gflags may caused by using the wrong caffe branch. I recommend you to cleanly clone again.

For the model part, you can download the stuff you need by simply running ./get_model.py.

Thanks.

@nikogamulin
Copy link
Author

Excellent! Everything works perfectly now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants