-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Issue compiling OpenBLAS #1208
Comments
Still looks as if the PATH to the android toolchain is not set correctly (or the toolchain is incomplete). |
Unlikely there will be 32-core 32bit android any time soon. What is your NDK vrsion? Is it recent clang-based? |
Hi martin-frbg & brada4: thanks for your responses. The issue seemed to be that it did not have permissions to the toolchain directory when running as my user. As a test, i ran it as root and it compiled fine. My NDK version is: Thanks again for your help.( I will ping if I run into any more issues::)) |
But close this issue in the meantime, Android NDK is not OpenBLAS component. |
Hi martin-frbg & brada4: I ran into the issue described in the following thread: Since that thread was closed, I am putting in my questions here: So after doing the command, I executed the following command: make install PREFIX= But it failed saying that it could not find libopenblas_armv7p-r0.2.20.dev.so When I searched for the error, I came across the above thread. Then as per the instructions in that thread, I executed the following: make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 libs shared Then it gave me couple of errors(I am copying only the error outputs:) ~/androidstudio/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lgfortran ~/androidstudio/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lquadmath and then at the end: ../libopenblas_armv7p-r0.2.20.dev.so: error: undefined reference to 'stderr' But I do have lgfortran installed and is in /usr/bin. I did not find "quadmath" though. The I ran the make command with just "shared"(i.e without libs option) and it seemed to be successful. But I did see some message stating that LAPACK could not be built because lgfortran was not found and only BLAS was built. Then when I do the install command , it seemed to have successfully created the above mentioned .so file. Is this ok? Will I run into issues when running the programs on a mobile device? Thanks in advance |
You need to run 'make clean' before building with different parameters. |
Hi Brada4, What do you mean by the following statement? It seems that build system picks gfortran present on build host which is obvioulsy x86 and will not suffice for lapack in your library. My system is definitely 64 bit( and 64 bit debian jessie installed) lscpu output: Architecture: x86_64 |
I dont see how that could emit armeabi binaries. |
can u please elaborate? I am completely new to OpenBLAS. Am I doing things wrong? Thanks |
make TARGET=ARMV7 HOSTCC=gcc CC=arm-linux-androideabi-gcc NOFORTRAN=1 NUM_THREADS=32 libs This is the first statement when I run the above make command. OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS. Why is it not able to recognize the fortran installed on my machine? I am really surprised. Here is the output for ls -l /usr/bin | grep fortran lrwxrwxrwx 1 root root 12 Feb 25 2015 gfortran -> gfortran-4.9 |
-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. |
Hi , 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. make[1]: Entering directory `/AS/OpenBLAS/exports' /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: error: cannot find -lgfortran /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: error: cannot find -lquadmath /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 |
So after doing little bit more googling, this is what i understood: I am trying to build 32 bit binaries on a 64 bit machine and since the make system did not find the 32 bit libraries to link, it skips them. However it results in an error eventually. Am I correct in my understanding? If so what are my options?
Any thoughts? Thanks |
If you mix up system compilers with cross compilers they dont produce valid executable modules. |
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 |
Hi brada4 & martin-frbg After lot of googling around and redoing the compilation multiple times, i found the following: As per this link http://jcsilva.github.io/2017/03/18/compile-kaldi-android/ Hope this helps in identifying the issue. Please let me know if it's an issue in the code and when/if it's fixed. Thanks |
I dont know why your NDK picks files from system library path. Do you set something like LD_LIB_PATH before failed builds? |
No. I dont set the LD_LIB_PATH. I just add the toolchain/bin to the PATH variable. One other thing I have noticed is that the latest version of OpenBLAS tries to build the libopenblas_armv7p-r0.2.20.dev.so file and that is where it's erroring out. While the 99880f7 commit doesnt build the above mentioned .so file. |
sorry.spoke too early. /my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lm_hard |
Maybe you need to set ANDROID_NDK_PATH or NDK_ROOT so that it can find all parts of itself ? |
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. |
Hi xianyi, As per your instructions here https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android you ask us to do only "libs". Is it ok to try the shared as well? Also I have not been specifying these two options: Do I need to? If I have to build hard floating points, what is the command line option? Thanks again for your help. |
Hello, Looks like the issue is caused by the NDK removing support for Hard Float ABI. As I was looking at the issues, looks like it's already being discussed here in the thread: So to sum up, my issues were caused in r15 of NDK but not in r14 - because as i read that the hard float ABI support is "removed" from NDK r15 onwards. Relevant info from another forum: So this issue can be closed or combined with 1215. Thanks everyone. |
Compile with older NDK? |
yes. successfully compiled with r14 |
Hi : |
Hi,
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.
I am running out of options.
Any help is greatly appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: