When I submit an iOS app with armadillo, the BLAS symbols are rejected as private (ITMS-90338: Non-public API usage)

Viewed 110

I have an app which uses the armadillo library to do some matrix calculations. It compiles fine against the Accelerate.framework, but is rejected at the app store:

ITMS-90338: Non-public API usage - The app references non-public symbols...ddot, dgemm, dgemv, dsyrk.

These symbols are from the BLAS library and are included in Accelerate, but are apparently not public. Is there a way to use armadillo without getting this error?

1 Answers

For iOS, one problem that arises when you submit the app store is you will get a rejection unless you tell the armadillo library to NOT use BLAS.

You might also get the same for any of these symbols:

_sasum_ _dasum_ _snrm2_ _dnrm2_ _sdot_ _ddot_ 
_sgemv_ _dgemv_ _cgemv_ _zgemv_ _sgemm_ _dgemm_ 
_cgemm_ _zgemm_ _ssyrk_ _dsyrk_ _cherk_ _zherk_

These are all used by BLAS for doing faster matrix calculation, but are in fact not necessary for basic functionality. To turn off BLAS go to the armadillo_bits/config.hpp wherever you are linking to armadillo and comment out line 26:

#if !defined(ARMA_USE_BLAS)
//#define ARMA_USE_BLAS
//// Comment out the above line if you don't have BLAS or a high-speed replacement for BLAS,
//// such as OpenBLAS, GotoBLAS, Intel MKL, AMD ACML, or the Accelerate framework.
//// BLAS is used for matrix multiplication.
//// Without BLAS, matrix multiplication will still work, but might be slower.
#endif

This will now mean you can use armadillo without BLAS and the app store will not reject the binary. If you WANT to use BLAS, you could have a look in wrapper_blas.h and def_blas.h and do some replacement with the provided public API (eg. https://developer.apple.com/documentation/accelerate/1513282-cblas_dgemm?language=objc) - but this was not necessary for my project and I didn't have time to check if it would all work (and I have to admit I have more interesting free time projects...)

Related