Skip to content

How to build OpenBLAS for iPhone iOS (ARMV7) #1340

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

Closed
PingshengZhao opened this issue Oct 31, 2017 · 4 comments
Closed

How to build OpenBLAS for iPhone iOS (ARMV7) #1340

PingshengZhao opened this issue Oct 31, 2017 · 4 comments

Comments

@PingshengZhao
Copy link

PingshengZhao commented Oct 31, 2017

I built it with the following command, but it went wrong(On the release-0.2.21 branch
TOOLCHAIN_PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin SYSROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk make clean make TARGET=ARMV7 BINARY=32 HOSTCC=clang CC="$TOOLCHAIN_PATH/clang -isysroot $SYSROOT_PATH -arch armv7 -miphoneos-version-min=8.0 -O2" NOFORTRAN=1 libs
An error message
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch armv7 -miphoneos-version-min=8.0 -O2 -c -O2 -DMAX_STACK_ALLOC=2048 -marm -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -mfpu=vfpv3 -march=armv7-a -DASMNAME=_sscal_k -DASMFNAME=_sscal_k_ -DNAME=sscal_k_ -DCNAME=sscal_k -DCHAR_NAME=\"sscal_k_\" -DCHAR_CNAME=\"sscal_k\" -DNO_AFFINITY -I.. -UDOUBLE -UCOMPLEX -UCOMPLEX -UDOUBLE ../kernel/arm/../arm/scal.c -o sscal_k.o <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:3:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:3:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:3:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:4:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:4:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:4:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:5:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:5:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:5:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:6:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:6:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:6:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:8:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:8:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:8:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:9:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:9:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:9:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:10:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:10:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:10:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ <instantiation>:11:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ <instantiation>:11:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ <instantiation>:11:2: note: while in macro instantiation KERNEL_F1 ^ ../kernel/arm/nrm2_vfpv3.S:442:2: note: while in macro instantiation KERNEL_F8 ^ <instantiation>:5:21: error: unexpected token in argument list beq KERNEL_F1_NEXT_\@ ^ ../kernel/arm/nrm2_vfpv3.S:455:2: note: while in macro instantiation KERNEL_F1 ^ <instantiation>:11:21: error: unexpected token in argument list bge KERNEL_F1_NEXT_\@ ^ ../kernel/arm/nrm2_vfpv3.S:455:2: note: while in macro instantiation KERNEL_F1 ^ <instantiation>:18:16: error: unexpected token in operand KERNEL_F1_NEXT_\@: ^ ../kernel/arm/nrm2_vfpv3.S:455:2: note: while in macro instantiation KERNEL_F1 ^ make[1]: *** [snrm2_k.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [libs] Error 1
How to solve this problem?
thank you!

@brada4
Copy link
Contributor

brada4 commented Oct 31, 2017

Can you try with GNU make instead of (xcode default) BSD make (if it succeeds it is certainly a bug in build system of OpenBLAS)

@martin-frbg
Copy link
Collaborator

I do not think using a different make tool will help here - this error came up in #569 (see comments by @ashwinyes from Mar 12 near the end of that thread). The solution would appear to be to comment the four entries using nrm2_vfpv3.S at the top of kernel/arm/KERNEL.ARMV7 as the clang assembler apparently does not understand the use of the "@" character in macro names.
On the other hand, according to the more recent #1305, using the instructions from the wiki entry
https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-iPhone-iOS-(ARMv8) and just substituting ARMV7 for the target seemed to go well without any changes to the code - not sure if the difference lies in one of the options given in the wiki entry, or in using a more recent version of clang.

@martin-frbg
Copy link
Collaborator

@PingshengZhao so did you get it to compile, or did you drop OpenBLAS for your project ?

@PingshengZhao
Copy link
Author

@martin-frbg no compile success,your method on armv7 compilation fails.The current approach is to use OpenBLAS on the arm64 architecture, with other architectures using Accelerate.
English is not good, please forgive me.
Thank you.

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