supranational / blst

Multilingual BLS12-381 signature library
Apache License 2.0
458 stars 175 forks source link

How to compile the library libblst.a for iOS platform #176

Closed skibinalexander closed 1 year ago

skibinalexander commented 1 year ago

Hello, we need to compile your library for ios platform. We tried many ways, we do not understand how to do it. We would be grateful if you could explain. As I understand it, you need to compile under arm64

dot-asm commented 1 year ago

blst/build.sh 'CC="xcrun -sdk iphoneos cc -arch arm64"'

skibinalexander commented 1 year ago

@dot-asm Thank you, I success managed to compile for the device, but for some reason error for the simulator, the compiler. May be do have a some idea, for fix this problem?

skibinalexander commented 1 year ago

Accept command:

./build.sh 'CC="xcrun -sdk iphonesimulator cc -arch arm64"'

But now I need the need to have the possibility in one file for both the device and the simulator, any ideas?

dot-asm commented 1 year ago

Here is the secret. My experience with iOS is relatively limited, and non-existent with simulator. I've managed to test the Rust build on an iPad at an earlier point, so I know it works in principle. Then I simply recognized that spaces in arguments to build.sh don't work as intuitively expected, for example as build.sh CFLAGS="-arch arm64" and figured how to make them, spaces, work. That is all, I have nothing left to give. I see no reason for why you can't figure out the rest by yourself.