-
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
win10 + androidndk + clang #1823
Comments
"no makefile found" suggests you are running the make command in the wrong folder, it should be executed in the top level of the OpenBLAS source tree (where you should see Makefile, Makefile.system and a couple of others) |
Ah yeah I see it now, I definitely was in the wrong directory. But unfournately I have a new error now which is this: |
Do you have gcc in your PATH ? (Not likely that you are missing getarch.c or cpuid.S, so I guess the file that cannot be found must be the gcc executable) |
No I only have clang, is that an extra dependency I need to download? I thought the documentation stated we needed GCC or Clang. |
It is the |
Okay so I installed gcc and am now getting an error when running: The error is: I was reading this post #1513 and added the FC=FAKE arg but that still didn't work. Is perl necessary? |
Perl is necessary just like valid native HOSTCC, probably HOSTCC=clang in place of gcc |
I have amended the wiki page to mention the dependency on perl and c compiler on the host. I suspect it is still not possible to come up with a portable replacement that uses only gmake or shell commands (the cmake build uses cmake syntax to replace c_check and f_check already, but it still relies on the |
I'm sorry if this is rudimentary question but am I calling the bash script above that I wrote from Strawberry Perl and changing my HOSTCC to clang? |
No need to change HOSTCC to clang now that you have gcc installed. And while I am not familiar with Strawberry Perl, I assume you would call your bash script like before, the only difference is that now the OpenBLAS build files should have a working perl interpreter so its tools like c_check should finally work. |
Okay I'll try that out. |
Okay so it looks like It was compiling some of the smaller files but then it got to this line and failed: make[1]: Leaving directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-develop/kernel' |
Looks as if it is basically done but for some reason the test program to check the correctness of the shared library fails to link. To me this looks like a toolchain error - it is clearly using the right linker here, but cannot find the standard libraries and program startup code that must be part of the NDK. (Your LDFLAGS seems to be correct as it managed to link the library itself) |
These are the new commands I have run: Are there issues with NDK version 14b? |
None that I am aware of. Perhaps try setting sysroot within CMAKE_CFLAGS instead of the separate CFLAGS (though this probably does not matter), and make sure that you got the -gcc-toolchain argument right (yours looks quite different from the wiki example) |
Well I created my own toolchain right, like the wiki said? So shouldn't the -gcc-toolchain argument be linked to the toolchain I created? |
Nope, you need target toolchain (android NDK in your case) |
I'm still getting the same error using the prebuilt tool-chain that comes with android-22. This is really starting to make no sense to me at all. |
Run |
Yeah it tells me I'm using gcc 7.3.0 |
You say same error I thought it is first one.... Second "same" error regardding C runtime objects googles to this: |
Right and I set my sysroot in CFLAGS. |
Cannot make much sense of it either. Could you check which directory in your toolchain actually has the "missing" crtbegin_dynamic.o ? |
I see crtbegin_dynamic.o in C:\Users\Jeff\Downloads\android-ndk-r14b\platforms\android-22\arch-arm64\usr\lib. |
According to NDK documentation - NO Lollipop original NDK clang did not support armv8 64bit targets... Thats in release notes... Maybe you need one or few of patch releases to make it work, or use GCC. |
I notice this did not come up in #1513 (but perhaps the target API plays a role as well - one of the comments in the stackoverflow link mentioned that building for some low API number did not include the crtbegin_dynamic in the standalone toolchain) |
Okay sounds good, I will try to build this with API Lvl 28 |
Well okay so running this with API Lvl 22 with gcc instead of clang, I now get this error: ar -ru ../cygopenblas_armv8p-r0.3.4.dev.a samax_k.o samin_k.o smax_k.o smin_k.o isamax_k.o isamin_k.o ismax_k.o ismin_k.o sasum_k.o saxpy_k.o scopy_k.o sdot_k.o sdsdot_k.o dsdot_k.o snrm2_k.o srot_k.o sscal_k.o sswap_k.o saxpby_k.o sgemv_n.o sgemv_t.o ssymv_U.o ssymv_L.o sger_k.o sgemm_kernel.o sgemm_beta.o strmm_kernel_LN.o strmm_kernel_LT.o strmm_kernel_RN.o strmm_kernel_RT.o strsm_kernel_LN.o strsm_kernel_LT.o strsm_kernel_RN.o strsm_kernel_RT.o strmm_iunucopy.o strmm_iunncopy.o strmm_ilnucopy.o strmm_ilnncopy.o strmm_iutucopy.o strmm_iutncopy.o strmm_iltucopy.o strmm_iltncopy.o strmm_ounucopy.o strmm_ounncopy.o strmm_olnucopy.o strmm_olnncopy.o strmm_outucopy.o strmm_outncopy.o strmm_oltucopy.o strmm_oltncopy.o strsm_iunucopy.o strsm_iunncopy.o strsm_ilnucopy.o strsm_ilnncopy.o strsm_iutucopy.o strsm_iutncopy.o strsm_iltucopy.o strsm_iltncopy.o strsm_ounucopy.o strsm_ounncopy.o strsm_olnucopy.o strsm_olnncopy.o strsm_outucopy.o strsm_outncopy.o strsm_oltucopy.o strsm_oltncopy.o ssymm_iutcopy.o ssymm_iltcopy.o ssymm_outcopy.o ssymm_oltcopy.o somatcopy_k_cn.o somatcopy_k_rn.o somatcopy_k_ct.o somatcopy_k_rt.o simatcopy_k_cn.o simatcopy_k_rn.o simatcopy_k_ct.o simatcopy_k_rt.o sgeadd_k.o damax_k.o damin_k.o dmax_k.o dmin_k.o idamax_k.o idamin_k.o idmax_k.o idmin_k.o dasum_k.o daxpy_k.o dcopy_k.o ddot_k.o dnrm2_k.o drot_k.o dscal_k.o dswap_k.o daxpby_k.o dgemv_n.o dgemv_t.o dsymv_U.o dsymv_L.o dger_k.o dgemm_kernel.o dgemm_beta.o dtrmm_kernel_LN.o dtrmm_kernel_LT.o dtrmm_kernel_RN.o dtrmm_kernel_RT.o dtrsm_kernel_LN.o dtrsm_kernel_LT.o dtrsm_kernel_RN.o dtrsm_kernel_RT.o dtrmm_iunucopy.o dtrmm_iunncopy.o dtrmm_ilnucopy.o dtrmm_ilnncopy.o dtrmm_iutucopy.o dtrmm_iutncopy.o dtrmm_iltucopy.o dtrmm_iltncopy.o dtrmm_ounucopy.o dtrmm_ounncopy.o dtrmm_olnucopy.o dtrmm_olnncopy.o dtrmm_outucopy.o dtrmm_outncopy.o dtrmm_oltucopy.o dtrmm_oltncopy.o dtrsm_iunucopy.o dtrsm_iunncopy.o dtrsm_ilnucopy.o dtrsm_ilnncopy.o dtrsm_iutucopy.o dtrsm_iutncopy.o dtrsm_iltucopy.o dtrsm_iltncopy.o dtrsm_ounucopy.o dtrsm_ounncopy.o dtrsm_olnucopy.o dtrsm_olnncopy.o dtrsm_outucopy.o dtrsm_outncopy.o dtrsm_oltucopy.o dtrsm_oltncopy.o dsymm_iutcopy.o dsymm_iltcopy.o dsymm_outcopy.o dsymm_oltcopy.o domatcopy_k_cn.o domatcopy_k_rn.o domatcopy_k_ct.o domatcopy_k_rt.o dimatcopy_k_cn.o dimatcopy_k_rn.o dimatcopy_k_ct.o dimatcopy_k_rt.o dgeadd_k.o camax_k.o camin_k.o icamax_k.o icamin_k.o casum_k.o caxpy_k.o caxpyc_k.o ccopy_k.o cdotc_k.o cdotu_k.o cnrm2_k.o csrot_k.o cscal_k.o cswap_k.o caxpby_k.o cgemv_n.o cgemv_t.o cgemv_r.o cgemv_c.o cgemv_o.o cgemv_u.o cgemv_s.o cgemv_d.o csymv_U.o csymv_L.o chemv_U.o chemv_L.o chemv_V.o chemv_M.o cgeru_k.o cgerc_k.o cgerv_k.o cgerd_k.o cgemm_kernel_n.o cgemm_kernel_r.o cgemm_kernel_l.o cgemm_kernel_b.o cgemm_beta.o ctrmm_kernel_LN.o ctrmm_kernel_LT.o ctrmm_kernel_LR.o ctrmm_kernel_LC.o ctrmm_kernel_RN.o ctrmm_kernel_RT.o ctrmm_kernel_RR.o ctrmm_kernel_RC.o ctrsm_kernel_LN.o ctrsm_kernel_LT.o ctrsm_kernel_LR.o ctrsm_kernel_LC.o ctrsm_kernel_RN.o ctrsm_kernel_RT.o ctrsm_kernel_RR.o ctrsm_kernel_RC.o cgemm3m_kernel.o ctrmm_iunucopy.o ctrmm_iunncopy.o ctrmm_ilnucopy.o ctrmm_ilnncopy.o ctrmm_iutucopy.o ctrmm_iutncopy.o ctrmm_iltucopy.o ctrmm_iltncopy.o ctrmm_ounucopy.o ctrmm_ounncopy.o ctrmm_olnucopy.o ctrmm_olnncopy.o ctrmm_outucopy.o ctrmm_outncopy.o ctrmm_oltucopy.o ctrmm_oltncopy.o ctrsm_iunucopy.o ctrsm_iunncopy.o ctrsm_ilnucopy.o ctrsm_ilnncopy.o ctrsm_iutucopy.o ctrsm_iutncopy.o ctrsm_iltucopy.o ctrsm_iltncopy.o ctrsm_ounucopy.o ctrsm_ounncopy.o ctrsm_olnucopy.o ctrsm_olnncopy.o ctrsm_outucopy.o ctrsm_outncopy.o ctrsm_oltucopy.o ctrsm_oltncopy.o csymm_iutcopy.o csymm_iltcopy.o csymm_outcopy.o csymm_oltcopy.o chemm_iutcopy.o chemm_iltcopy.o chemm_outcopy.o chemm_oltcopy.o cgemm3m_incopyb.o cgemm3m_itcopyb.o cgemm3m_incopyr.o cgemm3m_itcopyr.o cgemm3m_incopyi.o cgemm3m_itcopyi.o cgemm3m_oncopyb.o cgemm3m_otcopyb.o cgemm3m_oncopyr.o cgemm3m_otcopyr.o cgemm3m_oncopyi.o cgemm3m_otcopyi.o csymm3m_iucopyb.o csymm3m_oucopyb.o csymm3m_iucopyr.o csymm3m_oucopyr.o csymm3m_iucopyi.o csymm3m_oucopyi.o csymm3m_ilcopyb.o csymm3m_olcopyb.o csymm3m_ilcopyr.o csymm3m_olcopyr.o csymm3m_ilcopyi.o csymm3m_olcopyi.o chemm3m_iucopyb.o chemm3m_oucopyb.o chemm3m_iucopyr.o chemm3m_oucopyr.o chemm3m_iucopyi.o chemm3m_oucopyi.o chemm3m_ilcopyb.o chemm3m_olcopyb.o chemm3m_ilcopyr.o chemm3m_olcopyr.o chemm3m_ilcopyi.o chemm3m_olcopyi.o comatcopy_k_cn.o comatcopy_k_rn.o comatcopy_k_ct.o comatcopy_k_rt.o comatcopy_k_cnc.o comatcopy_k_rnc.o comatcopy_k_ctc.o comatcopy_k_rtc.o cimatcopy_k_cn.o cimatcopy_k_rn.o cimatcopy_k_ct.o cimatcopy_k_rt.o cimatcopy_k_cnc.o cimatcopy_k_rnc.o cimatcopy_k_ctc.o cimatcopy_k_rtc.o cgeadd_k.o zamax_k.o zamin_k.o izamax_k.o izamin_k.o zasum_k.o zaxpy_k.o zaxpyc_k.o zcopy_k.o zdotc_k.o zdotu_k.o znrm2_k.o zdrot_k.o zscal_k.o zswap_k.o zaxpby_k.o zgemv_n.o zgemv_t.o zgemv_r.o zgemv_c.o zgemv_o.o zgemv_u.o zgemv_s.o zgemv_d.o zsymv_U.o zsymv_L.o zhemv_U.o zhemv_L.o zhemv_V.o zhemv_M.o zgeru_k.o zgerc_k.o zgerv_k.o zgerd_k.o zgemm_kernel_n.o zgemm_kernel_r.o zgemm_kernel_l.o zgemm_kernel_b.o zgemm_beta.o ztrmm_kernel_LN.o ztrmm_kernel_LT.o ztrmm_kernel_LR.o ztrmm_kernel_LC.o ztrmm_kernel_RN.o ztrmm_kernel_RT.o ztrmm_kernel_RR.o ztrmm_kernel_RC.o ztrsm_kernel_LN.o ztrsm_kernel_LT.o ztrsm_kernel_LR.o ztrsm_kernel_LC.o ztrsm_kernel_RN.o ztrsm_kernel_RT.o ztrsm_kernel_RR.o ztrsm_kernel_RC.o zgemm3m_kernel.o ztrmm_iunucopy.o ztrmm_iunncopy.o ztrmm_ilnucopy.o ztrmm_ilnncopy.o ztrmm_iutucopy.o ztrmm_iutncopy.o ztrmm_iltucopy.o ztrmm_iltncopy.o ztrmm_ounucopy.o ztrmm_ounncopy.o ztrmm_olnucopy.o ztrmm_olnncopy.o ztrmm_outucopy.o ztrmm_outncopy.o ztrmm_oltucopy.o ztrmm_oltncopy.o ztrsm_iunucopy.o ztrsm_iunncopy.o ztrsm_ilnucopy.o ztrsm_ilnncopy.o ztrsm_iutucopy.o ztrsm_iutncopy.o ztrsm_iltucopy.o ztrsm_iltncopy.o ztrsm_ounucopy.o ztrsm_ounncopy.o ztrsm_olnucopy.o ztrsm_olnncopy.o ztrsm_outucopy.o ztrsm_outncopy.o ztrsm_oltucopy.o ztrsm_oltncopy.o zsymm_iutcopy.o zsymm_iltcopy.o zsymm_outcopy.o zsymm_oltcopy.o zhemm_iutcopy.o zhemm_iltcopy.o zhemm_outcopy.o zhemm_oltcopy.o zgemm3m_incopyb.o zgemm3m_itcopyb.o zgemm3m_incopyr.o zgemm3m_itcopyr.o zgemm3m_incopyi.o zgemm3m_itcopyi.o zgemm3m_oncopyb.o zgemm3m_otcopyb.o zgemm3m_oncopyr.o zgemm3m_otcopyr.o zgemm3m_oncopyi.o zgemm3m_otcopyi.o zsymm3m_iucopyb.o zsymm3m_oucopyb.o zsymm3m_iucopyr.o zsymm3m_oucopyr.o zsymm3m_iucopyi.o zsymm3m_oucopyi.o zsymm3m_ilcopyb.o zsymm3m_olcopyb.o zsymm3m_ilcopyr.o zsymm3m_olcopyr.o zsymm3m_ilcopyi.o zsymm3m_olcopyi.o zhemm3m_iucopyb.o zhemm3m_oucopyb.o zhemm3m_iucopyr.o zhemm3m_oucopyr.o zhemm3m_iucopyi.o zhemm3m_oucopyi.o zhemm3m_ilcopyb.o zhemm3m_olcopyb.o zhemm3m_ilcopyr.o zhemm3m_olcopyr.o zhemm3m_ilcopyi.o zhemm3m_olcopyi.o zomatcopy_k_cn.o zomatcopy_k_rn.o zomatcopy_k_ct.o zomatcopy_k_rt.o zomatcopy_k_cnc.o zomatcopy_k_rnc.o zomatcopy_k_ctc.o zomatcopy_k_rtc.o zimatcopy_k_cn.o zimatcopy_k_rn.o zimatcopy_k_ct.o zimatcopy_k_rt.o zimatcopy_k_cnc.o zimatcopy_k_rnc.o zimatcopy_k_ctc.o zimatcopy_k_rtc.o zgeadd_k.o lsame.o scabs1.o dcabs1.o |
I see in a post to set the TARGET=NEHALEM but that's an Intel processor, is there any way to get to this to work with ARM? |
TARGET=ARMV8 should already take care of that. Did you do a |
Yep |
The actual error is above where sgemm_kernel.o was (not) compiled. |
Well this is my whole build.log. |
Something is going very wrong here - it is trying to compile BLAS kernels for x86_64 apparently although it realized it should build a libopenblas_armv8 at some point. Is that really the log from a build with TARGET=ARMV8 set - it looks more like a mix of the autodetected host architecture (TARGET not set on the command line) and the effects of running a cross compiler ? |
I mean I type make TARGET=ARMV8, I'm not sure what else I should do. |
I think I got it - it is probably picking up the host compiler now when you just set CC=gcc rather than CC=/path/to/your/toolchain/gcc - this problem could not arise with clang as you have no clang outside the NDK. |
I can try a different level, I just thought using gcc would be easier. I will try API Lvl 28. |
Now I'm getting stdio.h not found, which if you look at the NDK_BUNDLE_DIR/platform/android-28/arch-arm64/usr folder there isn't a stdio.h but there is one in NDK_BUNDLE_DIR/sysroot/usr/include. Setting that to my sysroot I still get the error. Is it possible for someone to just rewrite the instructions for this, because I feel like I have tried this in every way but I'm clearly missing something fundamental here that isn't working. |
And if I get rid of usr/include in sysroot I'm missing asm/types.h |
I used this link and did these commands on linux and it worked using NDK 14, clang, and API lvl 21. I don't know what's wrong with windows10 version. |
I'm struggling to build OpenBlas using the steps in https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android Build ARMV8 with clang.
I keep getting the error - make: *** No targets specified and no makefile found. Stop.
I don't know how to fix this.
Here are the steps I took:
Created my own toolchain.
export NDKROOT=C:/Users/Jeff/AppData/Local/Android/Sdk/ndk-bundle python $NDKROOT/build/tools/make_standalone_toolchain.py --arch arm64 --api 22 --install-dir \ C:/Users/Jeff/Documents/OpenBlasToolchain --force
Attempted to compile OpenBlas
export NDK_BUNDLE_DIR=C:\\Users\\Jeff\\AppData\\Local\\Android\\Sdk\\ndk-bundle export PATH=$PATH:${NDK_BUNDLE_DIR}\\OpenBlasToolchain\\bin export LDFLAGS="-L${NDK_BUNDLE_DIR}\\OpenBlasToolchain\\lib\\gcc\\aarch64-linux-android\\4.9.x -lm" export CLANG_FLAGS="-target aarch64-linux-android --sysroot ${NDK_BUNDLE_DIR}}\\OpenBlasToolchain\\sysroot\\usr\\include -gcc-toolchain ${NDK_BUNDLE_DIR}\\OpenBlasToolchain\\bin" make TARGET=ARMV8 AR=ar CC="clang ${CLANG_FLAGS}" NOFORTRAN=1 NO_LAPACK=1 HOSTCC=gcc
Help is appreciated!
The text was updated successfully, but these errors were encountered: