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

win10 + androidndk + clang #1823

Closed
jeffmorr opened this issue Oct 17, 2018 · 40 comments
Closed

win10 + androidndk + clang #1823

jeffmorr opened this issue Oct 17, 2018 · 40 comments

Comments

@jeffmorr
Copy link

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!

@martin-frbg
Copy link
Collaborator

"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)

@jeffmorr
Copy link
Author

Ah yeah I see it now, I definitely was in the wrong directory. But unfournately I have a new error now which is this:
process_begin: CreateProcess(NULL, gcc -DFORCE_ARMV8 -DGEMM_MULTITHREAD_THRESHOLD=4 -DNO_PARALLEL_MAKE=0 -o getarch getarch.c cpuid.S, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [getarch] Error 2
OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS.
process_begin: CreateProcess(NULL, ln -fs cygopenblas_haswellp-r0.3.4.dev.a cygopenblas.a, ...) failed.
make (e=2): The system cannot find the file specified.
make: [libs] Error 2 (ignored)
d was unexpected at this time.
make: *** [libs] Error 255

@martin-frbg
Copy link
Collaborator

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)

@jeffmorr
Copy link
Author

No I only have clang, is that an extra dependency I need to download? I thought the documentation stated we needed GCC or Clang.

@martin-frbg
Copy link
Collaborator

It is the HOSTCC=gcc argument it is struggling with - this sets what (non-crosscompiling) C compiler to use for building the getarch tool.

@jeffmorr
Copy link
Author

Okay so I installed gcc and am now getting an error when running:
make TARGET=ARMV8 AR=ar CC="clang ${CLANG_FLAGS}" NOFORTRAN=1 NO_LAPACK=1 HOSTCC=gcc FC=FAKE

The error is:
OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS.
make[1]: Entering directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-Develop/interface'
clang -target aarch64-linux-android -gcc-toolchain \OpenBlasToolchain\bin --sysroot=C:\Users\Jeff\AppData\Local\Android\Sdk\ndk-bundle/platforms/android-22/arch-arm64
clang -target aarch64-linux-android -gcc-toolchain \OpenBlasToolchain\bin --sysroot=C:\Users\Jeff\AppData\Local\Android\Sdk\ndk-bundle/platforms/android-22/arch-arm64
clang.exe: error: no input files
clang.exe: error: no input files
make[1]: *** [Makefile:723: saxpy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:795: sswap.o] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-Develop/interface'
make: *** [Makefile:140: libs] Error 1

I was reading this post #1513 and added the FC=FAKE arg but that still didn't work. Is perl necessary?

@brada4
Copy link
Contributor

brada4 commented Oct 17, 2018

Perl is necessary just like valid native HOSTCC, probably HOSTCC=clang in place of gcc
Strawberry one worked for me if you dont want to get some mingw gcc bundle for 2 programs

@martin-frbg
Copy link
Collaborator

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 gensymbol perl script for a few cases related to shared libraries)

@jeffmorr
Copy link
Author

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?

@martin-frbg
Copy link
Collaborator

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.

@jeffmorr
Copy link
Author

Okay I'll try that out.

@jeffmorr
Copy link
Author

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'
make[1]: Entering directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-develop/exports'
perl ./gensymbol linktest arm64 _ 0 0 1 1 0 0 "" "" 1 > linktest.c
clang -target aarch64-linux-android -gcc-toolchain C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBlasToolchain\bin --sysroot=C:\Users\Jeff\Downloads\android-ndk-r14b/platforms/android-22/arch-arm64 -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -march=armv8-a -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME="" -DCHAR_CNAME="" -DNO_AFFINITY -I.. -LC:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\lib\gcc\aarch64-linux-android\4.9.x -lm -shared -o ../libopenblas_armv8p-r0.3.4.dev.so
-Wl,--whole-archive ../libopenblas_armv8p-r0.3.4.dev.a -Wl,--no-whole-archive
-Wl,-soname,libopenblas.so -lm -lm -lm
clang -target aarch64-linux-android -gcc-toolchain C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBlasToolchain\bin --sysroot=C:\Users\Jeff\Downloads\android-ndk-r14b/platforms/android-22/arch-arm64 -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -march=armv8-a -DASMNAME= -DASMFNAME=
-DNAME=_ -DCNAME= -DCHAR_NAME="_" -DCHAR_CNAME="" -DNO_AFFINITY -I.. -LC:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\lib\gcc\aarch64-linux-android\4.9.x -lm -w -o linktest linktest.c ../libopenblas_armv8p-r0.3.4.dev.so -lm && echo OK.
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find crtbegin_dynamic.o: No such file or directory
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -lm
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -lm
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -lgcc
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -ldl
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -lc
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -lgcc
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find -ldl
C:\Users\Jeff\Downloads\android-ndk-r14b\OpenBLASToolchain\bin\aarch64-linux-android-ld.exe: cannot find crtend_android.o: No such file or directory
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:146: ../libopenblas_armv8p-r0.3.4.dev.so] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-develop/exports'
make: *** [Makefile:101: shared] Error 2

@martin-frbg
Copy link
Collaborator

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)

@jeffmorr
Copy link
Author

These are the new commands I have run:
python C:\\Users\\Jeff\\Downloads\\android-ndk-r14b\\build\\tools\\make_standalone_toolchain.py --arch arm64 --api 22 --install-dir C:\\Users\\Jeff\\Downloads\\android-ndk-r14b\\OpenBLASToolchain
export NDK_BUNDLE_DIR=C:\\Users\\Jeff\\Downloads\\android-ndk-r14b
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 -gcc-toolchain ${NDK_BUNDLE_DIR}\\OpenBlasToolchain\\bin"
export CFLAGS="--sysroot=${NDK_BUNDLE_DIR}/platforms/android-22/arch-arm64"
make TARGET=ARMV8 AR=ar CC="clang ${CLANG_FLAGS}" NOFORTRAN=1 NO_LAPACK=1 HOSTCC=gcc FC=FAKE CFLAGS=${CFLAGS}

Are there issues with NDK version 14b?

@martin-frbg
Copy link
Collaborator

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)

@jeffmorr
Copy link
Author

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?

@brada4
Copy link
Contributor

brada4 commented Oct 18, 2018

Nope, you need target toolchain (android NDK in your case)
and
2 local tools - C compiler and PERL interpreter, isolated, or bundled (mingw64 etc)

@jeffmorr
Copy link
Author

I'm still getting the same error using the prebuilt tool-chain that comes with android-22.
Using these commands:
export NDK_BUNDLE_DIR=C:\Users\Jeff\Downloads\android-ndk-r14b
export APP_ABI=android-22
export PATH=${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin:$PATH
export CFLAGS="--sysroot=${NDK_BUNDLE_DIR}/platforms/${APP_ABI}/arch-arm64"
export LDFLAGS="-L${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x -lm"
export CLANG_FLAGS="-target aarch64-linux-android --sysroot ${NDK_BUNDLE_DIR}/platforms/android-22/arch-arm64 -gcc-toolchain ${NDK_BUNDLE_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/"
make TARGET=ARMV8 ONLY_CBLAS=1 AR=ar CC="clang ${CLANG_FLAGS}" HOSTCC=gcc -j4

This is really starting to make no sense to me at all.

@brada4
Copy link
Contributor

brada4 commented Oct 18, 2018

Run make clean
If you type gcc --version in context where you invoke make - does it work well?

@jeffmorr
Copy link
Author

Yeah it tells me I'm using gcc 7.3.0

@brada4
Copy link
Contributor

brada4 commented Oct 18, 2018

You say same error I thought it is first one.... Second "same" error regardding C runtime objects googles to this:
https://stackoverflow.com/questions/16795583/android-error-cannot-open-crtbegin-dynamic-o-no-such-file-or-directory

@jeffmorr
Copy link
Author

Right and I set my sysroot in CFLAGS.

@martin-frbg
Copy link
Collaborator

Cannot make much sense of it either. Could you check which directory in your toolchain actually has the "missing" crtbegin_dynamic.o ?

@jeffmorr
Copy link
Author

I see crtbegin_dynamic.o in C:\Users\Jeff\Downloads\android-ndk-r14b\platforms\android-22\arch-arm64\usr\lib.
My system root is C:\Users\Jeff\Downloads\android-ndk-r14b\platforms\android-22\arch-arm64. Should it explicitly include \usr\lib?

@brada4
Copy link
Contributor

brada4 commented Oct 18, 2018

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.

@martin-frbg
Copy link
Collaborator

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)

@jeffmorr
Copy link
Author

Okay sounds good, I will try to build this with API Lvl 28

@jeffmorr
Copy link
Author

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
ar: sgemm_kernel.o: No such file or directory
make[1]: *** [../Makefile.tail:40: libs] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Jeff/Downloads/OpenBLAS-develop/kernel'
make: *** [Makefile:146: libs] Error 1

@jeffmorr
Copy link
Author

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?

@martin-frbg
Copy link
Collaborator

TARGET=ARMV8 should already take care of that. Did you do a make clean before this build attempt ?

@jeffmorr
Copy link
Author

Yep

@brada4
Copy link
Contributor

brada4 commented Oct 18, 2018

The actual error is above where sgemm_kernel.o was (not) compiled.

@jeffmorr
Copy link
Author

jeffmorr commented Oct 19, 2018

Well this is my whole build.log.
Running make TARGET=ARMV8 ONLY_CBLAS=1 AR=ar CC="gcc ${CLANG_FLAGS}" HOSTCC=gcc -j4 -k 2>&1 | tee build.log shows I have a lot of undefined references of zgemm3m objects.

@martin-frbg
Copy link
Collaborator

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 ?

@jeffmorr
Copy link
Author

I mean I type make TARGET=ARMV8, I'm not sure what else I should do.

@martin-frbg
Copy link
Collaborator

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 assume just using clang with a different Android API level did not solve the original crtbegin problem, or was this combination not available ?

@jeffmorr
Copy link
Author

I can try a different level, I just thought using gcc would be easier. I will try API Lvl 28.

@jeffmorr
Copy link
Author

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.

@jeffmorr
Copy link
Author

And if I get rid of usr/include in sysroot I'm missing asm/types.h

@jeffmorr
Copy link
Author

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.
http://jcsilva.github.io/2017/03/18/compile-kaldi-android/

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

3 participants