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

How to build openblas for iOS? #1305

Closed
cblin opened this issue Sep 18, 2017 · 18 comments
Closed

How to build openblas for iOS? #1305

cblin opened this issue Sep 18, 2017 · 18 comments

Comments

@cblin
Copy link

cblin commented Sep 18, 2017

I tried https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-iPhone-iOS-(ARMv8), but it didn't work.

@martin-frbg
Copy link
Collaborator

Please post the build log, or at least the error messages you got ?

@cblin
Copy link
Author

cblin commented Sep 18, 2017

Hi, @martin-frbg, when I executing the .sh file, the terminal just print this: "make: *** No rule to make target `libs'. Stop.".

@martin-frbg
Copy link
Collaborator

Strange. Are you sure that you are executing the .sh in the correct folder ?

@cblin
Copy link
Author

cblin commented Sep 18, 2017

I put the .sh file into the unpacked OpenBLAS directory, the same as file "c_check".

@martin-frbg
Copy link
Collaborator

Hmm - you should see a "Makefile" there that definitely contains a libs target. Which version are you trying to build - is this with 0.2.20, current "develop" snapshot or some older release ?

@cblin
Copy link
Author

cblin commented Sep 18, 2017

I saw "Makefile". I tried 0.2.20 and "develop", both failed with same error message.

@martin-frbg
Copy link
Collaborator

Does make clean get any response ?

@cblin
Copy link
Author

cblin commented Sep 18, 2017

Log for "make clean" :
make[2]: Nothing to be done for clean'. rm -f x* rm -f *.o openblas_utest make[2]: Nothing to be done for clean'.
( cd INSTALL; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
( cd TESTING/LIN; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
( cd BLAS/TESTING; /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makeblat1 clean )
( cd CBLAS/testing; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
rm -f *.o
rm -f *.o
rm -f *.o
rm -f core *.o .out x
( cd BLAS/TESTING; /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makeblat2 clean )
( cd BLAS/SRC; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
( cd TESTING/EIG; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
rm -f *.o
rm -f .o
rm -f .o
( cd BLAS/TESTING; /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makeblat3 clean )
( cd CBLAS; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
( cd TESTING; rm -f xlin
xeig
)
rm -f .o
cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make clean
( cd BLAS; rm -f xblat
)
rm -f .o a.out core
( cd SRC; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
rm -f .o DEPRECATED/.o
( cd SRC/VARIANTS; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
rm -f cholesky/RL/cpotrf.o cholesky/RL/dpotrf.o cholesky/RL/spotrf.o cholesky/RL/zpotrf.o cholesky/TOP/cpotrf.o cholesky/TOP/dpotrf.o cholesky/TOP/spotrf.o cholesky/TOP/zpotrf.o lu/CR/cgetrf.o lu/CR/dgetrf.o lu/CR/sgetrf.o lu/CR/zgetrf.o lu/LL/cgetrf.o lu/LL/dgetrf.o lu/LL/sgetrf.o lu/LL/zgetrf.o lu/REC/cgetrf.o lu/REC/dgetrf.o lu/REC/sgetrf.o lu/REC/zgetrf.o qr/LL/cgeqrf.o qr/LL/dgeqrf.o qr/LL/sgeqrf.o qr/LL/zgeqrf.o qr/LL/sceil.o
LIB/
.a
( cd TESTING/MATGEN; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
rm -f *.o
( cd LAPACKE; /Applications/Xcode.app/Contents/Developer/usr/bin/make clean )
cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make clean
rm -f *.o
cd utils && /Applications/Xcode.app/Contents/Developer/usr/bin/make clean
rm -f .o
rm -f src/slauum.o src/clauum.o src/dlauum.o src/zlauum.o src/strtri.o src/dtrtri.o src/ctrtri.o src/ztrtri.o src/spotrf.o src/dpotrf.o src/cpotrf.o src/zpotrf.o src/sgetrf.o src/dgetrf.o src/cgetrf.o src/zgetrf.o src/cgbtrf.o src/cpbtrf.o src/dsytrf_rec2.o src/sgbtrf.o src/ssytrf_rook.o src/zhegst.o src/zsytrf_rec2.o src/cgemmt.o src/dgbtrf.o src/dsytrf_rook.o src/sgemmt.o src/ssytrf_rook_rec2.o src/zhetrf.o src/zsytrf_rook.o src/csytrf.o src/dgemmt.o src/dsytrf_rook_rec2.o src/stgsyl.o src/zhetrf_rec2.o src/zsytrf_rook_rec2.o src/chegst.o src/csytrf_rec2.o src/dtgsyl.o src/strsyl.o src/zhetrf_rook.o src/ztgsyl.o src/chetrf.o src/csytrf_rook.o src/dtrsyl.o src/spbtrf.o src/strsyl_rec2.o src/zhetrf_rook_rec2.o src/ztrsyl.o src/chetrf_rec2.o src/csytrf_rook_rec2.o src/dpbtrf.o src/dtrsyl_rec2.o src/ztrsyl_rec2.o src/chetrf_rook.o src/ctgsyl.o src/ssygst.o src/zgbtrf.o src/zpbtrf.o src/chetrf_rook_rec2.o src/ctrsyl.o src/dsygst.o src/f2c.o src/ssytrf.o src/zgemmt.o src/ctrsyl_rec2.o src/dsytrf.o src/lapack_wrappers.o src/ssytrf_rec2.o src/zsytrf.o test/util.o test/
.x
Done.

@martin-frbg
Copy link
Collaborator

Alright, so it had already built at least parts of the code. Can you please run the script again now ?

@cblin
Copy link
Author

cblin commented Sep 18, 2017

Every time I run "make clean", I got the same log message, maybe nothing built. After "make clean", I ran the script and got the same error message as before.

I am using macOS Sierra 10.12.6.

@martin-frbg
Copy link
Collaborator

Unfortunately I do not have iOS (nor macOS) for testing, The error message suggests that there is something wrong with the Makefile, but it is unlikely that you would get the same broken file no matter which version you downloaded. Perhaps the message is just confusing, and it actually built a libopenblas ? (Or if nobody else comes up with a more intelligent idea, try just leaving off the "libs" from the "make" commandline in the script - which would tell it to do a full build)

@cblin
Copy link
Author

cblin commented Sep 18, 2017

I tried "make" commandline without "libs", it works, but I can't find the .a file.
compile log.txt

@martin-frbg
Copy link
Collaborator

That compile log appears to have come from an entirely different project - building protobuf-2.6.1 with the native compiler or something ?

@martin-frbg
Copy link
Collaborator

By the way the instruction in the wiki was copied from #569 - maybe you will find additional information in that issue as it has been updated since then.

@cblin
Copy link
Author

cblin commented Sep 18, 2017

Sorry, I made a mistake on executing .sh.
Finally, I compiled the .a library(size is 3M), is it correct? I'll try it tomorrow.
By the way, how to build for armv7? Does armv7 supported?

@martin-frbg
Copy link
Collaborator

Not sure if anybody tried this for iOS, but in principle you would only need to replace the ARMV8 in the TARGET entry with ARMV7 (or the appropriate cortexa9/cortexa15 model for somewhat more optimized code, see TargetList.txt for the supported cpu models). If compiling for Android, see the corresponding wiki entry for Android NDK etc.

@martin-frbg
Copy link
Collaborator

So, did it work for you ?

@cblin
Copy link
Author

cblin commented Sep 21, 2017

Yes, I got ARMV7.a now. Thank you very much.

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

2 participants