Need to include Accelerate framework in Xcode
During the past week, I've been building a massive static library (>1000 C files) with files that have been generated by an independent third-party.
Currently, I'm programming an app that will have some intense computations and it appears that i need to add the CLAPACK library. I believe the Acceleration framework is the way to go, but i just can't seem to get it to behave:
without the framework I have a bunch of linker errors telling me I'm missing, among other, cblas_zgemm and dgetrf (there are over a dozen in total spread over some 30 files).
after I add the framewor开发者_运维百科k to the project and without changing my code one iota, the cblas_zgemm linker error disappears, but dgetrf remains (despite belonging to the framework).
If I add #include (or #import) <Accelerate/Accelerate.h>
, I get well over 1000 linker errors, telling me I'm redeclaring a bunch of enumerators (e.g. CblasTrans) and that there are conflicting types for xyz... The error messages seem to be repeating themselves, meanwhile dgetrf remains undefined.
What I'm doing wrong/ what am I missing?
thanks
edit: the full error messages after I add the are:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h:12: error: redeclaration of enumerator 'CblasLower'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h:182: error: conflicting types for 'cblas_sgemv'
edit 2: the original linker errors after I added the framework:
"_dgetrf", referenced from:
_aaConditionNumber in libccodeLab.a(condNumber.o)
_aaInvMatrixLUDri in libccodeLab.a(invMtrxLUDri.o)
_aaLUFactorEx in libccodeLab.a(LU.o)
"_dgetri", referenced from:
_aaConditionNumber in libccodeLab.a(condNumber.o)
_aaInvMatrixLUDri in libccodeLab.a(invMtrxLUDri.o)
_aaLUInvMatrix in libccodeLab.a(LUInvMtrx.o)
"_zgesdd", referenced from:
_aaCxSVD in libccodeLab.a(cxSVD.o)
"_dgeev", referenced from:
_aaGenEigenValueVector in libccodeLab.a(eigenV.o)
"_dpotrf", referenced from:
_aaInvMatrixChoDri in libccodeLab.a(invMtrxChoDri.o)
"_dpotri", referenced from:
_aaInvMatrixChoDri in libccodeLab.a(invMtrxChoDri.o)
"_dtrtri", referenced from:
_aaInvMatrixTriDri in libccodeLab.a(invMtrxTriDri.o)
"_dgelqf", referenced from:
_aaQRWithoutPivot in libccodeLab.a(QRWithoutPivot.o)
"_dorglq", referenced from:
_aaQRWithoutPivot in libccodeLab.a(QRWithoutPivot.o)
"_dgesdd", referenced from:
_aaSVDS in libccodeLab.a(SVDS.o)
_aaSVD in libccodeLab.a(SVD.o)
"_dsyevd", referenced from:
_aaSymEigenValueVector in libccodeLab.a(symEigenV.o)
so after reading through some of the documentations i don't need to add an include statement: simply having the framework in the project is sufficient.
The problem is that Apple's LAPACK doesn't recognize _dgetrf
, rather it's looking for dgetrf_
. Also everything must be passed by reference.
the documentation can be found here: Vector Libraries
精彩评论