Skip to content
Prev 5769 / 15075 Next

cblas on Mac and Linux

Hi,

I've got a package with some C code calling cblas functions (e.g., 
cblas_dgemm). The code is called using .C() . In order to compile 
correctly either cblas.h on Linux or Accelerate.h on a Mac:

#include <R.h>
#ifdef MACOSX
#include <Accelerate/Accelerate.h>
#else
#include <cblas.h>
#endif

Of course, this doesn't work well with the standard Makevars 
PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) since I need to set the 
-DMACOSX flag for each platform.

Do I need to create another makefile to decide which OS the code is 
running on, or is there an easier way of doing this?

Thanks,
Gad