You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into an issue trying to compile the OpenBLAS as part of compiling Kaldi for Android. I followed all the instructions on this blog(http://jcsilva.github.io/2017/03/18/compile-kaldi-android/ ) until the following where I am stuck:
make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 libs
This is the error I am getting when trying to run the above command:
C Compiler (arm-linux-androideabi-gcc) is something wrong.
1 at ./c_check line 28.
make: *** [config.h] Error 2
Makefile.system:165: Makefile.conf: No such file or directory
Makefile.system:912: Makefile.: No such file or directory
make: *** No rule to make target `Makefile.'. Stop.
I got the latest branch of OpenBLAS.
I did set the PATH to the android tool chain correctly.
Still looks as if the PATH to the android toolchain is not set correctly (or the toolchain is incomplete).
At that point in c_check it tries to run the command arm-linux-androideabi-gcc -E ctest.c - you could try entering this on a command line to see what error message you get.
You need to run 'make clean' before building with different parameters.
You can set FC=NoThing or something similarily fake to disable all fortran/lapack. It seems that build system picks gfortran present on build host which is obvioulsy x86 and will not suffice for lapack in your library.
-lgfortran comes from previous failed build. You sort of try to build without fortran already, I just suggested other option to disable fortran and lapack.
Seems there is something wrong with your Android toolchain setup, the linker appears to be finding the local x86 libraries of the build host instead of the Android ones provided by the NDK. And the fact that it tries to link with libgfortran (and its dependency libquadmath) at all suggests that you may have object files around from a previous build attempt where you forgot to specifiy NOFORTRAN=1. Best review your NDK installation and then do a make clean followed by make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 (note no "libs" or "shared" at the end of the command line, this should do the complete build in one go).
Maybe you need to set ANDROID_NDK_PATH or NDK_ROOT so that it can find all parts of itself ?
A build script was posted as part of #963 (and I have been meaning to add it but never got around to doing that it seems), perhaps it helps ?
Can someone please help? I am stuck here unable to proceed further. Basically I am not able to successfully compile the shared library libopenblas_armv7p-r0.2.20.dev.so.
Basically this is my first step which finishes without any errors:
make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 libs
Since it did not build the .so file, I then did the following which fails(the .so file is created though..but it throws the same stderr error when used in another native project)
make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 shared
I am pasting the output from the make command. May be the warnings might throw some light(please note that the last warning about libc). Please let me know if there are issues in my configuration(i.e what is the incompatibility here??). Thanks in advance.
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.so while searching for gfortran
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libm.so while searching for m
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so while searching for m
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/libquadmath.so while searching for quadmath
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libm.so while searching for m
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/x86_64-linux-gnu/libm.so while searching for m
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libc.so while searching for c
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libdl.so while searching for dl
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/x86_64-linux-gnu/libdl.so while searching for dl
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so while searching for c
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libc.so while searching for c
/AS/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so while searching for c
../libopenblas_armv7p-r0.2.20.dev.so: error: undefined reference to 'stderr'
collect2: error: ld returned 1 exit status
make[1]: *** [../libopenblas_armv7p-r0.2.20.dev.so] Error 1
make[1]: Leaving directory `/AS/OpenBLAS/exports'
Makefile:85: recipe for target 'shared' failed
make: *** [shared] Error 2
Activity
martin-frbg commentedon Jun 19, 2017
Still looks as if the PATH to the android toolchain is not set correctly (or the toolchain is incomplete).
At that point in c_check it tries to run the command
arm-linux-androideabi-gcc -E ctest.c- you could try entering this on a command line to see what error message you get.brada4 commentedon Jun 19, 2017
Unlikely there will be 32-core 32bit android any time soon. What is your NDK vrsion? Is it recent clang-based?
brada4 commentedon Jun 19, 2017
But close this issue in the meantime, Android NDK is not OpenBLAS component.
brada4 commentedon Jun 19, 2017
You need to run 'make clean' before building with different parameters.
You can set FC=NoThing or something similarily fake to disable all fortran/lapack. It seems that build system picks gfortran present on build host which is obvioulsy x86 and will not suffice for lapack in your library.
brada4 commentedon Jun 19, 2017
I dont see how that could emit armeabi binaries.
brada4 commentedon Jun 19, 2017
-lgfortran comes from previous failed build. You sort of try to build without fortran already, I just suggested other option to disable fortran and lapack.
brada4 commentedon Jun 21, 2017
If you mix up system compilers with cross compilers they dont produce valid executable modules.
Can you fix your compilers before trying a new build?
martin-frbg commentedon Jun 21, 2017
Seems there is something wrong with your Android toolchain setup, the linker appears to be finding the local x86 libraries of the build host instead of the Android ones provided by the NDK. And the fact that it tries to link with libgfortran (and its dependency libquadmath) at all suggests that you may have object files around from a previous build attempt where you forgot to specifiy NOFORTRAN=1. Best review your NDK installation and then do a
make cleanfollowed bymake TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32(note no "libs" or "shared" at the end of the command line, this should do the complete build in one go).brada4 commentedon Jun 22, 2017
I dont know why your NDK picks files from system library path. Do you set something like LD_LIB_PATH before failed builds?
martin-frbg commentedon Jun 22, 2017
Maybe you need to set ANDROID_NDK_PATH or NDK_ROOT so that it can find all parts of itself ?
A build script was posted as part of #963 (and I have been meaning to add it but never got around to doing that it seems), perhaps it helps ?
xianyi commentedon Jun 23, 2017
I have compiled Android static lib and shared library on My Mac.
For example, softfp ABI.
In first step, you may meet some errors in building test. It is OK.
The second step is building shared library.
brada4 commentedon Jun 29, 2017
Compile with older NDK?
lixiaohang commentedon Apr 23, 2019
Hi :
How did you solver this Problem ?