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

swig/Android/Make instructions unclear, need help #220

Open
BeanStalka opened this issue Jun 10, 2017 · 7 comments
Open

swig/Android/Make instructions unclear, need help #220

BeanStalka opened this issue Jun 10, 2017 · 7 comments

Comments

@BeanStalka
Copy link

The make file says
"# Please specify your NDK root directory here."
Then it goes ahead and downloads an old version of the NDK and already has variables pointing to it

Please specify your NDK root directory here.

NDK_VERSION=r14b
BIT = 32
ifeq ($(BIT), 64)
NDKINSTALLEDROOT := $(PWD)/ndk_install_64bit
OPENBLASTARGET := ARMV8
OPENBLASDIR := OpenBLAS-Android-ARM64
else
NDKINSTALLEDROOT := $(PWD)/ndk_install_32bit
OPENBLASTARGET := ARMV7
OPENBLASDIR := OpenBLAS-Android-ARM32
endif
NDKROOT := $(PWD)/android-ndk-${NDK_VERSION}

Question #1 - Why download the old NDK if you are going to ask someone to update the NDK root directory in the Makefile?

Question#2 What do you mean "# Please specify your NDK root directory here." Am I supposed to make a new variable name NDKROOT or am I supposed to update NDKINSTALLEDROOT ?

I am very confused and am only trying to compile this so I can get the .so files for android.

Also when I run the make file I am getting this.

root@b4c6ff95287b:/snowboy/swig/Android# make
HOST_OS=linux
HOST_EXE=
./android-ndk-r14b/build/tools/ndk-common.sh: line 292: file: command not found
Detected 32-bit userland on 64-bit kernel system!
HOST_ARCH=x86
HOST_TAG=linux-x86
HOST_NUM_CPUS=2
BUILD_NUM_CPUS=4

COMMAND: python ./android-ndk-r14b/build/tools/make_standalone_toolchain.py -

-arch arm --api 14 --stl gnustl --install-dir=/snowboy/swig/Android/ndk_install_
32bit
./android-ndk-r14b/build/tools/ndk-common.sh: line 164: python: command not foun
d
ERROR: Failed to create toolchain.
Makefile:94: recipe for target '/snowboy/swig/Android/ndk_install_32bit' failed
make: [/snowboy/swig/Android/ndk_install_32bit] Error 1 (ignored)
make[1]: Entering directory '/snowboy/swig/Android/OpenBLAS-Android-ARM32'
C Compiler (/snowboy/swig/Android/ndk_install_32bit/bin/arm-linux-androideabi-gc
c) is something wrong.
1 at ./c_check line 29.
make[1]: *** [config.h] Error 2
Makefile.system:165: Makefile.conf: No such file or directory
Makefile.system:925: Makefile.: No such file or directory
make[1]: *** No rule to make target 'Makefile.'. Stop.
make[1]: Leaving directory '/snowboy/swig/Android/OpenBLAS-Android-ARM32'
Makefile:97: recipe for target 'OpenBLAS-Android-ARM32/install/lib/libopenblas.a
' failed
make: [OpenBLAS-Android-ARM32/install/lib/libopenblas.a] Error 1 (ignored)
/snowboy/swig/Android/ndk_install_32bit/bin/arm-linux-androideabi-g++ -O3 --sysr
oot=/snowboy/swig/Android/ndk_install_32bit/sysroot -std=c++0x -rdynamic -I../..
/ -Werror -Wall -fsigned-char -fpic -fPIC -mfloat-abi=softfp -march=armv7-a -mfp
u=neon -DNDEBUG -ffast-math -fomit-frame-pointer -O3 -pie -fPIE -DHAVE_NEON=1 -f
no-strict-aliasing -Wno-unused-function -shared -c snowboy-detect-swig.cc -o sno
wboy-detect-swig.o
make: /snowboy/swig/Android/ndk_install_32bit/bin/arm-linux-androideabi-g++: Com
mand not found
Makefile:105: recipe for target 'snowboy-detect-swig.o' failed
make: *** [snowboy-detect-swig.o] Error 127
root@b4c6ff95287b:/snowboy/swig/Android#

@chenguoguo
Copy link
Collaborator

That comment is out of date, I just deleted it.

You are supposed to just type make, and it will download the ndk and setup everything for you.

What is your host system? Are you using OSX or Linux-like systems? From the error log it seems like NDK is not able to install the Android toolchain.

@BeanStalka
Copy link
Author

BeanStalka commented Jun 10, 2017 via email

@chenguoguo
Copy link
Collaborator

There are at least the following issues on your Ubuntu system:

  1. You should install gcc/g++

  2. You should install Python

  3. Do you have the command file on your system? The installation script is complaining that it couldn't find the command file. If you don't have it, then install it.

@BeanStalka
Copy link
Author

BeanStalka commented Jun 10, 2017 via email

@BeanStalka
Copy link
Author

I installed /verified the recommended programs and was able to compile the 32 bit version.

When I attempted to add the BIT=64 flag I got this error.

root@3238a3fb49b0:/snowboy/swig/Android# make BIT=64
/snowboy/swig/Android/ndk_install_64bit/bin/aarch64-linux-android-g++ -Wl,-sonam
e,libsnowboy-detect-android.so -O3 --sysroot=/snowboy/swig/Android/ndk_install_6
4bit/sysroot -std=c++0x -rdynamic -I../../ -Werror -Wall -fsigned-char -fpic -fP
IC -march=armv8-a -DNDEBUG -ffast-math -fomit-frame-pointer -O3 -pie -fPIE -DHAV
E_NEON=1 -fno-strict-aliasing -Wno-unused-function -shared
snowboy-detect-swig.o ../..//lib/android/armv8-aarch64/libsnowboy-detect.a Ope
nBLAS-Android-ARM64/install/lib/libopenblas.a
-L/snowboy/swig/Android/ndk_install_64bit/sysroot/usr/lib -L/snowboy/swig/Andr
oid/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a -lgnustl_s
tatic -lsupc++ -lgcc -ldl -lc -lm -llog -pthread -o jniLibs/arm64-v8a/libsnowboy
-detect-android.so
snowboy-detect-swig.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'jniLibs/arm64-v8a/libsnowboy-detect-android.so'
failed
make: *** [jniLibs/arm64-v8a/libsnowboy-detect-android.so] Error 1
root@3238a3fb49b0:/snowboy/swig/Android#

@chenguoguo
Copy link
Collaborator

Did you make clean before you make the 64 bit?

@BeanStalka
Copy link
Author

BeanStalka commented Jun 11, 2017 via email

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