1

I am creating a C program in MacOS and I would like to do Matrix-Vector multiplication. My target platform is a desktop computer with multiple cores. The development environment I have chosen is XCode. I am not married to XCode; I do insist on coding in C (and not Objective-C or C++).

I would like to call BLAS / LAPACK functions. How do I do so?

Apple offers a library called Accelerate. However, the examples I see don't look like C code to me. I'm guessing it's Objective-C, but I don't know. Is there a way to call these functions from a C program? How is it done?

Any help is appreciated.

user24205
  • 481
  • 5
  • 15

1 Answers1

0

The Apple developer web site is probably showing the Swift interface for calling C functions.

Just include cblas.h or clapack.h and you should be fine.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
  • clbas.h is not found when I include it. If it were found, is there a Swift interface? Where do I find it? – user24205 Jan 12 '20 at 17:06
  • I don't have any experience with this. Try these https://stackoverflow.com/questions/19615629/framework-accelerate-where-to-include-accelerate-accelerate-h and https://stackoverflow.com/questions/33341127/cannot-link-the-blas-from-accelerate-framework-during-compilation-os-yosemite-1 – Paul Floyd Jan 12 '20 at 18:45
  • 1
    `cblas.h` is in the Accelerate framework, so you should say `#include `. – JWWalker Jan 13 '20 at 00:50