Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
I am using the accelerate framework, but get "implicit declaration of function" warnings when using the sgetrf() and sgetrs() functions.
The code works fine, but those two warnings annoy the hell out me.
I don't think I should define those functions anywhere since they are already defined in the clapack header.

Any idea how to get rid of these warnings? Thanks.

Code:
#import "MyObject.h"
#import <Accelerate/Accelerate.h>
#import <vecLib/vecLib.h> //does not get rid of warning
#import <vecLib/clapack.h> //does not get rid of warning
// #import <Accelerate/vecLib/clapack.h> //does not compile
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

EDIT: Because we're calling Fortran code, so apparently the trailing underscore is to be expected. It also explains why all the arguments are passed by reference. However the examples in the Use the Accelerate Framework for Data Processing guide doesn't show the trailing underscores.
 
Last edited:

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,420
A sea of green
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

Maybe there's a sgetrf() macro somewhere that's defined in terms of sgetrf_().
 

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

EDIT: Because we're calling Fortran code, so apparently the trailing underscore is to be expected. It also explains why all the arguments are passed by reference. However the examples in the Use the Accelerate Framework for Data Processing guide doesn't show the trailing underscores.

That does the trick. Thanks. I also doubt the underscore was present in the examples I found a while back and I obviously overlooked them in the header file.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.