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

Compile for iOS ARMV7 #1758

Closed
bitianchi opened this issue Sep 10, 2018 · 20 comments
Closed

Compile for iOS ARMV7 #1758

bitianchi opened this issue Sep 10, 2018 · 20 comments

Comments

@bitianchi
Copy link

bitianchi commented Sep 10, 2018

When I build openblas for ios armv7, some errors coming up.
I use the following commands to build openblas.

TOOLCHAIN_PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
SYSROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk
make clean
make TARGET=ARMV7 BINARY=64 HOSTCC=clang CC="$TOOLCHAIN_PATH/clang -isysroot $SYSROOT_PATH -arch armv7 -miphoneos-version-min=8.0 -O2" NOFORTRAN=1 libs

The following file is the log.
err.log

@bitianchi
Copy link
Author

@martin-frbg Could you please take a look at this?

@martin-frbg
Copy link
Collaborator

Indeed looks a lot like #1531 - my patch there was for ARMV8 only, and it could be that ARMV7 needs more and different changes besides replacing the nrm2 functions with their C equivalents. Could you try how much further you get when you replace the four NRM2 entries like we did in #1531 ?

@bitianchi
Copy link
Author

The question is I have no idea about the replacement of nrm2_vfpv3.S

@martin-frbg
Copy link
Collaborator

If you just comment out the four lines in KERNEL.ARMV7, it should pick up nrm2.c (for SNRM2 and DNRM2) and znrm2.c (for C/ZNRM2) from the basic KERNEL file in kernel/arm.

@brada4
Copy link
Contributor

brada4 commented Sep 11, 2018

IphoneOS 11.0 does not run on armv7 processors. It is safe to make it armv8

@xsacha
Copy link
Contributor

xsacha commented Sep 11, 2018

Looks like he is targeting iOS 8.0 though:
miphoneos-version-min=8.0

@bitianchi
Copy link
Author

Yes, we need to support IOS 8.0

@bitianchi
Copy link
Author

One more question:
make TARGET=ARMV7 BINARY=64 HOSTCC=clang CC="$TOOLCHAIN_PATH/clang -isysroot $SYSROOT_PATH -arch armv7 -miphoneos-version-min=8.0 -O2" NOFORTRAN=1 libs
TARGET=ARMV7 is this right?

@martin-frbg
Copy link
Collaborator

Yes, that is correct for general ARMv7 cpu support. (Cortex A9 and A15 targets use the same KERNEL.ARMV7 file but have individual settings for cache sizes etc.)

@martin-frbg
Copy link
Collaborator

"BINARY=64" probably does not makes sense with the ARMV7 target though (aren't they 32bit cpus, while ARMV8 can support both 32/64 ?)

@bitianchi
Copy link
Author

I got it. Thanks

@brada4
Copy link
Contributor

brada4 commented Sep 11, 2018

@martin-frbg 32bit support goes away in iOS11
iOS8 supports 64bit apps too.

@martin-frbg
Copy link
Collaborator

Should not affect building for earlier versions as seems to be intended here, or does it ? (Not sure what having 64bit support in IOS8 has to do with it)

@brada4
Copy link
Contributor

brada4 commented Sep 11, 2018

All phones targeted are ARMv8, just that. Latest ones will not run 32bit binary if they get connected to wifi sometimes....

@xsacha
Copy link
Contributor

xsacha commented Sep 11, 2018

To be honest I never target iOS because that platform has a built in BLAS implementation called Accelerate. Saves a lot of headache.

@bitianchi
Copy link
Author

It seems in armv8, there is no definition of _scopy_k

armv7:

image

armv8

image

error:

image

Is there any solutions? Thanks

@martin-frbg
Copy link
Collaborator

Did you see any errors in the build log ? If the IOS compiler did not like the assembly implementation in copy.S, you will need to replace the xCOPYKERNEL entries in KERNEL.ARMV8 with the corresponding C functions from ../arm like we did with NRM2. (And it looks as if this continues with xAXPY and xGER)

@martin-frbg
Copy link
Collaborator

Did you make any progress ? (I notice the problems you saw with scopy_k etc. never came up in #1531, which makes me wonder if something else got broken in your build)

@bitianchi
Copy link
Author

bitianchi commented Sep 20, 2018

I had changed OpenBlas to Accelerate.

@martin-frbg
Copy link
Collaborator

I see. So this can be closed if you are not going to continue with OpenBLAS on IOS ?

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

4 participants